Explorar el Código

入库单修改

yusheng hace 2 años
padre
commit
7ccf722488
Se han modificado 1 ficheros con 18 adiciones y 7 borrados
  1. 18 7
      src/views/bpm/stockManagement/add.vue

+ 18 - 7
src/views/bpm/stockManagement/add.vue

@@ -108,6 +108,7 @@
                 placeholder="请输入"
                 v-model="formData.extInfo.documentSource"
                 @click.native="handlePicker()"
+                :disabled="isTask"
               >
                 <el-button
                   slot="append"
@@ -1099,7 +1100,8 @@
         <el-button type="primary" @click="handleSave" :loading="saveLoading"
           >保存</el-button
         >
-        <el-button @click="$router.go(-1)">返回</el-button>
+        <el-button @click="$router.go(-1)" v-if="!isTask">返回</el-button>
+        <el-button @click="cancel" v-if="isTask">返回</el-button>
       </div>
     </el-card>
 
@@ -1169,7 +1171,9 @@
   import { tableHeader } from '../handleTask/components/inoutBound/common';
   import { getCode } from '@/api/codeManagement/index.js';
   import { number } from 'echarts/core';
-  import { purchaseorderGetById, contactlink } from '@/api/mes';
+  // import { purchaseorderGetById, contactlink } from '@/api/mes';
+  import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
+
   export default {
     components: {
       selectUpload,
@@ -1182,6 +1186,7 @@
     },
     data() {
       return {
+        isTask:false,
         isWeight: true,
         resultArray: [],
         isDetail: false,
@@ -1274,6 +1279,9 @@
       this.initData();
     },
     methods: {
+      cancel(){
+        this.$emit('cancel');
+      },
       weightInput(value, row) {
         const newValue = value.replace(/[^\d.]/g, ''); // 保留数字和小数点
         const decimalCount = (newValue.match(/\./g) || []).length; // 计算小数点的个数
@@ -1378,16 +1386,18 @@
         this.contactList = data.data;
       },
       async pickerSuccess(row) {
+        this.formData.bizType='2'
+        this.isTask=true
         this.pickerRow = row;
         this.formData.extInfo.documentSource = row.orderNo;
         this.formData.clientName = row.partaName;
         this.formData.clientCode = row.partaId;
-        this.formData.extInfo.supplierName = row.partbName;
-        this.formData.extInfo.supplierId = row.partbId;
-        await this.searchContact(row.partbId);
-        const data = await purchaseorderGetById(row.id);
+        this.formData.extInfo.supplierName = row.supplierName;
+        this.formData.extInfo.supplierId = row.supplierId;
+        // await this.searchContact(row.partbId);
+        const data = await getReceiveSaleOrderrecordDetail(row.id);
         if (this.warehousingMaterialList.length == 0) {
-          let list = data.data.productList.map((item) => {
+          let list = data.productList.map((item) => {
             return {
               ...item,
               assetName: item.productName,
@@ -1963,6 +1973,7 @@
               const res = await outin.save(obj);
               if (res.code == 0) {
                 this.$message.success('保存成功!');
+                this.$emit('handleAudit',1)
               }
             } catch (error) {
               console.error('保存失败:', error);