Sfoglia il codice sorgente

修改 共享销售功能

Qukatie 7 mesi fa
parent
commit
7db4bfa0e6

+ 20 - 9
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -73,7 +73,8 @@
           <div>
             <el-scrollbar>
               <basic-container>
-                <avue-tree style="height: 60vh;overflow-y: auto" :option="treeOption" :data="treeData" @node-click="nodeClick" />
+                <avue-tree style="height: 60vh;overflow-y: auto" :option="treeOption" :data="treeData"
+                  @node-click="nodeClick" />
               </basic-container>
             </el-scrollbar>
           </div>
@@ -393,7 +394,7 @@ export default {
           },
           dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP&enableOrNot=1',
           hide: true,
-          filterable:true,
+          filterable: true,
           disabled: true,
           overHidden: false,
         }, {
@@ -401,7 +402,7 @@ export default {
           prop: "brandName",
           disabled: true,
           overHidden: false,
-        }, 
+        },
         {
           label: "售价1",
           prop: "priceOne",
@@ -565,7 +566,7 @@ export default {
     },
     // 导出
     outExport() {
-      let config = { params: { ...this.search,whetherIntegral:0 } }
+      let config = { params: { ...this.search, whetherIntegral: 0 } }
       if (config.params) {
         for (const propName of Object.keys(config.params)) {
           const value = config.params[propName];
@@ -816,6 +817,12 @@ export default {
       this.query = this.$options.data().query;
     },
     check(row) {
+      if (row.upAndDownShelves == 1) {
+        if (row.priceOne == 0 || row.priceTwo == 0 || row.priceThree == 0 || row.priceFour == 0) {
+          row.upAndDownShelves = 0
+          return this.$message.error("请维护所有售价");
+        }
+      }
       batchOperationProductLaunch({
         flag: row.upAndDownShelves,
         ids: row.id
@@ -908,12 +915,16 @@ export default {
     change(row, type) {
       let data = []
       for (let item of this.selectionList) {
+
         data.push(item.id)
       }
       if (type === "up") {
-        // for (let item of this.selectionList) {
-        //   if (!Number(item.salesPrice)) return this.$message.error("上架失败,商城价格不能为0")
-        // }
+        for (let item of this.selectionList) {
+          if (item.priceOne == 0 || item.priceTwo == 0 || item.priceThree == 0 || item.priceFour == 0) {
+            return this.$message.error("请维护所有售价");
+          }
+        }
+
         this.$confirm('是否确认全部上架?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -966,7 +977,7 @@ export default {
         ...Object.assign(params, search),
         // ...Object.assign(params, this.search),
         billType: 0,
-        whetherIntegral:"0"
+        whetherIntegral: "0"
       }
       this.loading = true
       getList(params).then(res => {
@@ -985,7 +996,7 @@ export default {
       groundingListZero({
         whether: params.whether ? params.whether : 0,
         ...params,
-        whetherIntegral:"0"
+        whetherIntegral: "0"
       }).then(res => {
         this.goodsListShow = res.data.data.records
         this.data = res.data.data.records;

+ 8 - 4
src/views/tirePartsMall/basicData/shareListingNext/index.vue

@@ -815,8 +815,12 @@ export default {
       }
     },
     check(row) {
-      console.log(row)
+
       if (row.shareStatus == '已确认') {
+        if (row.priceOne == 0 || row.priceTwo == 0 || row.priceThree == 0 || row.priceFour == 0 || row.shareCost == 0) {
+          row.shareStatus = '暂存'
+          return this.$message.error("请维护所有售价和共享成本");
+        }
         batchSharingConfirm({
           ids: row.id
         }).then(res => {
@@ -836,13 +840,13 @@ export default {
     change(row, type) {
       let data = []
       for (let item of this.selectionList) {
-        if (item.shareCost == 0 || item.shareCost == null) {
-          return this.$message.error("请维护共享成本单价");
-        }
         data.push(item.id)
       }
       if (type === "3") {
         for (let item of this.selectionList) {
+          if (item.priceOne == 0 || item.priceTwo == 0 || item.priceThree == 0 || item.priceFour == 0 || item.shareCost == 0) {
+            return this.$message.error("请维护所有售价和共享成本");
+          }
           if (item.billType != 1 || item.shareStatus != '暂存') return this.$message.error("选中数据已上架");
         }
         this.$confirm('是否共享确认?', '提示', {

+ 78 - 39
src/views/tirePartsMall/basicData/sharedSales/detailsPage.vue

@@ -19,10 +19,10 @@
                     销售退货
                 </el-button>
                 <el-button v-if="form.status != '已发货'" class="el-button--small-yh" style="margin-left: 6px;"
-                    type="success" size="small" :disabled="!form.id || editButton" @click="confirm(1)">确认
+                    type="success" size="small" :disabled="!form.id || editButton" @click="confirm(1)">确认
                 </el-button>
                 <el-button v-if="form.status == '已发货'" class="el-button--small-yh" style="margin-left: 6px;"
-                    type="danger" size="small" :disabled="!form.id || editButton" @click="confirm(2)">撤销
+                    type="danger" size="small" :disabled="!form.id || editButton" @click="confirm(2)">撤销
                 </el-button>
             </div>
         </div>
@@ -33,12 +33,12 @@
                         <dic-select v-model="form.customerName" placeholder="客户" key="id" label="cname" res="records"
                             url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH" :filterable="true"
                             :remote="true" dataName="cname" @selectChange="dicChange('customerName', $event)"
-                            :disabled="editButton || form.status == '已发货'"></dic-select>
+                            :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'"></dic-select>
                     </tempalte>
                     <template slot-scope="{row,index}" slot="contacts">
                         <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
                             filterable allow-create default-first-option @change="contactsChange($event)"
-                            :disabled="editButton || form.status == '已发货'">
+                            :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'">
                             <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
                                 :value="item.contacts" />
                         </el-select>
@@ -54,15 +54,15 @@
                             @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 434)">
                             <template slot-scope="{scope,row}" slot="menuLeft">
                                 <el-button type="primary" icon="el-icon-plus" size="small"
-                                    :disabled="editButton || form.status == '已发货'"
+                                    :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'"
                                     @click="rowAdd(row, 1)">添加商品</el-button>
                                 <el-button type="success" size="small"
-                                    :disabled="!form.id || editButton || form.status == '已发货'" icon="el-icon-bottom"
-                                    @click="excelDialogfun('名称')">按名称导入
+                                    :disabled="!form.id || editButton || form.status == '已发货' || form.businessSource == '外部销售'"
+                                    icon="el-icon-bottom" @click="excelDialogfun('名称')">按名称导入
                                 </el-button>
                                 <el-button type="success" size="small"
-                                    :disabled="!form.id || editButton || form.status == '已发货'" icon="el-icon-bottom"
-                                    @click="excelDialogfun('code')">按Code导入
+                                    :disabled="!form.id || editButton || form.status == '已发货' || form.businessSource == '外部销售'"
+                                    icon="el-icon-bottom" @click="excelDialogfun('code')">按Code导入
                                 </el-button>
                                 <el-popover placement="top" width="400" trigger="click" @show="inventoryShow2()">
                                     <avue-crud :data="inventoryList" :option="inventoryOption">
@@ -78,7 +78,7 @@
                                 <el-button type="primary" icon="el-icon-printer" size="small"
                                     @click="handlePrint">打印</el-button>
                                 <el-button type="danger" plain size="small" @click="batchDelete"
-                                    :disabled="editButton || form.status == '已发货'">一键删除</el-button>
+                                    :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售'">一键删除</el-button>
                             </template>
                             <template slot="goodsId" slot-scope="{ row }">
                                 {{ row.goodsName }}
@@ -163,7 +163,7 @@
                     </el-tab-pane>
                 </el-tabs>
             </trade-card>
-            <report-dialog :switchDialog="switchDialog" :reportName="reportName" :reportId="form.id"
+            <report-dialog :switchDialog="switchDialog" reportName="轮胎商城-销售订单" :reportId="form.id"
                 @onClose="onClose()"></report-dialog>
         </div>
 
@@ -491,18 +491,42 @@ export default {
                         label: "是否静音棉",
                         prop: "originalFactory",
                         width: 100,
+                        type: 'select',
+                        dicData: [{
+                            label: '否',
+                            value: "0"
+                        }, {
+                            label: '是',
+                            value: "1"
+                        }],
                         overHidden: true
                     },
                     {
                         label: "是否防爆",
                         prop: "explosionProof",
                         width: 100,
+                        type: 'select',
+                        dicData: [{
+                            label: '否',
+                            value: 0
+                        }, {
+                            label: '是',
+                            value: 1
+                        }],
                         overHidden: true
                     },
                     {
                         label: "是否自修补",
                         prop: "selfRecovery",
                         width: 100,
+                        type: 'select',
+                        dicData: [{
+                            label: '否',
+                            value: "0"
+                        }, {
+                            label: '是',
+                            value: "1"
+                        }],
                         overHidden: true
                     }
                 ]
@@ -589,29 +613,29 @@ export default {
                         trigger: "blur"
                     }]
                 },
-                {
-                    label: '业务员',
-                    disabled: false,
-                    prop: "salerId",
-                    type: "select",
-                    props: {
-                        label: "name",
-                        value: "id"
-                    },
-                    dicUrl: "/api/blade-user/salerList",
-                    filterable: true,
-                }, {
-                    label: '仓库',
-                    prop: "storageId",
-                    type: 'select',
-                    disabled: true,
-                    placeholder: '仓库为空即为异地销售',
-                    props: {
-                        label: 'cname',
-                        value: 'id'
-                    },
-                    dicUrl: '/api/blade-sales-part/storageDesc/listAll',
-                },
+                // {
+                //     label: '业务员',
+                //     // disabled: false,
+                //     prop: "salerId",
+                //     type: "select",
+                //     props: {
+                //         label: "name",
+                //         value: "id"
+                //     },
+                //     dicUrl: "/api/blade-user/salerList",
+                //     filterable: true,
+                // }, {
+                //     label: '仓库',
+                //     prop: "storageId",
+                //     type: 'select',
+                //     disabled: true,
+                //     placeholder: '仓库为空即为异地销售',
+                //     props: {
+                //         label: 'cname',
+                //         value: 'id'
+                //     },
+                //     dicUrl: '/api/blade-sales-part/storageDesc/listAll',
+                // },
                 {
                     label: '联系人',
                     type: "select",
@@ -628,7 +652,6 @@ export default {
                 }, {
                     label: '电话',
                     disabled: false,
-
                     prop: "phone",
                 }, {
                     label: '收货地址',
@@ -1102,7 +1125,20 @@ export default {
         confirmEditing() {
             this.editButton = false
             if (this.form.status != '已发货') {
-                this.optionForm.disabled = false
+                if (this.form.businessSource == '外部销售') {
+                    this.optionForm.disabled = false
+                    this.optionForm.column.forEach(item => {
+                        if (item.prop == 'shipType' || item.prop == 'logisticsCorpName' || item.prop == 'expressNo' || item.prop == 'remarks') {
+                            item.disabled = false
+                        } else {
+                            item.disabled = true
+                        }
+                    })
+                }
+                if (this.form.businessSource == '内部销售') {
+                    this.optionForm.disabled = false
+                }
+
             }
         },
         outGoodsChange(row) {
@@ -1501,9 +1537,7 @@ export default {
             })
             getDetails({ id: id }).then(res => {
                 this.form = res.data.data
-                if (res.data.data.status != '已发货') {
-                    this.optionForm.disabled = false
-                } else {
+                if (res.data.data.status == '已发货') {
                     this.optionForm.disabled = true
                 }
             }).finally(() => {
@@ -1537,6 +1571,11 @@ export default {
             if (this.selectionMultilist.length == 0) {
                 return this.$message.warning('请选择要删除的数据')
             }
+            for (let item of this.selectionMultilist) {
+                if (item.sendNum != 0) {
+                    return this.$message.error("已派发,不能删除");
+                }
+            }
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",

+ 30 - 29
src/views/tirePartsMall/basicData/sharedSales/index.vue

@@ -142,36 +142,37 @@ export default {
           // },
           // dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=KH&cname={{key}}',
         },
+        // {
+        //   label: '业务员',
+        //   disabled: false,
+        //   prop: "salerName",
+        //   search: true,
+        //   type: "select",
+        //   props: {
+        //     label: "name",
+        //     value: "name"
+        //   },
+        //   dicUrl: "/api/blade-user/salerList",
+        //   filterable: true,
+        //   rules: [{
+        //     required: true,
+        //     message: " ",
+        //     trigger: "blur"
+        //   }]
+        // }, {
+        //   label: '仓库',
+        //   prop: "storageName",
+        //   search: true,
+        //   overHidden: true,
+        //   // remote: true,
+        //   type: 'select',
+        //   props: {
+        //     label: 'cname',
+        //     value: 'cname'
+        //   },
+        //   dicUrl: '/api/blade-sales-part/storageDesc/listAll?cname={{key}}',
+        // }, 
         {
-          label: '业务员',
-          disabled: false,
-          prop: "salerName",
-          search: true,
-          type: "select",
-          props: {
-            label: "name",
-            value: "name"
-          },
-          dicUrl: "/api/blade-user/salerList",
-          filterable: true,
-          rules: [{
-            required: true,
-            message: " ",
-            trigger: "blur"
-          }]
-        }, {
-          label: '仓库',
-          prop: "storageName",
-          search: true,
-          overHidden: true,
-          // remote: true,
-          type: 'select',
-          props: {
-            label: 'cname',
-            value: 'cname'
-          },
-          dicUrl: '/api/blade-sales-part/storageDesc/listAll?cname={{key}}',
-        }, {
           label: '行数',
           prop: "numberRows",
           overHidden: true,

+ 131 - 5
src/views/tirePartsMall/salesManagement/Inventory/detailsPage.vue

@@ -44,12 +44,22 @@
                             @click="excelBox = true">导入</el-button>
                     </template>
                     <template slot="sendNum" slot-scope="{ row }">
-                        <el-input v-if="!mingxibaocun" size="small" v-model="row.sendNum" style="width: 100%"
-                            @blur="sendNumBlur(row)"></el-input>
+                        <el-input v-if="!mingxibaocun && whetherFinancing != 1" size="small" v-model="row.sendNum"
+                            style="width: 100%" @blur="sendNumBlur(row)"></el-input>
                         <span v-else
                             :style="{ color: (Number(row.inventory) < Number(row.sendNum)) ? '#4c9e44' : '#dd4b3a' }">{{
                                 row.sendNum }}</span>
                     </template>
+                    <template slot="sendNumFinancing" slot-scope="{row}">
+                        <el-input-number v-if="!mingxibaocun&& whetherFinancing == 1" v-model="row.sendNumFinancing" size="small"
+                            :controls="false" :precision="0" style="width: 100%" @change="calculator(row)" />
+                        <span v-else>{{ row.sendNumFinancing }}</span>
+                    </template>
+                    <template slot="sendNumHave" slot-scope="{row}">
+                        <el-input-number v-if="!mingxibaocun&& whetherFinancing == 1" v-model="row.sendNumHave" size="small" :controls="false"
+                            :precision="0" style="width: 100%" @change="calculator(row)" />
+                        <span v-else>{{ row.sendNumHave }}</span>
+                    </template>
                     <template slot="profitLossNum" slot-scope="{ row }">
                         <span
                             :style="{ color: (Number(row.inventory) < Number(row.sendNum)) ? '#4c9e44' : '#dd4b3a' }">{{
@@ -60,7 +70,6 @@
                             style="width: 100%"></el-input>
                         <span v-else>{{ row.remarks }}</span>
                     </template>
-
                     <template slot-scope="{type,size,row,index,disabled}" slot="menu">
                         <el-button v-if="mingxibaocun" :size="size" :type="type" :disabled="form.status == '已确认'"
                             :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="hangeditBtn(row, index)">编辑
@@ -157,6 +166,7 @@ export default {
     name: "detailsPage",
     data() {
         return {
+            whetherFinancing: 0,
             switchDialog: false, //打印
             // 添加商品弹窗左侧配置
             treeOption: {
@@ -289,7 +299,24 @@ export default {
                         prop: "balanceQuantity",
                         overHidden: true,
                         width: 100
-                    }, {
+                    },
+                    {
+                        label: '参考库存融资',
+                        prop: "balanceQuantityFinancing",
+                        width: 120,
+                        overHidden: true,
+                        hide: true,
+                        showColumn: false,
+                    },
+                    {
+                        label: '参考库存自有',
+                        prop: "balanceQuantityHave",
+                        width: 120,
+                        overHidden: true,
+                        hide: true,
+                        showColumn: false,
+                    },
+                    {
                         label: '库存单价',
                         prop: "inventoryCostPrice",
                         overHidden: true,
@@ -607,7 +634,24 @@ export default {
                     overHidden: true,
                     disabled: false,
                     width: 100,
-                }, {
+                },
+                {
+                    label: '参考库存融资',
+                    prop: "inventoryFinancing",
+                    width: 120,
+                    disabled: true,
+                    hide: true,
+                    showColumn: false,
+                },
+                {
+                    label: '参考库存自有',
+                    prop: "inventoryHave",
+                    width: 120,
+                    disabled: true,
+                    hide: true,
+                    showColumn: false,
+                },
+                {
                     label: '账面金额',
                     prop: 'price',
                     overHidden: true,
@@ -653,6 +697,20 @@ export default {
                     }]
                 },
                 {
+                    label: '融资数量',
+                    prop: 'sendNumFinancing',
+                    disabled: false,
+                    hide: true,
+                    showColumn: false,
+                },
+                {
+                    label: '自有数量',
+                    prop: 'sendNumHave',
+                    disabled: false,
+                    hide: true,
+                    showColumn: false,
+                },
+                {
                     label: '实际金额',
                     prop: 'subTotalMoney',
                     overHidden: true,
@@ -715,6 +773,23 @@ export default {
                 this.findObject(this.inventoryOption.column, "brandItem").label = '规格型号1'
             }
         })
+        isProcurement({ "param": "whether.financing" }).then(res => {
+            if (res.data.data == 1) {
+                this.whetherFinancing = res.data.data
+                this.findObject(this.inventoryOption.column, "balanceQuantityFinancing").hide = false
+                this.findObject(this.inventoryOption.column, "balanceQuantityFinancing").showColumn = true
+                this.findObject(this.inventoryOption.column, "balanceQuantityHave").hide = false
+                this.findObject(this.inventoryOption.column, "balanceQuantityHave").showColumn = true
+                this.findObject(this.optionContacts.column, "inventoryFinancing").hide = false
+                this.findObject(this.optionContacts.column, "inventoryFinancing").showColumn = true
+                this.findObject(this.optionContacts.column, "inventoryHave").hide = false
+                this.findObject(this.optionContacts.column, "inventoryHave").showColumn = true
+                this.findObject(this.optionContacts.column, "sendNumFinancing").hide = false
+                this.findObject(this.optionContacts.column, "sendNumFinancing").showColumn = true
+                this.findObject(this.optionContacts.column, "sendNumHave").hide = false
+                this.findObject(this.optionContacts.column, "sendNumHave").showColumn = true
+            }
+        })
         if (this.detailData.id) {
             this.editButton = true
             this.refresh(this.detailData.id)
@@ -824,6 +899,11 @@ export default {
                     dot: item.dot, // 批次号
                     costprie: item.inventoryCostPrice,// 库存成本
                     inventory: item.balanceQuantity, // 账面数量
+                    inventoryFinancing: item.balanceQuantityFinancing,
+                    inventoryHave: item.balanceQuantityHave,
+                    sendNum:0,
+                    sendNumFinancing:0,
+                    sendNumHave:0,
                     price: item.inventoryAmount, // 账面金额
                 })
             }
@@ -854,6 +934,20 @@ export default {
             this.$set(row, 'profitLossNum', Number(row.sendNum) - Number(row.inventory))
             this.$set(row, 'profitLossAmount', Number(row.subTotalMoney) - Number(row.price))
         },
+        calculator(row) {
+            if (row.sendNumFinancing > row.inventoryFinancing) {
+                this.$set(row, 'sendNumFinancing', null)
+                this.$message.error("融资数量不能大于参考库存融资");
+            }
+            if (row.sendNumHave > row.inventoryHave) {
+                this.$set(row, 'sendNumHave', null)
+                this.$message.error("自由数量不能大于参考库存自有");
+            }
+            row.sendNum = Number(Number(row.sendNumFinancing) + Number(row.sendNumHave))
+            row.subTotalMoney = row.sendNum * row.costprie
+            row.profitLossNum=Number(row.sendNum) - Number(row.inventory)
+            row.profitLossAmount=Number(row.subTotalMoney) - Number(row.price)
+        },
         //表头编辑
         confirmEditing() {
             this.editButton = false // 让保存按钮出来
@@ -1108,6 +1202,22 @@ export default {
                     this.findObject(this.inventoryOption.column, "brandItem").label = '规格型号1'
                 }
             })
+            isProcurement({ "param": "whether.financing" }).then(res => {
+                if (res.data.data == 1) {
+                    this.findObject(this.inventoryOption.column, "balanceQuantityFinancing").hide = false
+                    this.findObject(this.inventoryOption.column, "balanceQuantityFinancing").showColumn = true
+                    this.findObject(this.inventoryOption.column, "balanceQuantityHave").hide = false
+                    this.findObject(this.inventoryOption.column, "balanceQuantityHave").showColumn = true
+                    this.findObject(this.optionContacts.column, "inventoryFinancing").hide = false
+                    this.findObject(this.optionContacts.column, "inventoryFinancing").showColumn = true
+                    this.findObject(this.optionContacts.column, "inventoryHave").hide = false
+                    this.findObject(this.optionContacts.column, "inventoryHave").showColumn = true
+                    this.findObject(this.optionContacts.column, "sendNumFinancing").hide = false
+                    this.findObject(this.optionContacts.column, "sendNumFinancing").showColumn = true
+                    this.findObject(this.optionContacts.column, "sendNumHave").hide = false
+                    this.findObject(this.optionContacts.column, "sendNumHave").showColumn = true
+                }
+            })
             if (inSave) {
                 this.$message.success("保存成功");
                 //关闭窗口
@@ -1123,6 +1233,22 @@ export default {
                     this.findObject(this.inventoryOption.column, "brandItem").label = '规格型号1'
                 }
             })
+            isProcurement({ "param": "whether.financing" }).then(res => {
+                if (res.data.data == 1) {
+                    this.findObject(this.inventoryOption.column, "balanceQuantityFinancing").hide = false
+                    this.findObject(this.inventoryOption.column, "balanceQuantityFinancing").showColumn = true
+                    this.findObject(this.inventoryOption.column, "balanceQuantityHave").hide = false
+                    this.findObject(this.inventoryOption.column, "balanceQuantityHave").showColumn = true
+                    this.findObject(this.optionContacts.column, "inventoryFinancing").hide = false
+                    this.findObject(this.optionContacts.column, "inventoryFinancing").showColumn = true
+                    this.findObject(this.optionContacts.column, "inventoryHave").hide = false
+                    this.findObject(this.optionContacts.column, "inventoryHave").showColumn = true
+                    this.findObject(this.optionContacts.column, "sendNumFinancing").hide = false
+                    this.findObject(this.optionContacts.column, "sendNumFinancing").showColumn = true
+                    this.findObject(this.optionContacts.column, "sendNumHave").hide = false
+                    this.findObject(this.optionContacts.column, "sendNumHave").showColumn = true
+                }
+            })
             const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
             if (inSave) {
                 this.$message.success("重置成功");

+ 4 - 2
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/detailsPage.vue

@@ -881,7 +881,9 @@ export default {
             }).finally(() => {
               loading.close();
             });
-          })
+          }).catch(() => {
+              loading.close();
+            });
         } else {
           this.$message.error('请选择库管')
         }
@@ -913,7 +915,7 @@ export default {
             //     i++
             //     return
             // }
-            item.goodsName = item.$goodsId
+            // item.goodsName = item.$goodsId
           })
           if (i != 0) {
             loading.close();

+ 14 - 13
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -89,20 +89,17 @@
                             @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)">
                             <template slot-scope="{scope,row}" slot="menuLeft">
                                 <el-button type="primary" icon="el-icon-plus" size="small"
-                                    :disabled="isAddBtn || form.billType== 1"
-                                    @click="rowAdd(row, 1)">添加商品</el-button>
-                                <el-button type="success" size="small"
-                                    :disabled="isAddBtn || form.billType== 1" icon="el-icon-bottom"
-                                    @click="excelDialogfun('名称')">按名称导入
+                                    :disabled="isAddBtn || form.billType == 1" @click="rowAdd(row, 1)">添加商品</el-button>
+                                <el-button type="success" size="small" :disabled="isAddBtn || form.billType == 1"
+                                    icon="el-icon-bottom" @click="excelDialogfun('名称')">按名称导入
                                 </el-button>
-                                <el-button type="success" size="small"
-                                    :disabled="isAddBtn || form.billType== 1" icon="el-icon-bottom"
-                                    @click="excelDialogfun('code')">按Code导入
+                                <el-button type="success" size="small" :disabled="isAddBtn || form.billType == 1"
+                                    icon="el-icon-bottom" @click="excelDialogfun('code')">按Code导入
                                 </el-button>
                                 <el-button type="primary" icon="el-icon-printer" size="small"
                                     @click="handlePrint">打印</el-button>
                                 <el-button type="danger" plain size="small" @click="batchDelete"
-                                    :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售' || form.billType== 1">一键删除</el-button>
+                                    :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售' || form.billType == 1">一键删除</el-button>
                                 <el-button type="primary" plain size="small" @click="quickCopy">快捷复制</el-button>
                                 <el-popover width="600" trigger="click">
                                     <avue-crud :data="inventoryData" :option="inventoryOption"></avue-crud>
@@ -110,8 +107,7 @@
                                         :disabled="selectionMultilist.length != 1">查看库存</el-button>
                                 </el-popover>
                                 <el-button type="primary" icon="el-icon-plus" size="small"
-                                    :disabled="isAddBtn || form.billType== 1 "
-                                    @click="rowAdd(row, 2)">无库存商品</el-button>
+                                    :disabled="isAddBtn || form.billType == 1" @click="rowAdd(row, 2)">无库存商品</el-button>
                                 <el-popover width="600" trigger="click">
                                     <avue-crud :data="inventoryData2" :option="inventoryOption2">
                                         <template slot-scope="{row}" slot="menu">
@@ -1950,7 +1946,7 @@ export default {
             }
             this.isDisabled = false
             this.isAdd = false
-            if (this.form.billType== 1) {
+            if (this.form.billType == 1) {
                 this.optionForm.column.forEach(its => {
                     if (its.prop == 'customerName' || its.prop == 'businesDate' || its.prop == 'businessSource' || its.prop == 'returnsNumber' || its.prop == 'returnsAmount' || its.prop == 'srcOrdNo') {
                         this.$set(its, 'disabled', true)
@@ -2158,7 +2154,10 @@ export default {
                                     if (res.data.data.records.length) {
                                         res.data.data.records.forEach(e => {
                                             if (e.paramValue == 1) {
-                                                if (!this.form.storageId) return this.$message.error('请选择仓库')
+                                                if (!this.form.storageId){
+                                                    loading.close();
+                                                    return this.$message.error('请选择仓库')
+                                                } 
                                                 whetherExistenceFinancing({
                                                     bsType: "XS",
                                                     ...this.form
@@ -2314,6 +2313,8 @@ export default {
                                             loading.close();
                                         })
                                     }
+                                }).catch(() => {
+                                    loading.close();
                                 })
 
                                 done();