yusheng 11 月之前
父節點
當前提交
5292be92b8

+ 85 - 0
src/BIZComponents/warehouseAll.vue

@@ -0,0 +1,85 @@
+<template>
+  <el-button
+    size="small"
+    type="primary"
+    class="ele-btn-icon"
+    style="margin-left: 5px"
+    :disabled="disabled"
+    @click="warehouseShow = true"
+    >批量设置仓库
+
+    <ele-modal
+      custom-class="ele-dialog-form long-dialog-form"
+      :centered="true"
+      :visible.sync="warehouseShow"
+      title="设置仓库"
+      :close-on-click-modal="false"
+      width="600px"
+      :maxable="true"
+      :resizable="true"
+      :append-to-body="true"
+    >
+      <div>
+        仓库名称:
+        <el-select v-model="warehouseId" placeholder="请选择">
+          <el-option
+            v-for="item in warehouseList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </div>
+      <div slot="footer" class="footer">
+        <el-button type="primary" @click="warehouseChangeAll"
+          >确认选择</el-button
+        >
+
+        <el-button @click="warehouseShow = false">返回</el-button>
+      </div>
+    </ele-modal>
+  </el-button>
+</template>
+<script>
+  import { getWarehouseList } from '@/api/saleManage/saleorder';
+  export default {
+    components: {},
+    data() {
+      return {
+        warehouseShow: false,
+        warehouseId: '',
+        warehouseList: []
+      };
+    },
+    props: {
+      disabled: {
+        default: true,
+        type: Boolean
+      }
+    },
+    created() {
+      getWarehouseList().then((res) => {
+        this.warehouseList = res;
+      });
+    },
+    computed: {},
+    methods: {
+      warehouseChangeAll() {
+        if (!this.warehouseId) {
+          return this.$message.error('请先选择仓库');
+        }
+        const data = this.warehouseList.find(
+          (item) => item.id == this.warehouseId
+        );
+        this.$emit('success', data);
+        this.cancel();
+      },
+      cancel() {
+        this.warehouseShow = false;
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss"></style>

+ 1 - 1
src/views/purchasingManage/purchaseOrder/accountstatement/components/addAccountDialog.vue

@@ -205,7 +205,7 @@
       },
       //保存
       async save(is) {
-        if (!this.datasource.length&&!this.recorpayList.lenght)
+        if (!this.datasource.length&&!this.recorpayList.length)
         return this.$message.warning('暂无对账信息');
 
         let api =

+ 3 - 3
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -817,7 +817,7 @@
         });
         info['rawDetailList'] = info.rawList;
         info['outputDetailList'] = info.outputList;
-        if (info.productList.lenght > 1) {
+        if (info.productList.length > 1) {
           this.$refs.planTableListRef.open(info);
         } else {
           this.$nextTick(() => {
@@ -869,7 +869,7 @@
           item['discountSinglePrice'] = item.singlePrice;
           item['discountTotalPrice'] = item.totalPrice;
         });
-        if (info.productList.lenght > 1) {
+        if (info.productList.length > 1) {
           this.$refs.planTableListRef.open(info);
         } else {
           this.$nextTick(() => {
@@ -1050,7 +1050,7 @@
             });
             this.getLinkInfo(partaId);
 
-            if (info.productList.lenght > 1) {
+            if (info.productList.length > 1) {
               this.$refs.planTableListRef.contractOpen(
                 info.productList,
                 contractVO.contractStartDate

+ 12 - 58
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -23,15 +23,7 @@
           >
             新增
           </el-button>
-          <el-button
-            size="small"
-            type="primary"
-            class="ele-btn-icon"
-            style="margin-left: 5px"
-            :disabled="!selection.length"
-            @click="warehouseShow = true"
-            >批量设置仓库</el-button
-          >
+          <warehouseAll @success="warehouseAllChange" :disabled="!selection.length"></warehouseAll>
         </div>
       </template>
       <template v-slot:technicalDrawings="{ row, $index }">
@@ -239,37 +231,6 @@
       @saveTaskInstance="saveTaskInstance"
       :visible.sync="taskinstanceDialogFlag"
     ></taskinstance-dialog>
-    <ele-modal
-      custom-class="ele-dialog-form long-dialog-form"
-      :centered="true"
-      :visible.sync="warehouseShow"
-      title="设置仓库"
-      :close-on-click-modal="false"
-      width="600px"
-      :maxable="true"
-      :resizable="true"
-      :append-to-body="true"
-    >
-      <div>
-        仓库名称:
-        <el-select v-model="warehouseId" placeholder="请选择">
-          <el-option
-            v-for="item in warehouseList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          >
-          </el-option>
-        </el-select>
-      </div>
-      <div slot="footer" class="footer">
-        <el-button type="primary" @click="warehouseChangeAll"
-          >确认选择</el-button
-        >
-
-        <el-button @click="warehouseShow = false">返回</el-button>
-      </div>
-    </ele-modal>
   </el-form>
 </template>
 <script>
@@ -286,6 +247,7 @@
   import { parameterGetByCode } from '@/api/main/index.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import productListMain from '@/BIZComponents/product-list.vue';
+  import warehouseAll from '@/BIZComponents/warehouseAll.vue';
   import { levelList } from '@/enum/dict.js';
 
   export default {
@@ -303,7 +265,8 @@
       outboundDetailsDialog,
       productList,
       taskinstanceDialog,
-      productListMain
+      productListMain,
+      warehouseAll
     },
     data() {
       const defaultForm = {
@@ -320,8 +283,7 @@
       };
       return {
         discountTotalPrice: 0.0,
-        warehouseShow: false,
-        warehouseId: '',
+
         selection: [],
         allPrice: 0.0,
         outboundDetailsDialogFlag: false,
@@ -718,23 +680,15 @@
         this.$set(this.form.datasource[index], 'warehouseCode', data.code);
         this.$set(this.form.datasource[index], 'warehouseId', data.id);
       },
-      warehouseChangeAll() {
-        if (!this.warehouseId) {
-          return this.$message.error('请先选择仓库');
-        }
-        const data = this.warehouseList.find(
-          (item) => item.id == this.warehouseId
-        );
-        let codeS = this.selection.map((item) => item.productCode);
-        this.form.datasource.forEach((item, i) => {
-          if (codeS.includes(item.productCode)) {
-            this.$set(this.form.datasource[i], 'warehouseName', data.name);
-            this.$set(this.form.datasource[i], 'warehouseCode', data.code);
-            this.$set(this.form.datasource[i], 'warehouseId', data.id);
-          }
+      warehouseAllChange(data) {
+        let keyS = this.selection.map((item) => item.key - 1);
+        keyS.forEach((key) => {
+          this.$set(this.form.datasource[key], 'warehouseName', data.name);
+          this.$set(this.form.datasource[key], 'warehouseCode', data.code);
+          this.$set(this.form.datasource[key], 'warehouseId', data.id);
         });
-        this.warehouseShow = false;
       },
+
       handleTaskinstance(row, index) {
         this.taskinstanceDialogFlag = true;
         this.$nextTick(() => {

+ 77 - 28
src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

@@ -7,24 +7,34 @@
       max-height="500px"
       @columns-change="handleColumnChange"
       :cache-key="cacheKeyUrl"
+      :selection.sync="selection"
       :datasource="form.datasource"
       class="time-form"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <div class="headbox">
-          <div>
-            <el-button
-              size="small"
-              type="primary"
-              icon="el-icon-plus"
-              class="ele-btn-icon"
-              @click="handParent('', -1)"
-            >
-              新增
-            </el-button>
-          </div>
-        </div>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="handParent('', -1)"
+        >
+          新增
+        </el-button>
+        <warehouseAll
+          @success="warehouseAllChange"
+          :disabled="!selection.length"
+        ></warehouseAll>
+        <el-button
+          size="small"
+          type="primary"
+          class="ele-btn-icon"
+          style="margin-left: 5px"
+          @click="handleTaskinstance"
+          :disabled="!selection.length"
+          >批量设置工序
+        </el-button>
       </template>
       <template v-slot:productName="{ row, $index }">
         <el-form-item
@@ -344,16 +354,23 @@
           column.label
         }}</span>
       </template>
-      <template v-slot:headerWarehouseId="{ column }" >
-        <span :class="{ 'is-required': ['3','4','5'].includes(sourceType) }">{{
-          column.label
-        }}</span>
+      <template v-slot:headerWarehouseId="{ column }">
+        <span
+          :class="{ 'is-required': ['3', '4', '5'].includes(sourceType) }"
+          >{{ column.label }}</span
+        >
       </template>
       <template v-slot:warehouseId="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.warehouseId'"
-          :rules="[{ required:['3','4','5'].includes(sourceType)? true:false, message: '请选择仓库', trigger: 'blur' }]"
+          :rules="[
+            {
+              required: ['3', '4', '5'].includes(sourceType) ? true : false,
+              message: '请选择仓库',
+              trigger: 'blur'
+            }
+          ]"
         >
           <el-select
             v-model="scope.row.warehouseId"
@@ -423,6 +440,7 @@
   import { lbjtList } from '@/enum/dict.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { getWarehouseList } from '@/api/saleManage/saleorder';
+  import warehouseAll from '@/BIZComponents/warehouseAll.vue';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -437,7 +455,7 @@
       },
       sourceType: {
         default: ''
-      },
+      }
     },
     components: {
       taskinstanceDialog,
@@ -446,7 +464,8 @@
       productList,
       fileUpload,
       headList,
-      timeDialog
+      timeDialog,
+      warehouseAll
     },
     computed: {
       isNeedInquiry() {
@@ -467,6 +486,14 @@
             columnKey: 'index',
             align: 'center'
           },
+          {
+            label: '选择',
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            fixed: 'left'
+          },
           {
             width: 150,
             prop: 'productCategoryName',
@@ -696,6 +723,7 @@
         curIndex: null,
         numberReg,
         defaultForm,
+        selection: [],
         arrivalWayList: [
           { label: '一次性到货', value: 1 },
           { label: '分批到货', value: 2 }
@@ -706,7 +734,7 @@
         taskinstanceDialogFlag: false,
         rules: {},
         dictList: {},
-        warehouseList:[]
+        warehouseList: []
       };
     },
     created() {
@@ -784,13 +812,26 @@
         });
       },
       saveTaskInstance(row = {}) {
-        this.$set(this.form.datasource[row.index], 'taskId', row.id);
-        this.$set(this.form.datasource[row.index], 'taskName', row.name);
-        this.$set(
-          this.form.datasource[row.index],
-          'routingId',
-          row.produceRoutingId
-        );
+        if (row.index >= 0) {
+          this.$set(this.form.datasource[row.index], 'taskId', row.id);
+          this.$set(this.form.datasource[row.index], 'taskName', row.name);
+          this.$set(
+            this.form.datasource[row.index],
+            'routingId',
+            row.produceRoutingId
+          );
+        } else {
+          let keyS = this.selection.map((item) => item.key - 1);
+          keyS.forEach((key) => {
+            this.$set(this.form.datasource[key], 'taskId', row.id);
+            this.$set(this.form.datasource[key], 'taskName', row.name);
+            this.$set(
+              this.form.datasource[key],
+              'routingId',
+              row.produceRoutingId
+            );
+          });
+        }
       },
       //获取供应商信息
       handleGetSup(e, row, index) {
@@ -895,6 +936,14 @@
           }
         });
       },
+      warehouseAllChange(data) {
+        let keyS = this.selection.map((item) => item.key - 1);
+        keyS.forEach((key) => {
+          this.$set(this.form.datasource[key], 'warehouseName', data.name);
+          this.$set(this.form.datasource[key], 'warehouseCode', data.code);
+          this.$set(this.form.datasource[key], 'warehouseId', data.id);
+        });
+      },
       //选择产品回调
       changeParent(obj, idx) {
         obj.forEach((item, index) => {

+ 0 - 2
src/views/purchasingManage/purchasePlanManage/index.vue

@@ -165,9 +165,7 @@
     <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
     <!-- 多选删除弹窗 -->
     <pop-modal
-      :visible.sync="delVisible"
       content="是否确定删除?"
-      @done="commitBtn"
     />
     <detailNeedDialog ref="DetailNeedDialogRef"></detailNeedDialog>
     <split-dialog

+ 1 - 1
src/views/saleManage/saleOrder/accountstatement/components/addAccountDialog.vue

@@ -236,7 +236,7 @@
       },
       //保存
       async save(is) {
-        if (!this.datasource.length&&!this.recorpayList.lenght)
+        if (!this.datasource.length&&!this.recorpayList.length)
           return this.$message.warning('暂无对账信息');
         let api =
           this.dialogType == 'add'

+ 1 - 1
src/views/saleManage/saleOrder/entrustedReceive/components/outboundDetailsDialog.vue

@@ -60,7 +60,7 @@ export default {
   
     handleSave() {
       const list = this.$refs.outboundDetailsDialogRef.getValue()||[]
-      if (list.lenght==0) return this.$message.warning('请选择退货明细')
+      if (list.length==0) return this.$message.warning('请选择退货明细')
 
       this.$emit('saveDate',list)
       this.cancel()

+ 1 - 1
src/views/saleManage/saleOrder/returnGoods/components/outboundDetailsDialog.vue

@@ -60,7 +60,7 @@ export default {
   
     handleSave() {
       const list = this.$refs.outboundDetailsDialogRef.getValue()||[]
-      if (list.lenght==0) return this.$message.warning('请选择退货明细')
+      if (list.length==0) return this.$message.warning('请选择退货明细')
 
       this.$emit('saveDate',list)
       this.cancel()