소스 검색

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!502
黄梓星 1 년 전
부모
커밋
f9e0237c70
2개의 변경된 파일82개의 추가작업 그리고 7개의 파일을 삭제
  1. 33 1
      src/views/material/changeApply/index.vue
  2. 49 6
      src/views/purchase/PurchaseDemandList/add.vue

+ 33 - 1
src/views/material/changeApply/index.vue

@@ -59,6 +59,12 @@
           <el-table-column fixed="right" label="操作" width="150" align="center">
             <template slot-scope="scope">
               <el-button type="text" size="small" @click.stop="useSee(scope.row)">查看</el-button>
+              <el-button 
+                v-if="scope.row.status == '1'" 
+                type="text" 
+                size="mini"
+                @click.stop="handleBack(scope.row)"
+              >流程收回</el-button>
               <el-button  
                 v-if="scope.row.oaId && scope.row.oaId !=''" 
                 @click.stop="jumpFlow(scope.row)" 
@@ -79,10 +85,12 @@
 <script>
 import { dicts } from "./dicts";
 import { getChangeList , deleteChangeList,toOA} from '@/api/changeApply/basic';
+// 流程收回通用接口
+import {oaBack} from '@/api/requisition/basic';
 import useColumns from './columns';
 export default {
   name: 'changeApply',
-  dicts:dicts,
+  dicts:[...dicts, 'oa_templete_id'],
   components: {
     AddChangeOrders:() => import('./add/index.vue'),
     SeeChangeOrders:() => import('./see/index.vue'),
@@ -127,6 +135,30 @@ export default {
       }
     },
     
+    //流程收回
+    async handleBack(row){
+      console.log('row', row)
+      console.log('this.dicts.type', this.dict)
+      try {
+        const { msg, code } = await oaBack({
+          fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+            return item.label == "物料变更单"
+          }).value,
+          fdId: row.oaId,
+          billCode: row.code,
+          billMaker: row.createBy
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.useQuery(this.params, this.page);
+      }
+    },
+
     useReset(){
       this.page.pageNum = 1;
       this.page.pageSize = 10;

+ 49 - 6
src/views/purchase/PurchaseDemandList/add.vue

@@ -430,7 +430,7 @@
       <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">默认采购组织</el-col>
         <el-col :span="14">
-        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.purOrgName" @focus="chooseOrg('ORG_PARAM', true, '采购组织')">
+        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.purOrgName" @clear="clearHang(0, 'cgzz')" @focus="chooseOrg('ORG_PARAM', true, '采购组织')">
           <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('ORG_PARAM', true, '采购组织')"></el-button>
         </el-input>
         </el-col>
@@ -455,15 +455,15 @@
       <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">收货仓库</el-col>
         <el-col :span="14">
-        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.warehouseName" @focus="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')">
-          <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')"></el-button>
+        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.warehouseName" @clear="clearHang(0, 'shck')" @focus="adjustCangku('WAREHOUSE_PARAM', true, '收货仓库', adjust.puOrg)">
+          <el-button size="mini" slot="append" icon="el-icon-more" @click="adjustCangku('WAREHOUSE_PARAM', true, '收货仓库', adjust.puOrg)"></el-button>
         </el-input>
         </el-col>
       </el-row>
       <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">收货货位</el-col>
         <el-col :span="14">
-        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.allocationName" @focus="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)">
+        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.allocationName" @clear="clearHang(0, 'shhw')" @focus="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)">
           <el-button size="mini" slot="append" icon="el-icon-more" @click="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)"></el-button>
         </el-input>
         </el-col>
@@ -471,7 +471,7 @@
       <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">补单供应商</el-col>
         <el-col :span="14">
-        <el-input class="pltzIpt" clearable :disabled="sonDisable || BDZT" size="mini" v-model="adjust.additionalSupplierName" @focus="chooseOrg('SUPPLIER_PARAM', true, '补单供应商')">
+        <el-input class="pltzIpt" clearable :disabled="sonDisable || BDZT" size="mini" @clear="clearHang(0, 'bdgys')" v-model="adjust.additionalSupplierName" @focus="chooseOrg('SUPPLIER_PARAM', true, '补单供应商')">
           <el-button size="mini" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseOrg('SUPPLIER_PARAM', true, '补单供应商')"></el-button>
         </el-input>
         </el-col>
@@ -485,7 +485,7 @@
       <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">收货地址</el-col>
         <el-col :span="14">
-          <el-input class="pltzIpt" clearable size="mini" v-model="adjust.deliveryAddressName">
+          <el-input class="pltzIpt" clearable size="mini" @clear="clearHang(0, 'shdz')" v-model="adjust.deliveryAddressName">
             <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('ADDRESS_PARAM', true, '收货地址')"></el-button>
           </el-input>
         </el-col>
@@ -1748,6 +1748,37 @@ export default {
         this.basicForm.puDemandItemList[index].additionalSupplierName = null
         this.basicForm.puDemandItemList[index].additionalSupplier = null
       }
+      // 清空批量调整内字段
+      if (title == 'cgzz') {
+        this.adjust.purOrgName = ''
+        this.adjust.puOrg = ''
+        this.adjust.warehouse = ''
+        this.adjust.warehouseName = ''
+        this.adjust.allocation = ''
+        this.adjust.allocationName = ''
+      }
+      if (title == 'shck') {
+        this.adjust.warehouse = ''
+        this.adjust.warehouseName = ''
+        this.adjust.allocation = ''
+        this.adjust.allocationName = ''
+        this.adjust.csFlag = ''
+      }
+      if (title == 'shhw') {
+        this.adjust.allocation = ''
+        this.adjust.allocationName = ''
+      }
+      if (title == 'bdgys') {
+        this.adjust.additionalSupplier = ''
+        this.adjust.additionalSupplierName = ''
+      }
+      if (title == 'shdz') {
+        this.adjust.deliveryAddressName = ''
+        this.adjust.deliveryAddress = ''
+        this.adjust.contacts = ''
+        this.adjust.contactsPhone = ''
+        this.adjust.address = ''
+      }
     },
     // 清除需求客户将明细行内也清空
     cleanCustomer() {
@@ -1859,6 +1890,18 @@ export default {
         this.$modal.notifyWarning('收货仓库存在收货货位,请填写!')
       }
     },
+    // 批量调整选择仓库
+    adjustCangku(type, isPage, title, pkOrg) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      if (pkOrg) {
+        this.referCondition.pkOrg = pkOrg
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.notifyWarning("请先选择默认采购组织");
+      }
+    },
     // 批量调整选择货位
     adjustHuoWei(type, isPage, title, stordocId) {
       this.referCondition.type = type