ソースを参照

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 1 年間 前
コミット
3ef3e0da1b
1 ファイル変更52 行追加31 行削除
  1. 52 31
      src/views/purchase/PurchaseDemandList/add.vue

+ 52 - 31
src/views/purchase/PurchaseDemandList/add.vue

@@ -15,13 +15,13 @@
             </el-form-item>
          </el-col>
 
-        <el-col :span="1.5">
+        <!-- <el-col :span="1.5">
             <el-form-item label="组织" prop="org" :rules="{ required: true, message: '请选择组织', trigger: 'blur' }">
               <el-select clearable size="mini" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
                 <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-         </el-col>
+         </el-col> -->
 
          <el-col :span="1.5">
             <el-form-item label="单据状态">
@@ -147,11 +147,14 @@
       </el-row>
 
 
-    <span>明细信息</span>
+    
       <div class="btn_grooup">
+        <span>明细信息</span>
+        <div>
         <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
         <el-button type="primary" size="mini" v-if="!sonDisable" @click="adjustPl">批量调整</el-button>
         <el-button type="primary" size="mini" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
+        </div>
       </div>
 
       <el-table
@@ -177,7 +180,7 @@
           <el-table-column show-overflow-tooltip label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
           <el-table-column show-overflow-tooltip label="需求客户" align="center"  prop="demandCustomerName" width="180px"/>
           <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" :formatter="hangStatus" width="100px"/>
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="220px">
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="220px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
                 <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.materialCode" @paste.native="pasteMe($event, scope, scope.$index)">
@@ -192,7 +195,7 @@
           <el-table-column show-overflow-tooltip label="单位" align="center"  prop="unitName"/>
           <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center"  prop="manufacturerName" width="230px"/>
           <el-table-column show-overflow-tooltip label="最小包装" align="center"  prop="minPackage" width="100px"/>
-          <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px">
+          <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
                 <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)"/>
@@ -248,13 +251,7 @@
           <el-table-column show-overflow-tooltip label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
           <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="100px"/>
           <!-- <el-table-column show-overflow-tooltip label="采购员" align="center"  prop="buyer"/> -->
-          <el-table-column show-overflow-tooltip label="采购周期" align="center"  prop="puPeriod" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.puPeriod"></el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <el-table-column show-overflow-tooltip label="采购周期" align="center"  prop="puPeriod" width="120px"/>
           <el-table-column show-overflow-tooltip label="交货日期" align="center"  prop="deliveryDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -273,13 +270,7 @@
           </el-table-column>
           <el-table-column show-overflow-tooltip label="有效期" align="center"  prop="expiry" width="100px"/>
           <el-table-column show-overflow-tooltip label="有效期单位" align="center"  prop="expiryUnit" width="100px"/>
-          <el-table-column show-overflow-tooltip label="安全库存" align="center"  prop="safeStock" width="100px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.safeStock"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <el-table-column show-overflow-tooltip label="安全库存" align="center"  prop="safeStock" width="100px"/>
           <el-table-column show-overflow-tooltip label="注册人" align="center"  prop="registrant" width="100px"/>
           <el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="120px">
             <template slot-scope="scope">
@@ -317,7 +308,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="补单供应商" align="center"  prop="additionalSupplierName" width="200px">
+          <el-table-column show-overflow-tooltip label="补单供应商" align="center"  prop="additionalSupplierName" width="200px" :render-header="anotherRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplierName'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
                 <el-input clearable :disabled="sonDisable || BDZT" size="mini" v-model="scope.row.additionalSupplierName" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
@@ -346,13 +337,7 @@
           </el-table-column>
           <el-table-column show-overflow-tooltip label="调拨单号" align="center"  prop="allotCode"></el-table-column>
           <el-table-column show-overflow-tooltip label="调拨占有量" align="center"  prop="allotQty" width="100px"/>
-          <el-table-column show-overflow-tooltip label="最终净需求量" align="center"  prop="resDemandQty" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.resDemandQty"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <el-table-column show-overflow-tooltip label="最终净需求量" align="center"  prop="resDemandQty" width="120px"/>
           <el-table-column show-overflow-tooltip label="最终采购执行数量" align="center"  prop="executeQty" width="150px">
             <template slot-scope="scope">
               {{ scope.row.executeQty ? scope.row.executeQty : 0 }}
@@ -567,8 +552,8 @@ export default {
         customerName: '',
         customerCode: '',
         customerPrincipal: '',
-        demandPersonal: '',
-        demandDept: '',
+        demandPersonal: this.$store.state.user.name,
+        demandDept: this.$store.state.user.deptId,
         demandDate: '',
         createTime: '',
         source: '4',
@@ -638,6 +623,9 @@ export default {
       this.getDetails(this.row)
     } else if(this.pageStu == 'edit') {
       this.getDetails(this.row)
+    } else if (this.pageStu == 'add') {
+      if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
+      if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
     }
   },
   methods: {
@@ -652,10 +640,12 @@ export default {
       if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.isBDXQ = true
         this.BDZT = false
+        this.anotherRedStar()
         this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
       } else {
         this.isBDXQ = false
         this.BDZT = true
+        this.anotherRedStar()
         this.basicForm.puDemandItemList.forEach(item => {
           item.isReplenishment = 'N'
           item.additionalSupplier = null
@@ -710,6 +700,7 @@ export default {
       this.basicForm.code = ''
       this.basicForm.createBy = ''
       this.basicForm.source = '4'
+      this.basicForm.isSpeical = 'N'
       this.basicForm.puDemandItemList.forEach(item => {
         item.status = ''
         item.buyerName = ''
@@ -768,7 +759,7 @@ export default {
     },
     async save() {
       if(this.basicForm.puDemandItemList.length !== 0) {
-        this.$refs['basic'].validate((valid) => {
+        this.$refs['basic'].validate((valid, obj) => {
           if(valid) {
             this.$modal.loading("保存中...");
             if(this.sonPageStu == 'add') {
@@ -801,6 +792,14 @@ export default {
                 this.$modal.closeLoading();
               })
             }
+          } else {
+            // 校验加弹窗
+            const jiaoyan = []
+            for(let key in obj) {
+              jiaoyan.push(obj[key][0].message);
+            }
+            this.$modal.notifyWarning(jiaoyan[0]);
+            return false
           }
         })
       } else {
@@ -954,6 +953,7 @@ export default {
       console.log('删除的数组',this.delDemandItemList)
     },
     back() {
+      console.log('打印人员信息看看', this.$store.state)
       this.$emit('jugislist', true)
       this.$emit('refresh')
     },
@@ -979,9 +979,11 @@ export default {
               if(this.basicForm.billType == 'BDXQ') {
                  this.BDZT = false
                  this.isBDXQ = true
+                 this.anotherRedStar()
               } else {
                  this.BDZT = true
                  this.isBDXQ = false
+                 this.anotherRedStar()
               }
             }
           })
@@ -1554,6 +1556,25 @@ export default {
         address: ''
       }
     },
+    // 必选标识
+    addRedStar(h, { column }) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+    },
+    anotherRedStar(h, { column }) {
+      if(this.isBDXQ) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+      } else {
+       return [
+          h('span', ' ' + column.label)
+        ]; 
+      }
+    },
   }
 }
 </script>
@@ -1571,7 +1592,7 @@ export default {
 .btn_grooup {
   margin-bottom: 10px;
   display: flex;
-  justify-content: flex-end;
+  justify-content: space-between;
 }
 .hang {
   margin: auto;