chris 2 năm trước cách đây
mục cha
commit
8879ac7ad4

+ 23 - 7
src/views/modules/common/material-component.vue

@@ -30,6 +30,10 @@
         type: String,
         default: ''
       },
+      bizType: {
+        type: String,
+        default: ''
+      },
       material: {
         type: Object,
         default: () => {}
@@ -77,14 +81,26 @@
             if (this.current > data.data.pages) {
               return
             }
-            data.data.records.forEach(item => {
-              this.options.push({...item,
-                label: item.materialName,
-                value: item.materialId,
-                specification: item.specifications,
-                cntLimit: item.cnt - item.lockCnt
+            if (this.bizType === 'in') {
+              data.data.records.forEach(item => {
+                this.options.push({...item,
+                  label: item.materialName,
+                  value: item.materialId,
+                  specification: item.specifications,
+                  cntLimit: item.cnt - item.lockCnt,
+                  cnt: 0
+                })
               })
-            })
+            } else {
+              data.data.records.forEach(item => {
+                this.options.push({...item,
+                  label: item.materialName,
+                  value: item.materialId,
+                  specification: item.specifications,
+                  cntLimit: item.cnt - item.lockCnt
+                })
+              })
+            }
           } else {
             this.options = []
           }

+ 0 - 3
src/views/modules/order/order-add-or-update.vue

@@ -316,9 +316,6 @@
                   url: fList[i].url
                 })
               }
-            } else {
-              this.$message.error('请上传文件')
-              return
             }
             // 订单产品明细
             let pList = this.productDetails

+ 3 - 1
src/views/modules/warehouse/inventory.vue

@@ -100,7 +100,9 @@
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('wh:inventory:info')" type="text" size="small" @click="detailHandle(scope.row.inventoryId)">查看</el-button>
-            <el-button v-if="isAuth('wh:inventory:start') && Number(scope.row.state) === 0" type="text" size="small" @click="addOrUpdateHandle(scope.row.inventoryId, false)">盘点</el-button>
+            <el-button v-if="isAuth('wh:inventory:export') && Number(scope.row.state) === 0" type="text" size="small" @click="exportExcel(scope.row.warehouseId)">导出</el-button>
+            <el-button v-if="isAuth('wh:inventory:import') && Number(scope.row.state) === 0" type="text" size="small" @click="importExcel()">导入</el-button>
+<!--            <el-button v-if="isAuth('wh:inventory:start') && Number(scope.row.state) === 0" type="text" size="small" @click="addOrUpdateHandle(scope.row.inventoryId, false)">盘点</el-button>-->
           </template>
         </el-table-column>
       </el-table>

+ 6 - 1
src/views/modules/warehouse/stock-order-inbound.vue

@@ -24,7 +24,7 @@
                             :disabled="display" @blur="blurMaterialName(item)" style="width: 200px; margin-right: 10px"/>
                   <material-component v-else
                                       v-model="dataList[index]"
-                                      :material-id="item.materialId">
+                                      :material-id="item.materialId" biz-type="in">
                   </material-component>
                   <el-button v-show="item.buttonType && item.buttonType === '1'" @click="changeButtonType(item, 0)" type="danger">选择</el-button>
                   <el-button v-show="!item.buttonType || item.buttonType === '0'" @click="changeButtonType(item, 1)" type="danger">输入</el-button>
@@ -200,11 +200,16 @@
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
             let postData = []
+            // 数据校验
             for (let i = 0; i < this.dataList.length; i++) {
               if (!this.dataList[i].batchNumber) {
                 this.$message.warning('批次号不能为空')
                 return
               }
+              if (!this.dataList[i].sourceCategory) {
+                this.$message.warning('入库依据类别不能为空')
+                return
+              }
             }
             this.dataList.forEach((item) => {
               postData.push({...item,