Bläddra i källkod

采购需求汇总需求

黄梓星 2 år sedan
förälder
incheckning
f76a438b55

+ 33 - 3
src/views/purchase/DemandSummary/index.vue

@@ -264,6 +264,7 @@
           show-summary
           max-height="480"
           @selection-change="handleSelectionChange"
+          :key="isUpdate"
         >
           <el-table-column type="selection" width="55" />
           <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
@@ -309,7 +310,9 @@
           <el-table-column label="单据状态" align="center" prop="status"/>
           <el-table-column label="采购员" align="center" prop="buyerName" width="120px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" v-model="scope.row.buyerName"/>
+                <el-input readonly size="small" v-model="scope.row.buyerName">
+                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
+                </el-input>
             </template>
           </el-table-column>
           <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
@@ -386,6 +389,7 @@ export default {
   },
   data() {
     return {
+      isUpdate: false,
       expanded: false,
       // 页面配置
       isList: true,
@@ -415,7 +419,7 @@ export default {
         auditTime: '',
         yesTime: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
       personOptions: [],
       classOptions: [],
@@ -442,6 +446,13 @@ export default {
       lineDisable: true,
       ids: [],
       allSelection: [],
+      // 子表index
+      tableIndex: null,
+      referConditionMx: {
+        type: '',
+        isPage: true,
+        title: ''
+      }
     }
   },
   created() {
@@ -477,7 +488,7 @@ export default {
         auditTime: '',
         yesTime: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.getList(this.queryParams)
     },
@@ -615,6 +626,13 @@ export default {
         this.orgOptions = selection
         this.queryParams.purchaseOrg = selection[0].id
       }
+      if (this.referConditionMx.title == '采购员') {
+        console.log('选择进了吗',this.tableList)
+        this.tableList[this.tableIndex].buyer = selection[0].code
+        this.tableList[this.tableIndex].buyerName = selection[0].name
+        this.isUpdate = !this.isUpdate
+        // this.$set(this.tableList[this.tableIndex - 1],  buyerName, selection[0].name)
+      }
     },
     // 搜索区树形选择
     chooseTreeRefer(type, isPage, title) {
@@ -634,6 +652,18 @@ export default {
     selectMaterial(selection) {
       this.queryParams.materialCode = selection[0].id
       this.queryParams.names = selection[0].name
+    },
+        // 明细行选择业务部门参照带出业务部门数据
+    chooseSon(index, type, isPage, title) {
+      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", index)
+      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", type)
+      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", isPage)
+      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", title)
+      this.tableIndex = index
+      this.referConditionMx.type = type
+      this.referConditionMx.isPage = isPage
+      this.referConditionMx.title = title
+      this.$refs.refer.init(this.referConditionMx)
     }
   }
 }

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

@@ -85,7 +85,7 @@
             <el-form-item label="需求日期">
               <el-date-picker
                 v-model="basicForm.demandDate"
-                :disabled="sonDisable"
+                disabled
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -97,7 +97,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="单据来源">
-              <el-select v-model="basicForm.source" :disabled="sonDisable" size="small" style="width: 200px">
+              <el-select v-model="basicForm.source" disabled size="small" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -314,9 +314,9 @@
                 <el-date-picker
                   v-model="scope.row.deliveryDate"
                   :readonly="sonDisable"
-                  type="date"
+                  type="datetime"
                   size="small"
-                  value-format="yyyy-MM-dd"
+                  value-format="yyyy-MM-dd HH:mm:ss"
                   placeholder="选择日期">
                 </el-date-picker>
               </el-form-item>
@@ -574,6 +574,7 @@ export default {
       basicForm: {
         code: '',
         org: '',
+        orgName: '',
         demandBusinessType: '1',
         status: '0',
         customer: '',
@@ -582,7 +583,7 @@ export default {
         demandPersonal: '',
         demandDept: '',
         demandDate: '',
-        source: '',
+        source: '1',
         warehouse: '',
         goodsAllocation: '',
         billType: '',
@@ -699,9 +700,11 @@ export default {
         materialClassifyFour: null,
         materialClassifyFourName: null,
         materialCode: null,
+        materialId: null,
         materialName: null,
         specification: null,
         unit: null,
+        unitName: null,
         manufacturerName: null,
         registrant: null,
         puPeriod: null,
@@ -862,10 +865,12 @@ export default {
       if(this.referCondition.type == 'ORG_PARAM') {
         this.orgOptions = selection
         this.basicForm.org = selection[0].id
+        this.basicForm.orgName = selection[0].name
       }
       if(this.referCondition.type == 'CUSTOMER_PARAM') {
         this.customerOptions = selection
         this.basicForm.customer = selection[0].id
+        this.basicForm.customerName = selection[0].name
       }
       if(this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
@@ -930,6 +935,7 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].businessDepartment
       this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].businessDepartmentName
       this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
+      this.basicForm.puDemandItemList[this.tableIndex].materialId = selection[0].id
       this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
@@ -937,7 +943,8 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFourName = selection[0].fourClass
       this.basicForm.puDemandItemList[this.tableIndex].specification = selection[0].specification
       this.basicForm.puDemandItemList[this.tableIndex].model = selection[0].model
-      this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitIdName
+      this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitId
+      this.basicForm.puDemandItemList[this.tableIndex].unitName = selection[0].unitIdName
       this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
       this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
       this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod

+ 2 - 1
src/views/purchase/PurchaseDemandList/index.vue

@@ -322,7 +322,7 @@ export default {
         demandDate: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.getList(this.queryParams)
     },
@@ -500,6 +500,7 @@ export default {
   height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
+  overflow-y: scroll;
 }
 .btn_grooup {
   margin-bottom: 10px;