孤鹤 2 years ago
parent
commit
6c509f7b38

+ 328 - 315
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -3,14 +3,15 @@
     <basic-container>
       <el-row>
         <el-col :span="4">
-          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
+          <avue-tree ref="treeRef" :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
             @save="corpTypeVisible = true">
           </avue-tree>
         </el-col>
         <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" @selection-change="selectionChange" :before-open="beforeOpen"
-            @row-update="rowUpdate" @search-change="searchChange" @refresh-change="refreshChange" @row-del="rowDel"
+            @row-update="rowUpdate" @search-change="searchChange" @search-reset="resetChange"
+            @refresh-change="refreshChange" @row-del="rowDel"
             @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 273)"
             @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 273)" :page.sync="page">
             <template slot="filesListForm">
@@ -23,9 +24,11 @@
               <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" :disabled="row.upAndDownShelves" @click="$refs.crud.rowEdit(row, index)">编辑
+              <el-button :size="size" :type="type" :disabled="row.upAndDownShelves"
+                @click="$refs.crud.rowEdit(row, index)">编辑
               </el-button>
-              <el-button :size="size" :type="type" :disabled="row.upAndDownShelves" @click="$refs.crud.rowDel(row, index)">删除
+              <el-button :size="size" :type="type" :disabled="row.upAndDownShelves"
+                @click="$refs.crud.rowDel(row, index)">删除
               </el-button>
               <el-tooltip :content="`${row.upAndDownShelves == 0 ? '上架' : '下架'}`" placement="top">
                 <el-switch style="margin-left: 10px" v-model="row.upAndDownShelves" @change="check(row)" :active-value="1"
@@ -74,7 +77,7 @@
               </template> -->
               <template slot="priceOne" slot-scope="{row}">
                 <el-input-number v-model="row.priceOne" size="small" :controls="false" :precision="0"
-                   style="width: 100%" />
+                  style="width: 100%" />
               </template>
               <template slot="priceTwo" slot-scope="{ row }">
                 <el-input v-model="row.priceTwo" size="small"></el-input>
@@ -90,7 +93,7 @@
               </template>
               <template slot="sharedCompany" slot-scope="{ row, index }">
                 <span style="display:flex">
-                  <el-select v-model="row.sharedCompany" multiple  placeholder="请选择" size="small" filterable
+                  <el-select v-model="row.sharedCompany" multiple placeholder="请选择" size="small" filterable
                     style="width:60%">
                     <el-option v-for="item in sharedCompanyoptions" :key="item.id" :label="item.fullName"
                       :value="item.id">
@@ -155,6 +158,7 @@ export default {
       sharedCompanyoptions: [],
       activeName: 'searchList',
       dialogVisibles: false,
+      selectedNodes: [],// 存储选择节点的数组
       tableData: [],
       //上架列表
       goodsListShow: [],
@@ -385,338 +389,347 @@ export default {
       done();
     },
     nodeClick(data) {
+      console.log(data);
       this.search.brandId = data.id
       this.page.currentPage = 1;
       this.onLoad(this.page, this.search);
-    },
-    //刷新
-    refreshChange() {
-      this.onLoad(this.page, this.search)
-    },
-    //刷新触发
-    refreshChangeCost() {
-      // this.treeDeptId = ''
-      this.page.currentPage = 1;
-      this.onLoad(this.page);
-    },
-    searchChange(params, done) {
-      console.log(params);
-      console.log(params.$salesCompanyName);
-      // sharedCompanyList
-      this.search.sharedCompanyList = params.sharedCompany;
-      Vue.delete(params, 'sharedCompany');
-      Vue.delete(this.search, 'sharedCompany');
-      done();
-      this.onLoad(this.page, params)
-    },
-    selectionChange(list) {
-      this.selectionList = list
-    },
-    selectionChangeCost(list) {
-      this.goodsListSave = list
-      console.log(list);
-      this.tableData = list
-    },
-    //新增
-    commoditySelection() {
-      this.dialogVisibles = !this.dialogVisibles
-      this.tableData = []
-      this.goodsListSave = [];
-    },
-    //打开表单前
-    beforeOpen(done, type) {
-      // 查看和编辑逻辑
-      if (['view', 'edit'].includes(type)) {
-        getDetail({ id: this.form.id }).then(res => {
-          this.form = res.data.data
-          done();
-        })
-      }
-    },
-    // 标签页切换
-    tabHandle(data) {
-      console.log(data);
-      if (data.name == 'searchList') {
-        this.goodsListShow = this.data;
-        this.page.total = this.pageList.total
-      } else if (data.name == 'importStaging') {
-        this.goodsListShow = this.goodsListSave;
-        this.page.total = 0
-      }
-    },
-    removeStagList(row, index, type) {
-      if (type === 'policy') {
-        this.goodsListPolicy.splice(row.$index, 1)
-        if (this.goodsListPolicy.length == 0) {
-          this.customerBuyFree.selection = true
-          this.optionPolicy.selection = true
-          this.$set(this.customerBuyFree, 'menu', true)
-        }
-      } else if (type === 'policy_buyAndGive') {
-        this.buyAndGiveList.splice(row.$index, 1)
-        if (this.buyAndGiveList.length == 0) {
-          this.customerBuyFree.selection = true
-          this.optionPolicy.selection = true
-          this.$set(this.optionPolicy, 'menu', true)
-        }
-      } else {
-        this.goodsListSave.splice(row.$index, 1)
-      }
-    },
-    rowDel(row, index) {
-      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then((res) => {
-          this.$message({
-            type: 'success',
-            message: '删除成功!'
-          });
-          this.dataList.splice(index, 1);
-          this.onLoad(this.page)
-        })
+  },
+  //刷新
+  refreshChange() {
+    this.onLoad(this.page, this.search)
+  },
+  //刷新触发
+  refreshChangeCost() {
+    // this.treeDeptId = ''
+    this.page.currentPage = 1;
+    this.onLoad(this.page);
+  },
+  searchChange(params, done) {
+    console.log(params);
+    console.log(params.$salesCompanyName);
+    // sharedCompanyList
+    this.search.sharedCompanyList = params.sharedCompany;
+    Vue.delete(params, 'sharedCompany');
+    Vue.delete(this.search, 'sharedCompany');
+    done();
+    this.onLoad(this.page, params)
+  },
+  selectionChange(list) {
+    this.selectionList = list
+  },
+  selectionChangeCost(list) {
+    this.goodsListSave = list
+    console.log(list);
+    this.tableData = list
+  },
+  //新增
+  commoditySelection() {
+    this.dialogVisibles = !this.dialogVisibles
+    this.tableData = []
+    this.goodsListSave = [];
+  },
+  //打开表单前
+  beforeOpen(done, type) {
+    // 查看和编辑逻辑
+    if (['view', 'edit'].includes(type)) {
+      getDetail({ id: this.form.id }).then(res => {
+        this.form = res.data.data
+        done();
       })
-    },
-    //编辑确定
-    rowUpdate(form, index, done, loading) {
-      if (this.form.filesList.length > 0) {
-        let flag = this.form.filesList.some(item => {
-          return item.$version == '主图'
-        })
-        if (!flag) {
-          this.$message.warning('请选择主图')
-          done()
-          return
-        }
+    }
+  },
+  // 标签页切换
+  tabHandle(data) {
+    console.log(data);
+    if (data.name == 'searchList') {
+      this.goodsListShow = this.data;
+      this.page.total = this.pageList.total
+    } else if (data.name == 'importStaging') {
+      this.goodsListShow = this.goodsListSave;
+      this.page.total = 0
+    }
+  },
+  removeStagList(row, index, type) {
+    if (type === 'policy') {
+      this.goodsListPolicy.splice(row.$index, 1)
+      if (this.goodsListPolicy.length == 0) {
+        this.customerBuyFree.selection = true
+        this.optionPolicy.selection = true
+        this.$set(this.customerBuyFree, 'menu', true)
       }
-      submit({
-        ...this.form
-      }).then(res => {
-        this.$message.success("修改成功")
-        this.onLoad(this.page, this.search)
-        done()
-      }).catch((err) => {
-        loading()
+    } else if (type === 'policy_buyAndGive') {
+      this.buyAndGiveList.splice(row.$index, 1)
+      if (this.buyAndGiveList.length == 0) {
+        this.customerBuyFree.selection = true
+        this.optionPolicy.selection = true
+        this.$set(this.optionPolicy, 'menu', true)
+      }
+    } else {
+      this.goodsListSave.splice(row.$index, 1)
+    }
+  },
+  rowDel(row, index) {
+    this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning'
+    }).then(() => {
+      remove(row.id).then((res) => {
+        this.$message({
+          type: 'success',
+          message: '删除成功!'
+        });
+        this.dataList.splice(index, 1);
+        this.onLoad(this.page)
       })
-      // submit({
-      //   ...form
-      // }).then(res => {
-      //   this.onLoad(this.page, this.search)
-      //   done()
-      // }).catch(() => {
-      //   loading()
-      // })
-    },
-    check(row) {
-      batchOperationProductLaunch({
-        flag: row.upAndDownShelves,
-        ids: row.id
-      }).then(res => {
-        this.onLoad(this.page, this.search)
+    })
+  },
+  //编辑确定
+  rowUpdate(form, index, done, loading) {
+    if (this.form.filesList.length > 0) {
+      let flag = this.form.filesList.some(item => {
+        return item.$version == '主图'
       })
-    },
-    // 确认导入
-    importGoods() {
-      console.log(this.goodsListSave);
-      if(!this.goodsListSave.length){
-        this.$message.error('请选择')
+      if (!flag) {
+        this.$message.warning('请选择主图')
+        done()
+        return
       }
-      if (this.goodsListSave.some(item => item.priceOne==undefined || item.priceTwo==undefined || item.priceThree==undefined || item.priceFour==undefined)) {
-        this.$message.error('请填写所有售价');
-      }else{
-        if (this.goodsListSave.length > 0) {
+    }
+    submit({
+      ...this.form
+    }).then(res => {
+      this.$message.success("修改成功")
+      this.onLoad(this.page, this.search)
+      done()
+    }).catch((err) => {
+      loading()
+    })
+    // submit({
+    //   ...form
+    // }).then(res => {
+    //   this.onLoad(this.page, this.search)
+    //   done()
+    // }).catch(() => {
+    //   loading()
+    // })
+  },
+  resetChange() {
+    if(document.getElementsByClassName("is-current")[0]){
+      let selected = document.getElementsByClassName("is-current")[0]
+      selected.classList.remove("is-current")
+    }
+    console.log(213213);
+    console.log(this.$refs.treeRef);
+  },
+  check(row) {
+    batchOperationProductLaunch({
+      flag: row.upAndDownShelves,
+      ids: row.id
+    }).then(res => {
+      this.onLoad(this.page, this.search)
+    })
+  },
+  // 确认导入
+  importGoods() {
+    console.log(this.goodsListSave);
+    if (!this.goodsListSave.length) {
+      this.$message.error('请选择')
+    }
+    if (this.goodsListSave.some(item => item.priceOne == undefined || item.priceTwo == undefined || item.priceThree == undefined || item.priceFour == undefined)) {
+      this.$message.error('请填写所有售价');
+    } else {
+      if (this.goodsListSave.length > 0) {
         this.goodsListSaveHandle()
       }
-      }
-     
-    },
-    goodsListSaveHandle() {
-      this.goodsListSave.forEach(item => {
-        item.sharedCompany?item.sharedCompany.join(','):''
-        this.goodsListSave.specificationAndModel = item.typeno
-        delete this.goodsListSave.typeno
-      })
+    }
 
-      console.log(this.goodsListSave);
-      productLaunch(this.goodsListSave).then(res => {
-        console.log(res);
-        this.dialogVisibles = !this.dialogVisibles
+  },
+  goodsListSaveHandle() {
+    this.goodsListSave.forEach(item => {
+      item.sharedCompany ? item.sharedCompany.join(',') : ''
+      this.goodsListSave.specificationAndModel = item.typeno
+      delete this.goodsListSave.typeno
+    })
 
-      })
-    },
-    //导入商品触发
-    importChoice() {
-      console.log(1);
-      return
-      // this.contactsData = this.contactsData.concat(this.tableData)
-      if (this.tableData.length === 1) {
-        this.goodsShowData[this.choiceIndexT].cname = this.tableData[0].cname
-        this.goodsShowData[this.choiceIndexT].code = this.tableData[0].code
-        this.goodsShowData[this.choiceIndexT].typeno = this.tableData[0].typeno
-        this.goodsShowData[this.choiceIndexT].itemType = this.tableData[0].typeno
-        this.goodsShowData[this.choiceIndexT].itemId = this.tableData[0].id
-        this.goodsShowData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
-        this.goodsShowData[this.choiceIndexT].integralMultiples = this.tableData[0].integralMultiples
-        this.goodsShowData[this.choiceIndexT].corpId = this.tableData[0].corpId
-        this.goodsShowData[this.choiceIndexT].corpName = this.tableData[0].corpName
-        this.quantityChange(this.goodsShowData[this.choiceIndexT])
-        selectGoodsNum({
-          goodsId: this.tableData[0].id,
-          itemType: this.tableData[0].typeno,
-          tradeType: 'GN',
-          warehouseId: this.form.storageId
-        }).then(res => {
-          if (res.data.data.length > 0) {
-            this.goodsShowData[this.choiceIndexT].storageQuantityList = res.data.data
-            this.goodsShowData[this.choiceIndexT].storageId = res.data.data[0].storageId
-            this.goodsShowData[this.choiceIndexT].storageName = res.data.data[0].storageName
-            this.goodsShowData[this.choiceIndexT].storageQuantity = res.data.data[0].surplusRouteQuantity
-            if (res.data.data[0].tenantId !== "681169") {
-              this.goodsShowData[this.choiceIndexT].purchaseAmount = res.data.data[0].stockPrice
-            }
+    console.log(this.goodsListSave);
+    productLaunch(this.goodsListSave).then(res => {
+      console.log(res);
+      this.dialogVisibles = !this.dialogVisibles
+
+    })
+  },
+  //导入商品触发
+  importChoice() {
+    console.log(1);
+    return
+    // this.contactsData = this.contactsData.concat(this.tableData)
+    if (this.tableData.length === 1) {
+      this.goodsShowData[this.choiceIndexT].cname = this.tableData[0].cname
+      this.goodsShowData[this.choiceIndexT].code = this.tableData[0].code
+      this.goodsShowData[this.choiceIndexT].typeno = this.tableData[0].typeno
+      this.goodsShowData[this.choiceIndexT].itemType = this.tableData[0].typeno
+      this.goodsShowData[this.choiceIndexT].itemId = this.tableData[0].id
+      this.goodsShowData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
+      this.goodsShowData[this.choiceIndexT].integralMultiples = this.tableData[0].integralMultiples
+      this.goodsShowData[this.choiceIndexT].corpId = this.tableData[0].corpId
+      this.goodsShowData[this.choiceIndexT].corpName = this.tableData[0].corpName
+      this.quantityChange(this.goodsShowData[this.choiceIndexT])
+      selectGoodsNum({
+        goodsId: this.tableData[0].id,
+        itemType: this.tableData[0].typeno,
+        tradeType: 'GN',
+        warehouseId: this.form.storageId
+      }).then(res => {
+        if (res.data.data.length > 0) {
+          this.goodsShowData[this.choiceIndexT].storageQuantityList = res.data.data
+          this.goodsShowData[this.choiceIndexT].storageId = res.data.data[0].storageId
+          this.goodsShowData[this.choiceIndexT].storageName = res.data.data[0].storageName
+          this.goodsShowData[this.choiceIndexT].storageQuantity = res.data.data[0].surplusRouteQuantity
+          if (res.data.data[0].tenantId !== "681169") {
+            this.goodsShowData[this.choiceIndexT].purchaseAmount = res.data.data[0].stockPrice
           }
-        })
-      }
-      this.dialogVisible = !this.dialogVisible
-      this.commodityData = false
-    },
-    importStagList(row, index, type) {
-      if (type === 'policy') {
-        this.goodsListPolicy.push(row);
-        if (this.goodsListPolicy.length > 0) {
-          this.customerBuyFree.selection = false
-          this.optionPolicy.selection = true
-          this.$set(this.customerBuyFree, 'menu', false)
         }
-      } else if (type === 'policy_buyAndGive') {
-        this.buyAndGiveList.push(row);
-        if (this.buyAndGiveList.length > 0) {
-          this.customerBuyFree.selection = true
-          this.optionPolicy.selection = false
-          this.$set(this.optionPolicy, 'menu', false)
-        }
-      } else {
-        this.goodsListSave.push(row);
+      })
+    }
+    this.dialogVisible = !this.dialogVisible
+    this.commodityData = false
+  },
+  importStagList(row, index, type) {
+    if (type === 'policy') {
+      this.goodsListPolicy.push(row);
+      if (this.goodsListPolicy.length > 0) {
+        this.customerBuyFree.selection = false
+        this.optionPolicy.selection = true
+        this.$set(this.customerBuyFree, 'menu', false)
       }
-    },
-    change(row, type) {
-      let data = []
-      for (let item of this.selectionList) {
-        data.push(item.id)
+    } else if (type === 'policy_buyAndGive') {
+      this.buyAndGiveList.push(row);
+      if (this.buyAndGiveList.length > 0) {
+        this.customerBuyFree.selection = true
+        this.optionPolicy.selection = false
+        this.$set(this.optionPolicy, 'menu', false)
       }
-      if (type === "up") {
-        // for (let item of this.selectionList) {
-        //   if (!Number(item.salesPrice)) return this.$message.error("上架失败,商城价格不能为0")
-        // }
-        this.$confirm('是否确认全部上架?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          batchOperationProductLaunch({
-            flag: 1,
-            ids: data.join(",")
-          }).then(res => {
-            this.onLoad(this.page, this.search)
-          })
+    } else {
+      this.goodsListSave.push(row);
+    }
+  },
+  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")
+      // }
+      this.$confirm('是否确认全部上架?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        batchOperationProductLaunch({
+          flag: 1,
+          ids: data.join(",")
+        }).then(res => {
+          this.onLoad(this.page, this.search)
         })
-      } else if (type === "down") {
-        this.$confirm('是否确认全部下架?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          batchOperationProductLaunch({
-            flag: 0,
-            ids: data.join(",")
-          }).then(res => {
-            this.onLoad(this.page, this.search)
-          })
+      })
+    } else if (type === "down") {
+      this.$confirm('是否确认全部下架?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        batchOperationProductLaunch({
+          flag: 0,
+          ids: data.join(",")
+        }).then(res => {
+          this.onLoad(this.page, this.search)
         })
-      }
-    },
-    //新增搜索
-    goodsSearchCost(params, done) {
-      this.treeDeptId = ''
-      console.log(params);
-      params = {
-        ...params,
-        // artsVision: this.form.belongToCorpId
-      }
-      this.onLoad(this.page, params);
-      done()
-    },
-    onLoad(page, params = {}) {
-      console.log(this.search);
-      console.log(params);
-      this.search.cname = params.cname
-      params = {
-        ...params,
-        current: page.currentPage,
-        size: page.pageSize,
-        ...Object.assign(params, this.search),
-        billType: 0
-      }
-      this.loading = true
-      getList(params).then(res => {
-        this.dataList = res.data.data.records
-        this.page.total = res.data.data.total
-        this.pageList.total = res.data.data.total
-        this.$nextTick(() => {
-          this.$refs.crud.doLayout();
-        });
-        this.loading = false
-      }).finally(() => {
-        this.loading = false
       })
-      this.loading = true
+    }
+  },
+  //新增搜索
+  goodsSearchCost(params, done) {
+    this.treeDeptId = ''
+    console.log(params);
+    params = {
+      ...params,
+      // artsVision: this.form.belongToCorpId
+    }
+    this.onLoad(this.page, params);
+    done()
+  },
+  onLoad(page, params = {}) {
+    console.log(this.search);
+    console.log(params);
+    this.search.cname = params.cname
+    params = {
+      ...params,
+      current: page.currentPage,
+      size: page.pageSize,
+      ...Object.assign(params, this.search),
+      billType: 0
+    }
+    this.loading = true
+    getList(params).then(res => {
+      this.dataList = res.data.data.records
+      this.page.total = res.data.data.total
+      this.pageList.total = res.data.data.total
+      this.$nextTick(() => {
+        this.$refs.crud.doLayout();
+      });
+      this.loading = false
+    }).finally(() => {
+      this.loading = false
+    })
+    this.loading = true
 
-      groundingList(params).then(res => {
-        this.goodsListShow = res.data.data.records
-        this.data = res.data.data.records;
-        this.page.total = res.data.data.total
-        this.loading = false
-      }).finally(() => {
-        this.loading = false
-      })
-      deptList().then(res => {
-        console.log(res);
-        this.sharedCompanyoptions = res.data.data
-      })
-    },
-    //自定义列保存
-    async saveColumnTwo(ref, option, optionBack, code) {
-      /**
-       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-       */
-      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
-      if (inSave) {
-        this.$message.success("保存成功");
-        //关闭窗口
-        this.$nextTick(() => {
-          this.$refs.crud.doLayout();
-        });
-        this.$refs[ref].$refs.dialogColumn.columnBox = false;
-      }
-    },
-    //自定义列重置
-    async resetColumnTwo(ref, option, optionBack, code) {
-      this[option] = this[optionBack];
-      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
-      if (inSave) {
-        this.$message.success("重置成功");
-        this.$refs[ref].$refs.dialogColumn.columnBox = false;
-        this.$nextTick(() => {
-          this.$refs.crud.doLayout();
-        });
-      }
+    groundingList(params).then(res => {
+      this.goodsListShow = res.data.data.records
+      this.data = res.data.data.records;
+      this.page.total = res.data.data.total
+      this.loading = false
+    }).finally(() => {
+      this.loading = false
+    })
+    deptList().then(res => {
+      console.log(res);
+      this.sharedCompanyoptions = res.data.data
+    })
+  },
+  //自定义列保存
+  async saveColumnTwo(ref, option, optionBack, code) {
+    /**
+     * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+     * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+     * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+     */
+    const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+    if (inSave) {
+      this.$message.success("保存成功");
+      //关闭窗口
+      this.$nextTick(() => {
+        this.$refs.crud.doLayout();
+      });
+      this.$refs[ref].$refs.dialogColumn.columnBox = false;
+    }
+  },
+  //自定义列重置
+  async resetColumnTwo(ref, option, optionBack, code) {
+    this[option] = this[optionBack];
+    const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+    if (inSave) {
+      this.$message.success("重置成功");
+      this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      this.$nextTick(() => {
+        this.$refs.crud.doLayout();
+      });
     }
   }
 }
+}
 </script>
 
 <style scoped></style>

+ 52 - 10
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -7,7 +7,7 @@
                 </el-button>
             </div>
             <div class="add-customer-btn">
-                       <el-button class="el-button&#45;&#45;small-yh" style="margin-right: 10px" type="primary" size="small" v-if="!editButton"
+                       <el-button class="el-button&#45;&#45;small-yh" style="margin-right: 10px" type="primary" size="small" v-if="form.id"
                                   @click="confirmEditing">编辑
                        </el-button>
                 <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.statusName != '已入库'"
@@ -35,7 +35,7 @@
                             <template slot-scope="{type,size,row,index,disabled}" slot="menu">
                                 <el-button :size="size" :disabled="disabled" :type="type"
                                     :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
-                                    @click="$refs.formContacts.rowEdit(row, index)">编辑
+                                    @click="rowEdit(row, index)">编辑
                                 </el-button>
                                 <el-button icon="el-icon-delete" :size="size" :disabled="disabled || form.statusName == '已入库'" :type="type"
                                     @click="rowDelBox(row, index)">删除
@@ -43,7 +43,7 @@
                             </template>
                             <template slot-scope="{scope,row}" slot="menuLeft">
                                 <el-button type="primary" icon="el-icon-plus" size="small" 
-                                    @click="rowAdd(row)" :disabled="isrowAdd">添加轮胎</el-button>
+                                    @click="rowAdd(row,score)" :disabled="isrowAdd">添加轮胎</el-button>
                                 <el-button type="success" size="small" icon="el-icon-bottom" @click="excelBox = true">导入
                                 </el-button>
                                 <el-button type="primary" icon="el-icon-printer" size="small"
@@ -499,8 +499,38 @@ export default {
     },
 
     async created() {
+        this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
+            console.log(value);
+            console.log('this.formContacts.goodsId',this.formContacts.goodsId);
+            if (this.formContacts.goodsId !== value) {
+                goodsDetail({ id: value }).then(res => {
+                    this.formContacts.goodsNo = res.data.data.code
+                    this.formContacts.brandId = res.data.data.brandId
+                    this.formContacts.brandName = res.data.data.brandName
+                    
+                    this.formContacts.propertyName = res.data.data.specificationAndModel
+                    this.formContacts.pattern = res.data.data.brandItem
+                    this.formContacts.goodsDescription = res.data.data.goodsDescription
+                    this.formContacts.units = res.data.data.unit
+                    this.findObject(this.optionContacts.column, "goodsNum").disabled = true
+                    if (res.data.data.whether == 0) {
+                        this.findObject(this.optionContacts.column, "dot").disabled = true
+                    } else {
+                        this.findObject(this.optionContacts.column, "dot").disabled = false
+                        dotList({
+                            storageId: this.form.storageId,
+                            goodsId: this.formContacts.goodsId
+                        }).then(res => {
+                            this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
+                        })
+                    }
+                })
+            }
+        }
         this.optionContacts = await this.getColumnData(this.getColumnName(274.1), this.optionContactsBack);
         this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
+            console.log(value);
+            console.log('this.formContacts.goodsId',this.formContacts.goodsId);
             if (this.formContacts.goodsId !== value) {
                 goodsDetail({ id: value }).then(res => {
                     this.formContacts.goodsNo = res.data.data.code
@@ -533,14 +563,21 @@ export default {
             this.refresh(this.onLoad.id, true)
             this.$set(this.optionForm,'disabled',true)
             this.$set(this.optionContactsBack,'disabled',true)
-            console.log(this.$refs.formContacts);
-
         } else if (this.onLoad.id) {
             console.log(2);
             this.refresh(this.onLoad.id, true)
         }
         if(!this.onLoad.id){
+            console.log(3);
             this.isrowAdd= false
+            // this.$set(this.optionForm,'disabled',false)
+            // this.$set(this.optionContacts,'disabled',false)
+        }
+        if (!this.form.id) {
+            console.log('这是一还是二');
+            // this.$set(this.optionContactsBack, "addBtn", false)
+            this['optionContacts'] = this['optionContactsBack'];
+            this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
         }
     },
     components: {
@@ -548,13 +585,13 @@ export default {
     },
 
     methods: {
-        rowAdd(row){
+        rowAdd(row,score){
+            console.log(123214);
             this.optionContactsBack.column.forEach(its => {
                 if (its.prop == 'goodsNum') {
                     this.$set(its,'disabled',true)
                 } else {
                     this.$set(its,'disabled',false)
-
                 }
             })
             this.$refs.formContacts.rowAdd()
@@ -615,15 +652,14 @@ export default {
 
                     }
                 })
-                this.optionContactsBack.column.forEach(item=>{
+                this.optionContacts.column.forEach(item=>{
                     if(item.prop == 'remarks'){
                         this.$set(item,'disabled',false)
                     }else{
                         this.$set(item,'disabled',true)
-
                     }
                 })
-            }else{
+            }else if(this.form.statusName == '已入库'){
                 this.$set(this.optionForm,'disabled',false)
                 this.$set(this.optionContactsBack,'disabled',false)
                 this.optionForm.column.forEach(item=>{
@@ -710,6 +746,12 @@ export default {
                 loading.close();
             })
         },
+        //编辑
+        rowEdit(row,index){
+            console.log(row,index);
+            this.confirmEditing()
+            this.$refs.formContacts.rowEdit(row,index)
+        },
         rowDelBox(row, index) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",

+ 22 - 10
src/views/tirePartsMall/salesManagement/outboundTask/index.vue

@@ -140,12 +140,19 @@ export default {
           },
           dicUrl: '/api/blade-sales-part/storageDesc/listAll',
         },
-        //  {
-        //   label: '库管',
-        //   prop: "bsType",
-        //   width: 100,
-        //   overHidden: true,
-        // },  
+         {
+          label: '库管',
+          prop: "stockClerkId",
+          width: 100,
+          cell:false,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'realName',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-user/stockClerkList',
+        },  
         {
           label: '收货地址',
           prop: "recAddress",
@@ -221,9 +228,9 @@ export default {
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
     }
+    this.option = await this.getColumnData(this.getColumnName(271), this.optionList);
+
     this.option.selectable = (row, index) => {
-      console.log('row.sendTotalNum',row.sendTotalNum);
-      console.log('row.goodsTotalNum',row.goodsTotalNum);
       return Number(row.sendTotalNum) !== Number(row.goodsTotalNum);
     }
 
@@ -284,8 +291,10 @@ export default {
       this.onLoad(this.page, this.search)
     },
     rowCell(row,index){
-      this.findObject(this.option.column, "storageName").cell = true
-      this.findObject(this.optionList.column, "storageName").cell = true
+      // this.findObject(this.option.column, "storageName").cell = true
+      // 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.$refs.crud.rowCell(row, index)
     },
     rowDel(form, index) {
@@ -356,6 +365,9 @@ export default {
         this.$message.success("重置成功");
         this.$refs[ref].$refs.dialogColumn.columnBox = false;
       }
+      this.option.selectable = (row, index) => {
+      return Number(row.sendTotalNum) !== Number(row.goodsTotalNum);
+    }
     }
   }
 }

+ 7 - 4
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -739,7 +739,7 @@ export default {
             console.log(3);
             this.optionContactsBack.column.forEach(its => {
                 if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
-                    its.disabled = false
+                    its.disabled = false 
                 } else {
                     its.disabled = true
                 }
@@ -801,6 +801,7 @@ export default {
     methods: {
         editBtn(row, index) {
             console.log(123);
+            this.confirmEditing()
             this.$refs.formContacts.rowEdit(row, index);
             dotList({
                 storageId: this.form.storageId,
@@ -817,13 +818,12 @@ export default {
             this.isAddBtn = false
             if (this.form.status == '已取消'  || this.form.status == '退款请核') {
                 this.isAddBtn = true
-                this.$message.error('当前状态不允许编辑')
+                // this.$message.error('当前状态不允许编辑')
                 // this.optionForm.column.forEach(item=>{
                 //     if(item.prop= 'contacts'){
                 //         item.disabled = true
                 //     }
                 // })
-                return;
             }
             this.optionContactsBack.column.forEach(its => {
                 if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
@@ -893,7 +893,7 @@ export default {
                     spinner: 'el-icon-loading',
                     background: 'rgba(255,255,255,0.7)'
                 });
-                if (this.form.status == '待发货' || this.form.status == '已发货') {
+                if (this.form.status == '待发货' || this.form.status == '已发货' || this.form.status == '已取消') {
                     const loading = this.$loading({
                         lock: true,
                         text: '加载中',
@@ -1141,6 +1141,9 @@ export default {
                 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('销售')) {