Browse Source

修改bug

web100 2 years ago
parent
commit
b54cc349e8

+ 3 - 2
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -83,12 +83,13 @@ export const revokeCheckOrder = (data) => {
   })
 }
 
-export const goodsListXs = (customId) => {
+export const goodsListXs = (customId,stock) => {
   return request({
     url: '/api/blade-sales-part/goodsDesc/goodsListXs',
     method: 'get',
     params:{
-      customId
+      customId,
+      stock
     }
   })
 }

+ 9 - 9
src/views/tirePartsMall/basicData/commodityInformation/components/index.vue

@@ -23,15 +23,15 @@
       @on-load="onLoad"
       @tree-load="treeLoad"
   >
-    <!--<template slot-scope="scope" slot="menu">-->
-    <!--  <el-button-->
-    <!--    type="text"-->
-    <!--    icon="el-icon-circle-plus-outline"-->
-    <!--    size="small"-->
-    <!--    @click.stop="handleAdd(scope.row, scope.index)"-->
-    <!--    >新增子项-->
-    <!--  </el-button>-->
-    <!--</template>-->
+    <template slot-scope="scope" slot="menu">
+     <el-button
+       type="text"
+       icon="el-icon-circle-plus-outline"
+       size="small"
+       @click.stop="handleAdd(scope.row, scope.index)"
+       >新增子项
+     </el-button>
+    </template>
   </avue-crud>
 </template>
 

+ 9 - 4
src/views/tirePartsMall/basicData/commodityInformation/detailsPage.vue

@@ -24,7 +24,7 @@
                 <avue-form ref="form" class="trading-form" v-model="form" :option="option" :key="key">
                     <template slot="goodsTypeId" slot-scope="{disabled}">
                         <div style="display:flex;">
-                            <avue-cascader :disabled="disabled" :emit-path="false" check-strictly :show-all-levels="false"
+                            <avue-cascader :disabled="disabled" :emit-path="false"  check-strictly :show-all-levels="false"
                                 v-model="form.goodsTypeId" placeholder="请选择产品分类" :dic="goodsTypeList"
                                 :props="props"></avue-cascader>
                             <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
@@ -498,8 +498,8 @@ export default {
             },
             filesList: [],
             props: {
-                label: 'cname',
-                value: 'id'
+                label: 'title',
+                value: 'value'
             },
             props2: {
                 label: 'dictValue',
@@ -541,8 +541,13 @@ export default {
             //   this.goodsTypeList = res.data.data;
             //   this.findObject(this.option2.column, "parentId").dicData = res.data.data;
             // });
+            getCorpType({ corpType: "SP" }).then(res=>{
+                console.log(res);
+                this.goodsTypeList = res.data.data;
+            })
             customerList({ corpType: "SP" }).then(res => {
-                this.goodsTypeList = res.data.data.records;
+                console.log('kk',res);
+                // this.goodsTypeList = res.data.data.records;
                 this.findObject(this.option2.column, "parentId").dicData = res.data.data.records;
             });
             // getStoragelist().then(res => {

+ 9 - 9
src/views/tirePartsMall/basicData/customerInformation/components/index.vue

@@ -23,15 +23,15 @@
       @on-load="onLoad"
       @tree-load="treeLoad"
   >
-    <!--<template slot-scope="scope" slot="menu">-->
-    <!--  <el-button-->
-    <!--    type="text"-->
-    <!--    icon="el-icon-circle-plus-outline"-->
-    <!--    size="small"-->
-    <!--    @click.stop="handleAdd(scope.row, scope.index)"-->
-    <!--    >新增子项-->
-    <!--  </el-button>-->
-    <!--</template>-->
+    <template slot-scope="scope" slot="menu">
+     <el-button
+       type="text"
+       icon="el-icon-circle-plus-outline"
+       size="small"
+       @click.stop="handleAdd(scope.row, scope.index)"
+       >新增子项
+     </el-button>
+    </template>
   </avue-crud>
 </template>
 

+ 2 - 2
src/views/tirePartsMall/basicData/customerInformation/configuration/mainList.json

@@ -11,7 +11,7 @@
   "tree": true,
   "selection": true,
   "viewBtn": true,
-  "menuWidth": 200,
+  "menuWidth": 300,
   "column": [
     {
       "label": "类型",
@@ -53,7 +53,7 @@
       "prop": "parentId",
       "dicData": [],
       "type": "tree",
-      "hide": true,
+      "hide": false,
       "addDisabled": false,
       "props": {
         "label": "cname",

+ 2 - 2
src/views/tirePartsMall/basicData/customerInformation/index.vue

@@ -39,8 +39,8 @@
               </el-date-picker>
             </template>
             <template slot-scope="{type,size, row, index }" slot="menu">
-              <el-button :size="size" :type="type" @click="editOpen(row, 2)">编辑</el-button>
-              <el-button :size="size" :type="type" @click.stop="rowDel(row)">删除</el-button>
+              <el-button :size="size" :type="type" :disabled="!row.enableOrNot" @click="editOpen(row, 2)">编辑</el-button>
+              <el-button :size="size" :type="type" :disabled="!row.enableOrNot" @click.stop="rowDel(row)">删除</el-button>
             </template>
             <!-- <template slot="deliveryWarehouseName">
               <el-select v-model="search.deliveryWarehouseName" filterable clearable size="small" :disabled="disabled">

+ 8 - 6
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -61,7 +61,7 @@
           <basic-container>
             <avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="cruds"
               @refresh-change="refreshChangeCost" @selection-change="selectionChangeCost" @search-change="goodsSearchCost"
-              :page.sync="page" @on-load="onLoad">
+              :page.sync="pages" @on-load="onLoad">
               <template slot="menuLeft">
                 <el-tabs v-model="activeName" @tab-click="tabHandle">
                   <el-tab-pane label="查询结果" name="searchList" />
@@ -331,7 +331,7 @@ export default {
           // searchProp: "sharedCompanyList",
           search: true,
           overHidden: true,
-          multiple: true,
+
           tags: true,
           type: 'select',
           props: {
@@ -408,9 +408,9 @@ export default {
     console.log(params);
     console.log(params.$salesCompanyName);
     // sharedCompanyList
-    this.search.sharedCompanyList = params.sharedCompany;
-    Vue.delete(params, 'sharedCompany');
-    Vue.delete(this.search, 'sharedCompany');
+    // this.search.sharedCompanyList = params.sharedCompany;
+    // Vue.delete(params, 'sharedCompany');
+    // Vue.delete(this.search, 'sharedCompany');
     this.onLoad(this.page, params)
     done();
   },
@@ -676,6 +676,7 @@ export default {
     }
     this.loading = true
     getList(params).then(res => {
+      console.log(res.data.data.total);
       this.dataList = res.data.data.records
       this.page.total = res.data.data.total
       this.pageList.total = res.data.data.total
@@ -689,9 +690,10 @@ export default {
     this.loading = true
 
     groundingList(params).then(res => {
+      console.log(res.data.data.total);
       this.goodsListShow = res.data.data.records
       this.data = res.data.data.records;
-      this.page.total = res.data.data.total
+      this.pages.total = res.data.data.total
       this.loading = false
     }).finally(() => {
       this.loading = false

+ 1 - 1
src/views/tirePartsMall/basicData/shareListing/index.vue

@@ -22,7 +22,7 @@
               <avue-ueditor v-model="form.detailsText" :options="optionsUeditor"></avue-ueditor>
             </template>
             <template slot-scope="{type,size,row,index}" slot="menu">
-              <el-button :size="size" :type="type" @click="$refs.crud.rowEdit(row, index)">编辑
+              <el-button :size="size" :type="type" :disabled="row.upAndDownShelves" @click="$refs.crud.rowEdit(row, index)">编辑
               </el-button>
               <el-tooltip :content="`${row.upAndDownShelves == 0?'上架':'下架'}`" placement="top">
                 <el-switch

+ 3 - 5
src/views/tirePartsMall/basicData/supplier/index.vue

@@ -11,10 +11,6 @@
                 @click="corpTypeVisible = true"></i>
               </el-tooltip>
             </template>
-            <template slot="addBtn">
-              <i class="el-icon-refresh-right" title="刷新" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
-                @click="refresh"></i>
-            </template>
           </avue-tree>
         </el-col>
         <el-col :span="20">
@@ -255,10 +251,12 @@ export default {
       //     return false;
       //   }
       // });
-      this.getAllWorkDicts()
+      // this.getAllWorkDicts()
       this.corpTypeVisible = false
     },
     corpTypeClosed() {
+      this.refresh()
+      console.log(234324);
       // this.reload = Math.random();
       // this.form4 = this.$options.data().form4
     },

+ 58 - 2
src/views/tirePartsMall/inventory/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <basic-container v-show="!detailsOpen">
+    <basic-container v-show="!detailsOpen" class="page-crad">
       <el-row>
         <el-col :span="4">
           <avue-tree ref="treeRef" :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
@@ -10,6 +10,8 @@
         <el-col :span="20">
           <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
             ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange" @refresh-change="refreshChange"
+            :cell-style="cellStyle"
+            @search-criteria-switch="searchCriteriaSwitch"
             @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 268)"
             @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 268)" :page.sync="page">
             <template slot-scope="{type,size,row,$index}" slot="menuLeft">
@@ -189,6 +191,7 @@ export default {
             search: true,
             type:'select',
             showColumn:false,
+            hide:true,
             width: 100,
             dicData: [{
               "label": "是",
@@ -287,6 +290,12 @@ export default {
         this.loading = false
       })
     },
+    searchCriteriaSwitch(){
+      this.$refs.crud.getTableHeight();
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
       /**
@@ -314,4 +323,51 @@ export default {
 }
 </script>
 
-<style scoped></style>
+<style lang="scss" scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
+
+::v-deep .el-form-item__error {
+  display: none !important;
+}
+
+::v-deep .el-input-group__append {
+  padding: 0 0px !important;
+}
+
+.el-dialog ::v-deep .el-form-item__error {
+  display: none !important;
+}
+
+.stat-td {
+  text-align: center;
+  position: relative;
+}
+
+.stat-img {
+  width: 95%;
+  height: 100px;
+}
+
+.stat-tip {
+  position: absolute;
+  left: 15px;
+  top: 5px;
+
+  .money {
+    color: #fff;
+    font-size: 28px;
+    text-align: left;
+    font-weight: 600;
+  }
+
+  .title {
+    color: #fff;
+    font-size: 14px;
+    text-align: left;
+    margin-top: 5px;
+    margin-bottom: 0px;
+  }
+}
+</style>

+ 3 - 0
src/views/tirePartsMall/salesManagement/outboundTask/index.vue

@@ -199,6 +199,7 @@ export default {
           label: '备注',
           prop: "remarks",
           width: 200,
+          cell:false,
           overHidden: true,
         }, {
           label: '业务日期',
@@ -295,6 +296,8 @@ export default {
       this.findObject(this.optionList.column, "storageName").cell = true
       this.findObject(this.option.column, "stockClerkId").cell = true
       this.findObject(this.optionList.column, "stockClerkId").cell = true
+      this.findObject(this.option.column, "remarks").cell = true
+      this.findObject(this.optionList.column, "remarks").cell = true
       this.$refs.crud.rowCell(row, index)
     },
     rowDel(form, index) {

+ 13 - 10
src/views/tirePartsMall/salesManagement/outboundWorkOrder/detailsPage.vue

@@ -192,8 +192,8 @@ export default {
           prop: "remarks",
           type: 'textarea',
           disabled: false,
-          span: 24,
-          minRows: 2
+          span: 16,
+          minRows: 1
         }]
       },
       formContacts: {},
@@ -202,6 +202,7 @@ export default {
         align: 'center',
         index: true,
         addBtnText: "录入明细",
+        updateBtnText: '保存',
         refreshBtn: false,
         dialogDrag: true,
         addBtn: true,
@@ -214,11 +215,6 @@ export default {
         dialogTop: 25,
         dialogWidth: "80%",
         column: [{
-          label: '轮胎编码',
-          disabled: true,
-          prop: 'goodsNo',
-          width: 100
-        }, {
           label: '轮胎名称',
           prop: 'goodsId',
           disabled: true,
@@ -230,7 +226,12 @@ export default {
             value: 'id'
           },
           dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll'
-        }, {
+        },{
+          label: '轮胎编码',
+          disabled: true,
+          prop: 'goodsNo',
+          width: 100
+        },  {
           label: '品牌',
           prop: 'brandId',
           disabled: true,
@@ -457,7 +458,7 @@ export default {
             loading.close();
           });
         } else {
-          this.$message.error('请选择')
+          this.$message.error('请选择库管')
         }
       })
     },
@@ -512,6 +513,7 @@ export default {
             }
           })
         }
+        this.isAddDisabled = true
         this.form = res.data.data
         loading.close();
       }).catch(() => {
@@ -571,6 +573,7 @@ export default {
         })
       } else {
         this.$set(this.optionForm, 'disabled', false)
+        this.isAddDisabled = true
         this.optionForm.column.forEach(item => {
           if (item.prop == 'remarks') {
             item.disabled = false
@@ -578,7 +581,7 @@ export default {
             item.disabled = true
           }
         })
-        this.isAddDisabled = false
+        // this.isAddDisabled = false
 
       }
     },

+ 1 - 1
src/views/tirePartsMall/salesManagement/outboundWorkOrder/index.vue

@@ -18,7 +18,7 @@
           :page.sync="page">
         <template slot-scope="{type,size,row,index}" slot="menu">
           <!-- <el-button  :size="size" :type="type" @click="check(row)">查看</el-button> -->
-          <el-button  :size="size" :disabled="row.item >= 1" :type="type" @click="$refs.crud.rowDel(row,index)">删除</el-button>
+          <el-button  :size="size" :disabled="row.status !== '待出库' && row.item >= 1" :type="type" @click="$refs.crud.rowDel(row,index)">删除</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>

+ 142 - 40
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -7,11 +7,11 @@
                 </el-button>
             </div>
             <div class="add-customer-btn">
-                <el-button class="el-button&#45;&#45;small-yh" style="margin-left: 6px;" type="primary" size="small"
-                    v-if="!editButton" @click="confirmEditing">编 辑
+                <el-button class="el-button&#45;&#45;small-yh" :disabled="isEditButton" style="margin-left: 6px;"
+                    type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
                 </el-button>
                 <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
-                    @click="editCustomer">保 存
+                    :disabled="isSaveBtn" @click="editCustomer">保 存
                 </el-button>
                 <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
                     :disabled="isDisabledTask" @click="generateOutbound">
@@ -87,7 +87,7 @@
                                 </span>
                             </template> -->
                             <template slot-scope="{type,size,row,index,disabled}" slot="menu">
-                                <el-button :size="size" :disabled="disabled" :type="type"
+                                <el-button :size="size" :disabled="disabled || isAdd" :type="type"
                                     :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="editBtn(row, index)">编辑
                                 </el-button>
                                 <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
@@ -166,6 +166,11 @@ export default {
             dataList: [],
             dicUrlWithCustomId: '',
             isAddBtn: true,
+            isSaveBtn: false,
+            viewDisabled: false,
+            isAdd: false,
+            editButton: true,
+            isEditButton: false,
             isDisabled: false,
             isDisabledTask: false,
             contactsOption: [],
@@ -206,7 +211,6 @@ export default {
                     },
                     cascader: ['recAddress'],
                     change: (data) => {
-
                         if (!this.onLoad.id) {
                             // this.$set(this.optionContactsBack, "addBtn", true)
                             // this['optionContacts'] = this['optionContactsBack'];
@@ -221,7 +225,8 @@ export default {
                                 this.form.contacts = res.data.data.corpsAttnList[0].cname
                                 this.form.phone = res.data.data.corpsAttnList[0].tel
                                 this.contactsOption = res.data.data.corpsAddrList
-                                this.form.recAddress = res.data.data.corpsAddrList[0].id
+                                this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
+
                             })
                         }
 
@@ -248,16 +253,17 @@ export default {
                     prop: "storageId",
                     type: 'select',
                     disabled: false,
+                    placeholder: '仓库为空即为异地销售',
                     props: {
                         label: 'cname',
                         value: 'id'
                     },
                     dicUrl: '/api/blade-sales-part/storageDesc/listAll',
-                    rules: [{
-                        required: true,
-                        message: " ",
-                        trigger: "blur"
-                    }]
+                    // rules: [{
+                    //     required: true,
+                    //     message: " ",
+                    //     trigger: "blur"
+                    // }]
                 }, {
                     label: '单据编号',
                     prop: "ordNo",
@@ -300,10 +306,10 @@ export default {
                     label: '收货地址',
                     prop: "recAddress",
                     type: 'select',
-                    disabled: true,
+                    disabled: false,
                     props: {
                         label: 'address',
-                        value: 'id'
+                        value: 'address'
                     },
                     dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
                 }, {
@@ -451,7 +457,7 @@ export default {
                         required: true,
                         message: " ",
                         trigger: "blur"
-                    },{
+                    }, {
                         validator: (rule, value, callback) => {
                             if (value < 0) {
                                 callback(new Error("数量不能小于0"));
@@ -460,7 +466,7 @@ export default {
                             }
                         },
                         trigger: "blur"
-                }]
+                    }]
                 },
                 {
                     label: '价格',
@@ -472,7 +478,7 @@ export default {
                         required: true,
                         message: " ",
                         trigger: "blur"
-                    },{
+                    }, {
                         validator: (rule, value, callback) => {
                             if (value < 0) {
                                 callback(new Error("价格不能小于0"));
@@ -481,15 +487,15 @@ export default {
                             }
                         },
                         trigger: "blur"
-                }]
-                }, 
+                    }]
+                },
                 {
                     label: '库存',
                     prop: 'inventory',
                     overHidden: true,
                     hide: true,
                     width: 100
-                },{
+                }, {
                     label: '批次号',
                     prop: 'dot',
                     type: "select",
@@ -621,7 +627,7 @@ export default {
                 align: 'center',
                 index: true,
                 addBtnText: "录入明细",
-                menu:false,
+                menu: false,
                 refreshBtn: false,
                 dialogDrag: true,
                 addBtn: false,
@@ -651,7 +657,7 @@ export default {
             optionOutboundRecordsBack: {
                 align: 'center',
                 index: true,
-                menu:false,
+                menu: false,
                 addBtnText: "录入明细",
                 refreshBtn: false,
                 dialogDrag: true,
@@ -696,7 +702,7 @@ export default {
         //         }
         this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
             if (this.formContacts.goodsId !== value) {
-                goodsDetail({ id: value, customId: this.dicUrlWithCustomId }).then(res => {
+                goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
                     this.formContacts.goodsNo = res.data.data.code
                     this.formContacts.brandId = res.data.data.brandId
                     this.formContacts.inventory = res.data.data.inventory
@@ -729,7 +735,7 @@ export default {
         this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
 
             if (this.formContacts.goodsId !== value) {
-                goodsDetail({ id: value }).then(res => {
+                goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
                     this.formContacts.goodsNo = res.data.data.code
                     this.formContacts.brandId = res.data.data.brandId
                     this.formContacts.inventory = res.data.data.inventory
@@ -764,6 +770,8 @@ export default {
             this.$set(this.optionContactsBack, 'disabled', true)
             this.isContacts = true
             this.isDisabled = true
+            //添加删除按钮禁用
+            this.isAdd = true
             this.refresh(this.onLoad.id, true)
         } else if (this.onLoad.id) {
             console.log(2);
@@ -783,7 +791,10 @@ export default {
             this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
         }
         if (!this.detailData.id) {
+            this.editButton = false
             this.isAddBtn = false
+            this.isDisabledTask = false;
+            this.viewDisabled = false;
             this.form.businessSource = '内部销售'
         }
         if (this.detailData.check) {
@@ -794,18 +805,25 @@ export default {
 
     watch: {
         dicUrlWithCustomId() {
+            console.log(this.form);
             // this.findObject(this.optionContactsBack.column, "goodsId").dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=0`
-            goodsListXs(this.dicUrlWithCustomId).then(res => {
+            goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
                 this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
             })
 
         },
+        'form.storageId'(newStorageId, oldStorageId) {
+            goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
+                this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
+            })
+        },
         $route(to, from) {
             if (this.onLoad.id && this.detailData.id) {
                 this.$set(this.optionForm, 'disabled', true)
                 this.$set(this.optionContactsBack, 'disabled', true)
                 this.isContacts = true
                 this.isDisabled = true
+                this.isAdd = true
                 this.refresh(this.onLoad.id, true)
             } else if (this.onLoad.id) {
                 console.log(2);
@@ -843,13 +861,25 @@ export default {
             }).then(res => {
                 this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
             })
-            goodsListXs(this.dicUrlWithCustomId).then(res => {
+            goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
                 this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
             })
         },
         //表头编辑
         confirmEditing() {
+            goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
+                this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
+            })
             this.isAddBtn = false
+            if (this.form.status == '已取消' || this.form.status == '已退款' || this.form.status == '已发货') {
+                return
+                // this.$message.error('当前状态不允许编辑')
+                // this.optionForm.column.forEach(item=>{
+                //     if(item.prop= 'contacts'){
+                //         item.disabled = true
+                //     }
+                // })
+            }
             if (this.form.status == '已取消' || this.form.status == '退款请核') {
                 this.isAddBtn = true
                 // this.$message.error('当前状态不允许编辑')
@@ -869,7 +899,13 @@ export default {
             this.$set(this.optionForm, 'disabled', false)
             this.$set(this.optionContactsBack, 'disabled', false)
             this.isDisabled = false
+            this.isAdd = false
             if (this.form.businessSource == "外部销售") {
+                if(this.form.status == '待发货'){
+                    this.isSaveBtn = false;
+                    this.isDisabledTask = false;
+                    this.viewDisabled = false;
+                }
                 if (this.form.status == '待确认') {
                     const loadings = this.$loading({
                         lock: true,
@@ -878,6 +914,9 @@ export default {
                         background: 'rgba(255,255,255,0.7)'
                     });
                     console.log('外部销售');
+                    this.isSaveBtn = false;
+                    this.isDisabledTask = false;
+                    this.viewDisabled = false;
                     this.optionForm.column.forEach(its => {
                         if (its.prop == 'customerId') {
                             this.$set(its, 'disabled', true)
@@ -885,6 +924,7 @@ export default {
                     })
                     //不能录入不能删除
                     this.isDisabled = true
+                    this.isAdd = false
                     this.$set(this.form, 'shipType', '物流')
                     this.$set(this.form, 'receivableType', '网络支付')
                     this.optionContactsBack.column.forEach(item => {
@@ -903,6 +943,9 @@ export default {
                     });
                     this.isAddBtn = true
                     this.isDisabled = true
+                    this.isSaveBtn = false;
+                    this.isDisabledTask = false;
+                    this.viewDisabled = false;
                     this.optionForm.column.forEach(its => {
                         if (its.prop != 'remarks') {
                             its.disabled = true
@@ -950,7 +993,9 @@ export default {
                     })
                     loading.close()
                 } else if (this.form.status == '录入') {
-
+                    this.isSaveBtn = false;
+                    this.isDisabledTask = false;
+                    this.viewDisabled = false;
                     // this.$set(this.optionForm, 'disabled', false)
                     // this.$set(this.optionContactsBack, 'disabled', false)
                     this.$set(this.optionForm, 'disabled', false)
@@ -964,7 +1009,10 @@ export default {
                     loading.close()
 
                 } else if (this.form.status == '待确认') {
-                    this.isDisabled = true
+                    this.isSaveBtn = false;
+                    this.isDisabledTask = false;
+                    this.viewDisabled = false;
+                    // this.isDisabled = true
                     console.log('待确认');
                     this.optionForm.column.forEach(item => {
                         if (item.label === '仓库' || item.label === '备注' || item.label === '配送方式' || item.label === '物流公司') {
@@ -983,6 +1031,11 @@ export default {
                     })
                     loading.close()
                 }
+                if(this.form.status == '待发货'){
+                    this.isSaveBtn = false;
+                    this.isDisabledTask = false;
+                    this.viewDisabled = false;
+                }
                 // this.$set(this.form, 'shipType', '物流')
                 // this.$set(this.form, 'receivableType', '现金')
                 // this.optionContactsBack.column.forEach(item => {
@@ -1030,7 +1083,9 @@ export default {
                                 //     items.goodsName = goodsName
 
                                 // })
+                                this.save()
                                 generateShipTask(this.form).then(res => {
+                                    console.log(2);
                                     console.log(res.data);
                                     this.refresh(res.data.data.id, true)
                                     this.isContacts = true
@@ -1039,6 +1094,7 @@ export default {
                                     // 将按钮颜色更改为对应的颜色
                                     this.buttonColor = 'warning'; // 比如改为warning
                                     this.$message.success("生成出库任务成功");
+                                    this.isApplySettlement = false
                                     loading.close();
                                 }).finally(() => {
                                     loading.close();
@@ -1076,7 +1132,17 @@ export default {
                                 this.buttonColor = 'success';
                                 this.$message.success("撤销出库成功");
                                 this.refresh(res.data.data.id)
+                                this.isApplySettlement = false
                                 loading.close();
+                            }).catch((err) => {
+                                console.log(err);
+                                if (err instanceof TooManyResultsException) {
+                                    // 不显示错误消息
+                                    return;
+                                }
+                                // 显示其他错误消息
+                                this.$message.error('发生错误,请稍后重试');
+
                             }).finally(() => {
                                 loading.close();
                             });
@@ -1126,6 +1192,34 @@ export default {
                         this.$message.success("保存成功");
                         this.refresh(res.data.data.id)
                         this.isDisabledTask = false
+                        this.editButton = true
+                        loading.close();
+                    }).finally(() => {
+                        loading.close();
+                    });
+                } else {
+                    return false;
+                }
+            });
+        },
+        //保存
+        save() {
+            this.$refs["form"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    submit({
+                        bsType: "XS",
+                        ...this.form
+                    }).then(res => {
+                        console.log(1);
+                        this.refresh(res.data.data.id)
+                        this.isDisabledTask = false
                         loading.close();
                     }).finally(() => {
                         loading.close();
@@ -1149,11 +1243,27 @@ export default {
                 getList(1, 50, ordForm).then((res) => {
                     this.dataList = res.data.data.records ? res.data.data.records : [];
                 })
-                if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款') {
+                if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
                     console.log(1);
                     this.isApplySettlement = false;
                 }
-
+                if (
+                    this.form.status === '已退款' ||
+                    this.form.status === '已收货' ||
+                    this.form.status === '已发货' ||
+                    this.form.status === '已取消'
+                ) {
+                    // 禁用编辑按钮
+                    console.log('按钮全部禁用');
+                    this.isEditButton = true;
+                    this.isSaveBtn = true;
+                    this.isDisabledTask = true;
+                    this.viewDisabled = true;
+                }else{
+                    this.isSaveBtn = true;
+                    this.isDisabledTask = true;
+                    this.viewDisabled = true;
+                }
                 if (this.form.status == '退款中') {
                     this.isConfirmRefundBtn = false;
                 }
@@ -1161,23 +1271,15 @@ export default {
                     this.isConfirmRefundBtn = true;
                 }
 
-                // if (this.form.status == '退款请核') {
-
-                //     this.isExamineBtn = false;
-                // }
                 if (this.form.generateTask == '已生成') {
                     this.buttonText = '撤销任务';
-                    this.isDisabledTask = false;
+                    // this.isDisabledTask = false;
                     this.buttonColor = 'warning'
-
                 }
-
                 if (this.form.status == '退款请核' || this.form.status == '退款中') {
                     this.isRevocationRequest = false;
                 }
-                if (this.form.status == '已收货' || this.form.status == '已发货') {
-                    this.isDisabledTask = true;
-                }
+
                 //成本、毛利对销售角色隐藏
                 this.optionForm.column.forEach(its => {
                     if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
@@ -1390,7 +1492,7 @@ export default {
         },
         // 新增轮胎
         rowAdd(row) {
-            if(!this.form.customerId){
+            if (!this.form.customerId) {
                 this.$message.error('请选择客户')
                 return
             }

+ 1 - 1
src/views/tirePartsMall/salesManagement/saleOrder/index.vue

@@ -7,7 +7,7 @@
         @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 269)" :page.sync="page">
         <template slot-scope="{type,size,row,index}" slot="menu">
           <!-- <el-button :size="size" :type="type" @click="check(row)">查看</el-button> -->
-          <el-button :size="size" :type="type" :disabled="row.status != '录入' || row.item>=1" @click="$refs.crud.rowDel(row, index)">删除</el-button>
+          <el-button :size="size" :type="type" :disabled="row.status != '录入' && row.status != '待确认' && row.item>=1 " @click="$refs.crud.rowDel(row, index)">删除</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>