浏览代码

修改bug

chenrui 2 月之前
父节点
当前提交
f745c6c3f0
共有 1 个文件被更改,包括 33 次插入27 次删除
  1. 33 27
      src/views/bulkManagement/bulkWarehousingOrder/edit.vue

+ 33 - 27
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -308,8 +308,16 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import Print from '@/views/common/print.vue'
+import importGuideModal from './importGuideModal.vue'
+import newProduct from '@/views/productManagement/productInfo/edit.vue'
+import { hdPrint } from '@/libs/JGPrint'
+// 接口
 import {
   sparePartsPurDetail,
   sparePartsPurDetailList,
@@ -320,14 +328,8 @@ import {
   sparePartsPurDetailPrint,
   sparePartsPurDeleteAll,
   sparePartsPurDetailInsertBatch } from '@/api/sparePartsPur'
-import { bulkProductList } from '@/api/dealerProduct'
+import { bulkProductList, dealerProductList } from '@/api/dealerProduct'
 import { warehouseCascadeList } from '@/api/warehouse'
-import ProductType from '../../common/productType.js'
-import ProductBrand from '../../common/productBrand.js'
-import Print from '@/views/common/print.vue'
-import importGuideModal from './importGuideModal.vue'
-import newProduct from '@/views/productManagement/productInfo/edit.vue'
-import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'BulkWarehousingEdit',
   components: { STable, VSelect, Print, ProductType, ProductBrand, newProduct, importGuideModal },
@@ -464,29 +466,33 @@ export default {
   },
   methods: {
     // 是否新增产品
-    isAddNewProduct (data) {
+    async isAddNewProduct (data) {
       const _this = this
       if (data.length == 0) {
-        _this.$confirm({
-          title: '提示',
-          content: '该产品信息不存在,是否马上新增?',
-          centered: true,
-          onOk () {
-            _this.paramsData = {
-              supplierName: _this.basicInfoData.supplierName,
-              code: _this.queryParam.code,
-              name: _this.queryParam.name,
-              origCode: _this.queryParam.origCode,
-              putCost: 0,
-              putQty: 1,
-              warehouse: []
+        const res = await dealerProductList({ code: _this.queryParam.code, enabledFlag: 0, pageNo: 1, pageSize: 50 })
+        const disableList = res.data.list
+        if (disableList && disableList.length == 0) {
+          _this.$confirm({
+            title: '提示',
+            content: '该产品信息不存在,是否马上新增?',
+            centered: true,
+            onOk () {
+              _this.paramsData = {
+                supplierName: _this.basicInfoData.supplierName,
+                code: _this.queryParam.code,
+                name: _this.queryParam.name,
+                origCode: _this.queryParam.origCode,
+                putCost: 0,
+                putQty: 1,
+                warehouse: []
+              }
+              _this.showNewProduct = true
+              _this.$nextTick(() => {
+                _this.$refs.newProduct.pageInit()
+              })
             }
-            _this.showNewProduct = true
-            _this.$nextTick(() => {
-              _this.$refs.newProduct.pageInit()
-            })
-          }
-        })
+          })
+        }
       } else {
         // 新添加的产品自动添加到已选产品中
         if (data.length == 1 && this.showNewProduct) {