Selaa lähdekoodia

中心仓导出、库存bug优化

liyuan 1 viikko sitten
vanhempi
commit
2639f27caa

+ 2 - 2
src/views/storehouse/inStockManage/inStockPlan/detailsPage.vue

@@ -1161,8 +1161,8 @@ export default {
                 this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
                 this.templateUrl = '/api/blade-sales-part/order/export-item-name'
             } else if (name == 'code') {
-                this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/tire/center/warehouse/plan/import-item-code?storageId=' + this.form.storageId
-                this.templateUrl = '/api/blade-sales-part/tire/center/warehouse/plan/export-item-code?storageId=' + this.form.storageId
+                this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/tire/center/warehouse/plan/import-item-code'
+                this.templateUrl = '/api/blade-sales-part/tire/center/warehouse/plan/exportPlanTemplate'
             }
             this.excelBox = true
         },

+ 6 - 2
src/views/storehouse/outStockManage/outStockPlan/detailsPage.vue

@@ -1063,12 +1063,16 @@ export default {
                 this.$message.error('请选择货主')
                 return
             }
+            if (!this.form.storageId) {
+                this.$message.error('请选择仓库')
+                return
+            }
             if (name == '名称') {
                 this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
                 this.templateUrl = '/api/blade-sales-part/order/export-item-name'
             } else if (name == 'code') {
-                this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code?storageId=' + this.form.storageId
-                this.templateUrl = '/api/blade-sales-part/order/export-item-code'
+                this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code/' + this.form.storageId
+                this.templateUrl = '/api/blade-sales-part/tire/center/warehouse/stockDesc/exportStockTemplate'
             }
             this.excelBox = true
         },

+ 33 - 7
src/views/storehouse/storage-region/detailsPage.vue

@@ -15,7 +15,7 @@
                     <el-button v-if="!form.status || form.status === 0" type="warning" size="small" @click="submitStorage">
                         提 交
                     </el-button>
-                    <el-button v-if="!form.status || form.status === 1" type="error" size="small" @click="submitStorage">
+                    <el-button v-if="form.status && form.status === 1" type="error" size="small" @click="disabledRegion">
                         禁 用
                     </el-button>
                 </div>
@@ -30,7 +30,7 @@
 </template>
 
 <script>
-import {getDetail, add, update, remove} from "@/api/storehouse/storage-region.js";
+import {getDetail, add, disabledStorageRegion} from "@/api/storehouse/storage-region.js";
 export default {
     name: "index",
     data() {
@@ -87,7 +87,7 @@ export default {
     watch: {
         onLoad: {
             handler(val) {
-                this.form.parentId = this.onLoad.id
+                this.form.parentId = this.onLoad.parentId
             },
             deep: true
         }
@@ -109,8 +109,10 @@ export default {
                 spinner: 'el-icon-loading',
                 background: 'rgba(0, 0, 0, 0.7)'
             })
-            this.form.parentId = this.onLoad.id
-            this.form.top = this.onLoad.parentId === 0 ? 1 : 0
+            if (!this.form.id) {
+                this.form.parentId = this.onLoad.parentId
+                this.form.top = this.onLoad.parentId === 0 ? 1 : 0
+            }
             add(this.form).then(res => {
                 console.info('res----', res)
                 this.$message.success(res.data.msg)
@@ -124,6 +126,28 @@ export default {
                 this.form = res.data.data;
             })
         },
+        disabledRegion(){
+            this.$confirm('确定要禁用该库区吗?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '正在提交....',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(0, 0, 0, 0.7)'
+                })
+                disabledStorageRegion(this.form.id).then(res => {
+                    console.info('res----', res)
+                    this.$message.success('禁用成功')
+                    this.getItem(this.form.id)
+                }).finally(() => {
+                    loading.close()
+                })
+            }).catch(() => {
+            })
+        },
         submitStorage(){
             this.$confirm('确定提交吗?', '提示', {
                 confirmButtonText: '确定',
@@ -136,9 +160,11 @@ export default {
                     spinner: 'el-icon-loading',
                     background: 'rgba(0, 0, 0, 0.7)'
                 })
-                this.form.parentId = this.onLoad.id
+                if (!this.form.id) {
+                    this.form.top = this.onLoad.parentId === 0 ? 1 : 0
+                    this.form.parentId = this.onLoad.parentId
+                }
                 this.form.status = 1
-                this.form.top = this.onLoad.parentId === 0 ? 1 : 0
                 add(this.form).then(res => {
                     console.info('res----', res)
                     this.$message.success(res.data.msg)

+ 11 - 3
src/views/storehouse/storage-region/index.vue

@@ -37,7 +37,7 @@
                     </span>
                         </template>
                         <template slot="status" slot-scope="{row,size}">
-                            <span v-if="row.status === 1">启用</span>
+                            <span v-if="row.status === 1">提交</span>
                             <span v-if="row.status === 0">保存</span>
                         </template>
                         <template slot-scope="{type,size,row,$index}" slot="menuLeft">
@@ -114,7 +114,13 @@ export default {
                         prop: "status",
                         search: true,
                         searchSpan: 6,
-                        align: 'center'
+                        align: 'center',
+                        type: 'select',
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=center_plan_status",
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey"
+                        }
                     }
                 ]
             },
@@ -200,8 +206,10 @@ export default {
             });
         },
         nodeClick(data) {
+            this.nowClick = {}
             console.info('data---', data)
-            this.nowClick = data
+            // this.nowClick = data
+            this.nowClick.parentId = data.id
             this.query.parentId = data.value
             this.page.currentPage = 1;
             this.onLoad(this.page);

+ 2 - 2
src/views/storehouse/storage/detailsPage.vue

@@ -15,7 +15,7 @@
                     <el-button v-if="!form.status || editStatusList.indexOf(form.status) !== -1" type="warning" size="small" @click="submitStorage">
                         提 交
                     </el-button>
-                    <el-button v-if="form.status && form.status !== 0" type="warning" size="small" @click="disabledCanterStorage">
+                    <el-button v-if="form.status && form.status === 1" type="warning" size="small" @click="disabledCanterStorage">
                         禁 用
                     </el-button>
                 </div>
@@ -136,7 +136,7 @@ export default {
                 disabledStorage(this.form.id).then(res => {
                     console.info('res----', res)
                     this.$message.success(res.data.msg)
-                    this.getItem(res.data.data)
+                    this.getItem(this.form.id)
                 }).finally(() => {
                     loading.close()
                 })