Browse Source

前端出入库修改sdy

zhongtianhaoyuan 4 năm trước cách đây
mục cha
commit
20df4e62f7

+ 136 - 76
src/views/warehouse/warehouseManagementDelivery.vue

@@ -25,7 +25,12 @@
       <div class="basicInformation">
         <h2>
           {{ deptBudgetList.warehouseName }}库
-          <span class="position" v-show="this.deptBudgetList.warehouseType==1"> {{ deptBudgetList.binNumber }}仓位 </span>
+          <span
+            class="position"
+            v-show="this.deptBudgetList.warehouseType == 1"
+          >
+            {{ deptBudgetList.binNumber }}仓位
+          </span>
           <span v-show="this.deptBudgetList.warehouseType == 2">(临)</span>
         </h2>
         <div class="small-title">基本信息</div>
@@ -100,12 +105,18 @@
           </ws-form-item>
           <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-input
+            <ws-select
               v-model="deptBudgetList.agent"
-              placeholder="请输入出库经办人姓名"
-              maxlength="100"
-              size="small"
-            />
+              placeholder=""
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in agent"
+                :key="item.constKey"
+                :label="item.staffName"
+                :value="item.staffName"
+              />
+            </ws-select>
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item
@@ -121,16 +132,16 @@
               value-format="yyyy-MM-dd"
             />
           </ws-form-item>
-          <!-- 库类型 -->
+          <!-- 库类型 -->
           <ws-form-item label="出库类型" span="1">
             <ws-select
-              v-model="deptBudgetList.inOutType"
+              v-model="deptBudgetList.deliveryType"
               placeholder=""
               class="typeselect"
               @change="selectstorageType"
             >
               <ws-option
-                v-for="item in storageType"
+                v-for="item in deliveryType"
                 :key="item.constKey"
                 :label="item.constValue"
                 :value="item.constValue"
@@ -148,12 +159,18 @@
           </ws-form-item>
           <!--合同编号-->
           <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-input
+            <ws-select
               v-model="deptBudgetList.contractNo"
-              placeholder="请输入合同编号"
-              maxlength="100"
-              size="small"
-            />
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in outContractNo"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </ws-select>
           </ws-form-item>
         </ws-info-table>
       </div>
@@ -256,7 +273,13 @@
   </div>
 </template>
 <script>
-import { pullDown, addstorageputList, goodsname } from '@/model/warehouse/index'
+import {
+  pullDown,
+  addstorageputList,
+  goodsname,
+  xialaNo,
+  getstaff,
+} from '@/model/warehouse/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
@@ -300,11 +323,13 @@ export default {
       goodnameList: {},
       // 提交类型
       submitType: true,
-      storageType: [],
+      deliveryType: [],
+      outContractNo: [],
       appendixIdsAdd: '',
       uploadSuccess: {},
       onChange: {},
       gradeList: [],
+      agent: [],
       rules: {
         netWeight: [
           {
@@ -352,15 +377,15 @@ export default {
       this.$router.push({ path: 'warehouseManagementList' })
     },
     temporaryStorage() {
-       if (!this.deptBudgetList.goodsName) {
+      if (!this.deptBudgetList.goodsName) {
         this.$message({
           message: '货名不能为空',
           type: 'warning',
         })
         return
       }
-      if(!this.deptBudgetList.grossWeight){
-         this.$message({
+      if (!this.deptBudgetList.grossWeight) {
+        this.$message({
           message: '毛重不能为空',
           type: 'warning',
         })
@@ -380,8 +405,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.tare){
-         this.$message({
+      if (!this.deptBudgetList.tare) {
+        this.$message({
           message: '皮重不能为空',
           type: 'warning',
         })
@@ -401,8 +426,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.agent){
-         this.$message({
+      if (!this.deptBudgetList.agent) {
+        this.$message({
           message: '经办人不能为空',
           type: 'warning',
         })
@@ -418,8 +443,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.carNo){
-         this.$message({
+      if (!this.deptBudgetList.carNo) {
+        this.$message({
           message: '车牌号不能为空',
           type: 'warning',
         })
@@ -432,8 +457,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.contractNo){
-         this.$message({
+      if (!this.deptBudgetList.contractNo) {
+        this.$message({
           message: '合同编号不能为空',
           type: 'warning',
         })
@@ -449,7 +474,7 @@ export default {
         })
         return
       }
-       //自检员
+      //自检员
       if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
         if (
           this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
@@ -522,7 +547,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -537,7 +562,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.mildewGrain
               ).indexOf('.') +
@@ -552,7 +578,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -582,7 +608,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -594,10 +620,11 @@ export default {
         if (
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
-          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
-            '.'
-          ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.imperfectGrain
               ).indexOf('.') +
@@ -612,7 +639,7 @@ export default {
         }
       }
       //容重
-       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+      if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -626,7 +653,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.bulkDensity
               ).indexOf('.') +
@@ -648,9 +676,8 @@ export default {
         .then(() => {
           this.$refs.deptBudgetList.validate((valid) => {
             if (valid) {
-              this.deptBudgetList.compId = sessionStorage.getItem(
-                'ws-pf_compId'
-              )
+              this.deptBudgetList.compId =
+                sessionStorage.getItem('ws-pf_compId')
               this.deptBudgetList.inOutFlag = 1
               this.deptBudgetList.statusFlag = 1
               addstorageputList(this.deptBudgetList)
@@ -706,7 +733,7 @@ export default {
         })
         return
       }
-     if (
+      if (
         this.deptBudgetList.tare < 0 ||
         this.deptBudgetList.tare > 10000 ||
         (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
@@ -809,7 +836,7 @@ export default {
         })
         return
       }
-       //自检员
+      //自检员
       if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
         if (
           this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
@@ -882,7 +909,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -897,7 +924,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.mildewGrain
               ).indexOf('.') +
@@ -912,7 +940,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -942,7 +970,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -954,10 +982,11 @@ export default {
         if (
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
-          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
-            '.'
-          ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.imperfectGrain
               ).indexOf('.') +
@@ -972,7 +1001,7 @@ export default {
         }
       }
       //容重
-       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+      if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -986,7 +1015,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.bulkDensity
               ).indexOf('.') +
@@ -1000,29 +1030,28 @@ export default {
           return
         }
       }
-       this.$confirm(`确定提交出库信息`, {
+      this.$confirm(`确定提交出库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning',
+      }).then(() => {
+        this.$refs.deptBudgetList.validate((valid) => {
+          if (valid) {
+            this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
+            this.deptBudgetList.inOutFlag = 1
+            this.deptBudgetList.statusFlag = 3
+            addstorageputList(this.deptBudgetList)
+              .toPromise()
+              .then((response) => {
+                this.$message.success('添加成功')
+                this.$router.push({ path: 'warehouseManagementList' })
+              })
+          } else {
+            EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            return false
+          }
+        })
       })
-        .then(() => {
-           this.$refs.deptBudgetList.validate((valid) => {
-        if (valid) {
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.deptBudgetList.inOutFlag = 1
-          this.deptBudgetList.statusFlag = 3
-          addstorageputList(this.deptBudgetList)
-            .toPromise()
-            .then((response) => {
-              this.$message.success('添加成功')
-              this.$router.push({ path: 'warehouseManagementList' })
-            })
-        } else {
-          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-          return false
-        }
-      })
-        })  
     },
     tarechange(e) {
       if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
@@ -1085,11 +1114,42 @@ export default {
         .then((response) => {
           this.gradeList = response
         })
+      // // 类型
+      // pullDown({ constId: 'CON6' })
+      //   .toPromise()
+      //   .then((response) => {
+      //     this.storageType = response
+      //   })
       // 类型
-      pullDown({ constId: 'CON6' })
+      if (this.deptBudgetList.warehouseType == 1) {
+        pullDown({ constId: 'CON6' })
+          .toPromise()
+          .then((response) => {
+            this.deliveryType = response
+          })
+      } else if (this.deptBudgetList.warehouseType == 2) {
+        // pullDown({ constId: 'WARE1' })
+        //   .toPromise()
+        //   .then((response) => {
+        //     this.storageType = response
+        //   })
+        pullDown({ constId: 'WARE2' })
+          .toPromise()
+          .then((response) => {
+            this.deliveryType = response
+          })
+      }
+      //合同编号
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          this.storageType = response
+          this.outContractNo = response
+        })
+      //经办人
+      getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          this.agent = response
         })
     },
     selecttaskType(e) {
@@ -1236,9 +1296,9 @@ export default {
   color: #8890b1;
   line-height: 16px;
 }
-.inspector{
+.inspector {
   width: 50%;
-} 
+}
 //质检员
 .inspector .el-form-item__content {
   text-align: left;

+ 1 - 1
src/views/warehouse/warehouseManagementEdit.vue

@@ -256,7 +256,7 @@ export default {
       size: 10,
       options_: regionData,
       selectedOptions: [],
-      compId: sessionStorage.getItem('ws-pf_compId'),
+      compId: sessionStorage.getItem('ws-pf_compId'),  
       deptCircularPage: {},
       packtypeList: [],
       date: {

+ 5 - 24
src/views/warehouse/warehouseManagementList.vue

@@ -6,9 +6,6 @@
         <ws-button
           type="primary"
           @click="handleAdd()"
-          v-hasPermission="
-            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-          "
           ><img
             width="11"
             height="11"
@@ -48,9 +45,7 @@
           class="find"
           type="primary"
           @click="find()"
-          v-hasPermission="
-            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-          "
+         
           ><img
             width="16"
             height="16"
@@ -130,27 +125,19 @@
             <ws-button
               class="completed"
               @click="nocomplete(scope.row)"
-              v-hasPermission="
-                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-              "
+            
             >
               待完成({{ scope.row.number }})
             </ws-button>
             <ws-button
               class="putstorage"
               @click="warehousing(scope.row)"
-              v-hasPermission="
-                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-              "
             >
               入库
             </ws-button>
             <ws-button
               class="deliverystorage"
               @click="delivery(scope.row)"
-              v-hasPermission="
-                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-              "
             >
               出库
             </ws-button>
@@ -221,27 +208,21 @@
             <ws-button
               class="completed"
               @click="nocomplete(scope.row)"
-              v-hasPermission="
-                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-              "
+             
             >
               待完成({{ scope.row.number }})
             </ws-button>
             <ws-button
               class="putstorage"
               @click="warehousing(scope.row)"
-              v-hasPermission="
-                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-              "
+             
             >
               入库
             </ws-button>
             <ws-button
               class="deliverystorage"
               @click="delivery(scope.row)"
-              v-hasPermission="
-                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-              "
+             
             >
               出库
             </ws-button>

+ 51 - 33
src/views/warehouse/warehouseManagementPut.vue

@@ -111,12 +111,18 @@
 
           <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-input
+            <ws-select
               v-model="deptBudgetList.agent"
-              placeholder="请输入出库经办人姓名"
-              maxlength="100"
-              size="small"
-            />
+              placeholder=""
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in agent"
+                :key="item.constKey"
+                :label="item.staffName"
+                :value="item.staffName"
+              />
+            </ws-select>
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item
@@ -162,22 +168,24 @@
           <!--合同编号-->
           <ws-form-item label="合同编号" span="1" prop="contractNo">
             <ws-select
-                v-model="deptBudgetList.contractNo"
-                placeholder="请选择合同编号或移库任务编号"
-                class="typeselect"
-              >
-                <ws-option
-                  v-for="item in outContractNo"
-                  :key="item.constKey"
-                  :label="item.contractNo"
-                  :value="item.contractNo"
-                />
-              </ws-select>
+              v-model="deptBudgetList.contractNo"
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in outContractNo"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </ws-select>
           </ws-form-item>
         </ws-info-table>
         <div v-show="this.$route.query.warehouseType == 2">
           <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
-          <ws-info-table v-show="checked == true &&  this.deptBudgetList.createType== 2" >
+          <ws-info-table
+            v-show="checked == true && this.deptBudgetList.createType == 2"
+          >
             <!-- 出库类型 -->
             <ws-form-item label="出库类型" span="1">
               <ws-select
@@ -314,7 +322,12 @@
   </div>
 </template>
 <script>
-import { pullDown, addstorageputList ,xialaNo} from '@/model/warehouse/index'
+import {
+  pullDown,
+  addstorageputList,
+  xialaNo,
+  getstaff,
+} from '@/model/warehouse/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
@@ -356,13 +369,14 @@ export default {
       endDate: null,
       goodnameList: {},
       checked: true,
+      agent:[],
+
+      outContractNo: [],
 
-      outContractNo:[],
-      
       // 提交类型
       submitType: true,
       storageType: [],
-      deliveryType:[],
+      deliveryType: [],
       readonly: true,
       appendixIdsAdd: '',
       uploadSuccess: {},
@@ -412,14 +426,13 @@ export default {
     this.deptBudgetList.goodsNameKey = '1'
     this.deptBudgetList.grade = '一等品'
     this.deptBudgetList.gradeKey = '1'
-    if(this.deptBudgetList.warehouseType==1){
+    if (this.deptBudgetList.warehouseType == 1) {
       this.deptBudgetList.inOutType = '采购入库'
-    this.deptBudgetList.inOutTypeKey = '1'
-    }else{
+      this.deptBudgetList.inOutTypeKey = '1'
+    } else {
       this.deptBudgetList.inOutType = '退库'
-    this.deptBudgetList.inOutTypeKey = '1'
+      this.deptBudgetList.inOutTypeKey = '1'
     }
-    
   },
   methods: {
     //返回按钮
@@ -1179,19 +1192,24 @@ export default {
             this.storageType = response
           })
 
-           pullDown({ constId: 'WARE2' })
+        pullDown({ constId: 'WARE2' })
           .toPromise()
           .then((response) => {
             this.deliveryType = response
           })
       }
       //合同编号
-       xialaNo({ compId: sessionStorage.getItem('ws-pf_compId')})
-          .toPromise()
-          .then((response) => {
-            this.outContractNo = response
-          })
-
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          this.outContractNo = response
+        })
+      //经办人
+      getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          this.agent = response
+        })
     },
     selecttaskType(e) {
       for (var i = 0; i < this.taskTypeList.length; i++) {