Browse Source

新加单据作废功能

Qukatie 3 days ago
parent
commit
639cc09de1

+ 8 - 0
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -380,4 +380,12 @@ export const selectShipItemRecord = (data) => {
     method: 'get',
     params: data
   })
+}
+// 单据作废
+export const voidedDocument = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/voidedDocument',
+    method: 'get',
+    params: data
+  })
 }

+ 161 - 131
src/views/tirePartsMall/purchaseService/returns/index.vue

@@ -1,15 +1,29 @@
 <template>
   <div>
     <basic-container v-show="!detailsOpen">
-      <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" @row-del="rowDel"
-        @expand-change="expandChange" @refresh-change="refreshChange"
+      <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"
+        @row-del="rowDel"
+        @expand-change="expandChange"
+        @refresh-change="refreshChange"
         @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 351)"
-        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 351)" :page.sync="page">
-        <template slot-scope="{type,size,row,index}" slot="menu">
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 351)"
+        :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.numberRows != 0"
-            @click="$refs.crud.rowDel(row, index)">删除</el-button>
+          <el-button :size="size" :type="type" :disabled="row.status != '录入' || row.numberRows != 0" @click="$refs.crud.rowDel(row, index)"
+            >删除</el-button
+          >
+          <el-button type="text" size="small" :disabled="row.generateTask != '未生成'" @click="voided(row, index)">单据作废</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="GYS" :refresh="false"></crop-select>
@@ -17,28 +31,26 @@
         <template slot="notCompleteSearch">
           <el-checkbox v-model="search.notComplete" true-label="1"></el-checkbox>
         </template>
-        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+        <template slot-scope="{ type, size, row, $index }" slot="menuLeft">
           <!-- <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新建订单</el-button> -->
           <el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>
         </template>
         <template slot-scope="{ row, index }" slot="ordNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }}
-          </span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }} </span>
         </template>
         <template slot-scope="{ row, index }" slot="srcOrdNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }}
-          </span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }} </span>
         </template>
       </avue-crud>
     </basic-container>
-    <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData" @backToList="backToList">
-    </detailsPage>
+    <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData" @backToList="backToList"> </detailsPage>
   </div>
 </template>
 
 <script>
+import { voidedDocument } from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { getList, remove, getGoodsInfo } from "@/api/tirePartsMall/salesService/saleOrder";
-import detailsPage from "./detailsPage"
+import detailsPage from "./detailsPage";
 import { getDetails } from "@/api/tirePartsMall/salesService/saleOrder";
 import { getToken } from "@/util/auth";
 
@@ -77,7 +89,7 @@ export default {
         searchMenuPosition: "right",
         align: "center",
         size: "small",
-        menuWidth: 50,
+        menuWidth: 120,
         searchSpan: 6,
         searchMenuSpan: 6,
         searchIcon: true,
@@ -86,45 +98,49 @@ export default {
         searchIndex: 3,
         highlightCurrentRow: true,
         dialogWidth: "70%",
-        summaryText:this.$t("land118n.total"),
+        summaryText: this.$t("land118n.total"),
         showSummary: true,
-        sumColumnList: [{
-          name: 'goodsTotalNum',
-          type: 'sum',
-          decimals: 0
-        }, {
-          name: 'totalMoney',
-          type: 'sum',
-        }, {
-          name: 'returnsAmount',
-          type: 'sum',
-        }],
+        sumColumnList: [
+          {
+            name: "goodsTotalNum",
+            type: "sum",
+            decimals: 0
+          },
+          {
+            name: "totalMoney",
+            type: "sum"
+          },
+          {
+            name: "returnsAmount",
+            type: "sum"
+          }
+        ],
         column: [
           {
-            label: '业务编号',
+            label: "业务编号",
             prop: "ordNo",
             search: true,
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '往来单位',
+            label: "往来单位",
             prop: "customerName",
             search: true,
             overHidden: true,
-            type: 'select',
+            type: "select",
             filterable: true,
-            width:140,
+            width: 140,
             remote: true,
             props: {
-              label: 'cname',
-              value: 'cname',
-              res: 'data.records'
+              label: "cname",
+              value: "cname",
+              res: "data.records"
             },
-            dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=GYS&cname={{key}}',
+            dicUrl: "/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=GYS&cname={{key}}"
           },
           {
-            label: '显示已完成',
-            prop: 'notComplete',
+            label: "显示已完成",
+            prop: "notComplete",
             overHidden: true,
             hide: true,
             search: true,
@@ -149,71 +165,71 @@ export default {
           //   }]
           // },
           {
-            label: '仓库',
+            label: "仓库",
             prop: "storageName",
             search: true,
             overHidden: true,
             // remote: true,
-            type: 'select',
+            type: "select",
             props: {
-              label: 'cname',
-              value: 'cname'
+              label: "cname",
+              value: "cname"
             },
-            dicUrl: '/api/blade-sales-part/storageDesc/listAll?cname={{key}}',
+            dicUrl: "/api/blade-sales-part/storageDesc/listAll?cname={{key}}"
           },
           {
-            label: '行数',
+            label: "行数",
             prop: "numberRows",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '商品名称',
+            label: "商品名称",
             prop: "goodsNameJoin",
             search: true,
             overHidden: true,
             filterable: true,
             remote: true,
-            type: 'select',
+            type: "select",
             props: {
-              label: 'cname',
-              value: 'cname',
-              res: 'data.records'
+              label: "cname",
+              value: "cname",
+              res: "data.records"
             },
             dicUrl: "/api/blade-sales-part/goodsDesc/list?current=1&size=20&cname={{key}}"
           },
           {
-            label: '数量',
+            label: "数量",
             prop: "goodsTotalNum",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '退货数量',
+            label: "退货数量",
             prop: "returnsNumber",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '金额',
+            label: "金额",
             prop: "totalMoney",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '退货金额',
+            label: "退货金额",
             prop: "returnsAmount",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '采购单号',
+            label: "采购单号",
             prop: "srcNo",
             search: true,
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '状态',
+            label: "状态",
             prop: "status",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '业务日期',
+            label: "业务日期",
             prop: "businesDate",
             searchProp: "businesDateList",
             type: "date",
@@ -250,7 +266,7 @@ export default {
             props: {
               label: "account",
               value: "account",
-              res: 'data.records'
+              res: "data.records"
             }
           },
           {
@@ -264,7 +280,7 @@ export default {
             searchDefaultTime: ["00:00:00", "23:59:59"],
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd HH:mm:ss"
-          },
+          }
           // {
           //   label: "原业务日期",
           //   prop: "oldBusinesDate",
@@ -282,7 +298,7 @@ export default {
           // },
         ]
       }
-    }
+    };
   },
   activated() {
     setTimeout(() => {
@@ -291,7 +307,7 @@ export default {
         this.detailsOpen = true;
       }
       if (this.$route.query.check) {
-        this.editOpen({ id: this.$route.query.check.srcBillId }, 1)
+        this.editOpen({ id: this.$route.query.check.srcBillId }, 1);
         this.$store.commit("CGTH_IN_DETAIL");
         this.detailData = {
           id: this.$route.query.check.billId,
@@ -299,76 +315,88 @@ export default {
           auditId: this.$route.query.check.id
         };
       }
-      if (this.$route.query.type == 'S') {
-        this.editOpen({ id: this.$route.query.detail.srcParentId }, 1)
+      if (this.$route.query.type == "S") {
+        this.editOpen({ id: this.$route.query.detail.srcParentId }, 1);
       }
       if (this.$route.query.jumpId) {
-        this.editOpen({ id: this.$route.query.jumpId }, 1)
+        this.editOpen({ id: this.$route.query.jumpId }, 1);
       }
-      if (this.$route.query.bsType == 'TKCG') {
+      if (this.$route.query.bsType == "TKCG") {
         this.$store.commit("CGTH_IN_DETAIL");
-        this.editOpen({ id: this.$route.query.id }, 1)
+        this.editOpen({ id: this.$route.query.id }, 1);
       }
     }, 100);
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(351), this.optionList);
-    this.key++
+    this.key++;
     let i = 0;
     this.option.column.forEach(item => {
-      if (item.search) i++
-    })
+      if (item.search) i++;
+    });
     // if (i % 3 !== 0) {
     //   const num = 3 - Number(i % 3)
     //   this.option.searchMenuSpan = num * 8;
     //   this.option.searchMenuPosition = "right";
     // }
     this.getWorkDicts("sales_Status").then(res => {
-      this.orderStatusList = res.data.data
+      this.orderStatusList = res.data.data;
       console.log(this.orderStatusList);
     });
     this.getWorkDicts("settlement_Status").then(res => {
-      this.actualStatusList = res.data.data
+      this.actualStatusList = res.data.data;
     });
   },
   methods: {
+    voided(row) {
+      this.$confirm("是否继续操作?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        voidedDocument({ id: row.id }).then(res => {
+          this.$message.success("操作成功!");
+          this.onLoad(this.page, this.search);
+        });
+      });
+    },
     // 导出
     outExport() {
-      console.log(this.search, 412)
-      let config = { params: { ...this.search } }
+      console.log(this.search, 412);
+      let config = { params: { ...this.search } };
       if (config.params) {
         for (const propName of Object.keys(config.params)) {
           const value = config.params[propName];
-          if (value !== null && typeof (value) !== "undefined") {
+          if (value !== null && typeof value !== "undefined") {
             if (value instanceof Array) {
               for (const key of Object.keys(value)) {
-                let params = propName + '[' + key + ']';
-                config.params[params] = value[key]
+                let params = propName + "[" + key + "]";
+                config.params[params] = value[key];
               }
-              delete config.params[propName]
+              delete config.params[propName];
             }
           }
         }
       }
-      console.log(config, 427)
-      config.params.bsType = 'TKCG'
+      console.log(config, 427);
+      config.params.bsType = "TKCG";
       const routeData = this.$router.resolve({
-        path: '/api/blade-sales-part/returns/listExport',      //跳转目标下载地址
+        path: "/api/blade-sales-part/returns/listExport", //跳转目标下载地址
         query: {
-          ...config.params    //括号内是要传递给新窗口的参数
+          ...config.params //括号内是要传递给新窗口的参数
         }
-      })
-      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+      });
+      window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
     },
     check(row) {
-      this.form = row
-      this.detailsOpen = true
+      this.form = row;
+      this.detailsOpen = true;
     },
     backToList(type) {
-      this.form = {}
-      this.detailsOpen = false
+      this.form = {};
+      this.detailsOpen = false;
       if (type === 0) {
-        this.detailData = {}
+        this.detailData = {};
       }
       if (this.$route.query.bsType) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
@@ -376,12 +404,11 @@ export default {
           path: "/tirePartsMall/purchaseService/returns/index"
         });
       }
-      this.onLoad(this.page, this.search)
+      this.onLoad(this.page, this.search);
       this.$store.commit("CGTH_OUT_DETAIL");
-
     },
     editOpen(row, status) {
-      this.form = row
+      this.form = row;
       this.detailData = {
         id: row.id,
         status: status
@@ -391,7 +418,7 @@ export default {
     },
     //刷新
     refreshChange() {
-      this.onLoad(this.page, this.search)
+      this.onLoad(this.page, this.search);
     },
     expandChange(row) {
       if (!row.itemData) {
@@ -405,26 +432,27 @@ export default {
       }
     },
     rowDel(form, index) {
-      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        remove({ ids: form.id }).then(res => {
-          this.$message({
-            type: 'success',
-            message: '删除成功!'
+      this.$confirm("此操作将永久删除该行, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          remove({ ids: form.id }).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.dataList.splice(index, 1);
+            this.onLoad(this.page);
           });
-          this.dataList.splice(index, 1);
-          this.onLoad(this.page)
         })
-      }).catch(() => {
-      });
+        .catch(() => {});
     },
     searchChange(params, done) {
-      this.page.currentPage = 1
+      this.page.currentPage = 1;
       done();
-      this.onLoad(this.page, params)
+      this.onLoad(this.page, params);
     },
     onLoad(page, params = {}) {
       params = {
@@ -433,27 +461,29 @@ export default {
         size: page.pageSize,
         bsType: "TKCG",
         ...Object.assign(params, this.search)
-      }
-      this.loading = true
+      };
+      this.loading = true;
       this.dataList.forEach(item => {
         this.$refs.crud.toggleRowExpansion(item, false);
       });
-      getList(params).then(res => {
-        if (res.data.data.records) {
-          res.data.data.records.forEach(e => {
-            e.itemLoading = true;
+      getList(params)
+        .then(res => {
+          if (res.data.data.records) {
+            res.data.data.records.forEach(e => {
+              e.itemLoading = true;
+            });
+          }
+          this.dataList = res.data.data.records;
+          this.page.total = res.data.data.total;
+          this.$nextTick(() => {
+            this.$refs.crud.doLayout();
+            this.$refs.crud.dicInit();
           });
-        }
-        this.dataList = res.data.data.records
-        this.page.total = res.data.data.total
-        this.$nextTick(() => {
-          this.$refs.crud.doLayout()
-          this.$refs.crud.dicInit()
+          this.loading = false;
         })
-        this.loading = false
-      }).finally(() => {
-        this.loading = false
-      })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
@@ -479,7 +509,7 @@ export default {
       }
     }
   }
-}
+};
 </script>
 
 <style scoped>

+ 22 - 8
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -86,7 +86,7 @@
               allow-create
               default-first-option
               @change="contactsChange($event)"
-              :disabled="isContacts||optionForm.disabled"
+              :disabled="isContacts || optionForm.disabled"
             >
               <el-option v-for="item in contactsOption" :key="item.cname" :label="item.cname" :value="item.contacts" />
             </el-select>
@@ -102,7 +102,7 @@
               filterable
               allow-create
               default-first-option
-              :disabled="isContacts||optionForm.disabled"
+              :disabled="isContacts || optionForm.disabled"
             >
               <el-option
                 v-for="item in recAddressOption"
@@ -132,7 +132,14 @@
               @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
             >
               <template slot-scope="{ scope, row }" slot="menuLeft">
-                <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn||(form.id&&form.status!='录入')" @click="rowAdd(row)">添加商品</el-button>
+                <el-button
+                  type="primary"
+                  icon="el-icon-plus"
+                  size="small"
+                  :disabled="isAddBtn || (form.id && form.status != '录入')"
+                  @click="rowAdd(row)"
+                  >添加商品</el-button
+                >
                 <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom" @click="excelDialogfun('名称')"
                   >按名称导入
                 </el-button>
@@ -216,7 +223,7 @@
                 <el-button
                   v-if="mingxibaocun"
                   :size="size"
-                  :disabled="disabled || isAdd||(row.id&&form.status!='录入')"
+                  :disabled="disabled || isAdd || (row.id && form.status != '录入')"
                   :type="type"
                   :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
                   @click="hangeditBtn(row, index)"
@@ -234,7 +241,7 @@
                 <el-button
                   icon="el-icon-delete"
                   :size="size"
-                  :disabled="disabled || isDisabled||(row.id&&form.status!='录入')"
+                  :disabled="disabled || isDisabled || (row.id && form.status != '录入')"
                   :type="type"
                   @click="rowDelBox(row, index, 'orderItemsList')"
                   >删除
@@ -738,8 +745,9 @@ export default {
           {
             label: "电话",
             disabled: false,
-
-            prop: "phone"
+            prop: "phone",
+            type: "number",
+            controls: false
           },
           {
             label: "地址",
@@ -2039,6 +2047,12 @@ export default {
         done();
         let picihao = false;
         if (valid) {
+          if (this.form.phone) {
+            if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.phone)) {
+              this.$message.error("请正确输入电话");
+              return;
+            }
+          }
           for (let i in this.form.orderItemsList) {
             this.form.orderItemsList[i].subTotalMoney = this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price;
             if (this.form.orderItemsList[i].goodsNum <= 0) {
@@ -2361,7 +2375,7 @@ export default {
         revokeCheckOrderCG({ ...this.form })
           .then(res => {
             this.isRevocationRequest = !this.isRevocationRequest;
-            this.editButton=true
+            this.editButton = true;
             this.refresh(res.data.data.id);
             this.$message.success("撤回成功");
             loading.close();

File diff suppressed because it is too large
+ 432 - 374
src/views/tirePartsMall/salesManagement/purchaseOrder/index.vue


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

@@ -892,8 +892,9 @@ export default {
           {
             label: "电话",
             disabled: false,
-
-            prop: "phone"
+            prop: "phone",
+            type: "number",
+            controls: false
           },
           {
             label: "收货地址",
@@ -2766,6 +2767,12 @@ export default {
         done();
         let picihao = false;
         if (valid) {
+          if (this.form.phone) {
+            if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.phone)) {
+              this.$message.error("请正确输入电话");
+              return;
+            }
+          }
           if (this.form.orderItemsList.length == 0) {
             this.$message.warning("请添加商品");
             return;
@@ -2774,17 +2781,6 @@ export default {
             this.form.orderItemsList[i].subTotalMoney = Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price)
               ? Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price).toFixed(2)
               : 0;
-            if (this.form.orderItemsList[i].pid) {
-            } else {
-              // if (this.form.orderItemsList[i].whether == '1') {
-              //     if (this.form.orderItemsList[i].dot) { } else {
-              //         this.$message.warning(`销售明细序号${Number(i) + 1}的批次号不能为空`);
-              //         picihao = true
-              //         break;
-              //     }
-              // } else {
-              // }
-            }
             if (this.form.orderItemsList[i].goodsNum <= 0) {
               return this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
               picihao = true;
@@ -3332,7 +3328,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.orderItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.id);;
+        const itemsWithId = multiList.filter(item => item.id);
         let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
         // 把选中的删除掉
         multiList.forEach(item => {

+ 166 - 134
src/views/tirePartsMall/salesService/returns/index.vue

@@ -1,15 +1,29 @@
 <template>
   <div>
     <basic-container v-show="!detailsOpen">
-      <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" @row-del="rowDel"
-        @expand-change="expandChange" @refresh-change="refreshChange"
+      <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"
+        @row-del="rowDel"
+        @expand-change="expandChange"
+        @refresh-change="refreshChange"
         @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 342)"
-        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 342)" :page.sync="page">
-        <template slot-scope="{type,size,row,index}" slot="menu">
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 342)"
+        :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.numberRows != 0"
-            @click="$refs.crud.rowDel(row, index)">删除</el-button>
+          <el-button :size="size" :type="type" :disabled="row.status != '录入' || row.numberRows != 0" @click="$refs.crud.rowDel(row, index)"
+            >删除</el-button
+          >
+          <el-button type="text" size="small" :disabled="row.generateTask != '未生成'" @click="voided(row, index)">单据作废</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>
@@ -17,28 +31,26 @@
         <template slot="notCompleteSearch">
           <el-checkbox v-model="search.notComplete" true-label="1"></el-checkbox>
         </template>
-        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+        <template slot-scope="{ type, size, row, $index }" slot="menuLeft">
           <!-- <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新建订单</el-button> -->
           <el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>
         </template>
         <template slot-scope="{ row, index }" slot="ordNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }}
-          </span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }} </span>
         </template>
         <template slot-scope="{ row, index }" slot="srcOrdNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }}
-          </span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }} </span>
         </template>
       </avue-crud>
     </basic-container>
-    <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData" @backToList="backToList">
-    </detailsPage>
+    <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData" @backToList="backToList"> </detailsPage>
   </div>
 </template>
 
 <script>
+import { voidedDocument } from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { getList, remove, getGoodsInfo } from "@/api/tirePartsMall/salesService/saleOrder";
-import detailsPage from "./detailsPage"
+import detailsPage from "./detailsPage";
 import { getDetails } from "@/api/tirePartsMall/salesService/saleOrder";
 import { getToken } from "@/util/auth";
 
@@ -77,7 +89,7 @@ export default {
         searchMenuPosition: "right",
         align: "center",
         size: "small",
-        menuWidth: 50,
+        menuWidth: 120,
         searchSpan: 6,
         searchMenuSpan: 24,
         searchIcon: true,
@@ -86,52 +98,56 @@ export default {
         searchIndex: 3,
         highlightCurrentRow: true,
         dialogWidth: "70%",
-        summaryText:this.$t("land118n.total"),
+        summaryText: this.$t("land118n.total"),
         showSummary: true,
-        sumColumnList: [{
-          name: 'goodsTotalNum',
-          type: 'sum',
-          decimals: 0
-        }, {
-          name: 'returnsNumber',
-          type: 'sum',
-        }, {
-          name: 'returnsAmount',
-          type: 'sum',
-        }],
+        sumColumnList: [
+          {
+            name: "goodsTotalNum",
+            type: "sum",
+            decimals: 0
+          },
+          {
+            name: "returnsNumber",
+            type: "sum"
+          },
+          {
+            name: "returnsAmount",
+            type: "sum"
+          }
+        ],
         column: [
           {
-            label: '业务编号',
+            label: "业务编号",
             prop: "ordNo",
             search: true,
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '往来单位',
+            label: "往来单位",
             prop: "customerName",
             search: true,
             overHidden: true,
-            type: 'select',
+            type: "select",
             filterable: true,
-            width:140,
+            width: 140,
             remote: true,
             props: {
-              label: 'cname',
-              value: 'cname',
-              res: 'data.records'
+              label: "cname",
+              value: "cname",
+              res: "data.records"
             },
-            dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=KH&cname={{key}}',
+            dicUrl: "/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=KH&cname={{key}}"
           },
           {
-            label: '显示已完成',
-            prop: 'notComplete',
+            label: "显示已完成",
+            prop: "notComplete",
             overHidden: true,
             hide: true,
             search: true,
             searchslot: true
           },
           {
-            label: '业务员',
+            label: "业务员",
             disabled: false,
             prop: "salerName",
             search: true,
@@ -142,73 +158,75 @@ export default {
             },
             dicUrl: "/api/blade-user/salerList",
             filterable: true,
-            rules: [{
-              required: true,
-              message: " ",
-              trigger: "blur"
-            }]
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ]
           },
           {
-            label: '仓库',
+            label: "仓库",
             prop: "storageName",
             search: true,
             overHidden: true,
             // remote: true,
-            type: 'select',
+            type: "select",
             props: {
-              label: 'cname',
-              value: 'cname'
+              label: "cname",
+              value: "cname"
             },
-            dicUrl: '/api/blade-sales-part/storageDesc/listAll?cname={{key}}',
+            dicUrl: "/api/blade-sales-part/storageDesc/listAll?cname={{key}}"
           },
           {
-            label: '行数',
+            label: "行数",
             prop: "numberRows",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '商品名称',
+            label: "商品名称",
             prop: "goodsNameJoin",
             search: true,
             overHidden: true,
             filterable: true,
             remote: true,
-            type: 'select',
+            type: "select",
             props: {
-              label: 'cname',
-              value: 'cname',
-              res: 'data.records'
+              label: "cname",
+              value: "cname",
+              res: "data.records"
             },
             dicUrl: "/api/blade-sales-part/goodsDesc/list?current=1&size=20&cname={{key}}"
           },
           {
-            label: '数量',
+            label: "数量",
             prop: "goodsTotalNum",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '退货数量',
+            label: "退货数量",
             prop: "returnsNumber",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '退货金额',
+            label: "退货金额",
             prop: "returnsAmount",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '销售单号',
+            label: "销售单号",
             prop: "srcNo",
             search: true,
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '状态',
+            label: "状态",
             prop: "status",
-            overHidden: true,
+            overHidden: true
           },
           {
-            label: '业务日期',
+            label: "业务日期",
             prop: "businesDate",
             searchProp: "businesDateList",
             type: "date",
@@ -245,7 +263,7 @@ export default {
             props: {
               label: "account",
               value: "id",
-              res: 'data.records'
+              res: "data.records"
             }
           },
           {
@@ -262,7 +280,7 @@ export default {
           }
         ]
       }
-    }
+    };
   },
   activated() {
     setTimeout(() => {
@@ -271,7 +289,7 @@ export default {
         this.detailsOpen = true;
       }
       if (this.$route.query.check) {
-        this.editOpen({ id: this.$route.query.check.srcBillId }, 1)
+        this.editOpen({ id: this.$route.query.check.srcBillId }, 1);
         this.$store.commit("XSTH_IN_DETAIL");
         this.detailData = {
           id: this.$route.query.check.billId,
@@ -279,76 +297,88 @@ export default {
           auditId: this.$route.query.check.id
         };
       }
-      if (this.$route.query.type == 'S') {
-        this.editOpen({ id: this.$route.query.detail.srcParentId }, 1)
+      if (this.$route.query.type == "S") {
+        this.editOpen({ id: this.$route.query.detail.srcParentId }, 1);
       }
       if (this.$route.query.jumpId) {
-        this.editOpen({ id: this.$route.query.jumpId }, 1)
+        this.editOpen({ id: this.$route.query.jumpId }, 1);
       }
-      if (this.$route.query.bsType == 'TKXS') {
+      if (this.$route.query.bsType == "TKXS") {
         this.$store.commit("XSTH_IN_DETAIL");
-        this.editOpen({ id: this.$route.query.id }, 1)
+        this.editOpen({ id: this.$route.query.id }, 1);
       }
     }, 100);
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(342), this.optionList);
-    this.key++
+    this.key++;
     let i = 0;
     this.option.column.forEach(item => {
-      if (item.search) i++
-    })
+      if (item.search) i++;
+    });
     // if (i % 3 !== 0) {
     //   const num = 3 - Number(i % 3)
     //   this.option.searchMenuSpan = num * 8;
     //   this.option.searchMenuPosition = "right";
     // }
     this.getWorkDicts("sales_Status").then(res => {
-      this.orderStatusList = res.data.data
+      this.orderStatusList = res.data.data;
       console.log(this.orderStatusList);
     });
     this.getWorkDicts("settlement_Status").then(res => {
-      this.actualStatusList = res.data.data
+      this.actualStatusList = res.data.data;
     });
   },
   methods: {
+    voided(row) {
+      this.$confirm("是否继续操作?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        voidedDocument({ id: row.id }).then(res => {
+          this.$message.success("操作成功!");
+          this.onLoad(this.page, this.search);
+        });
+      });
+    },
     // 导出
     outExport() {
-      console.log(this.search, 412)
-      let config = { params: { ...this.search } }
+      console.log(this.search, 412);
+      let config = { params: { ...this.search } };
       if (config.params) {
         for (const propName of Object.keys(config.params)) {
           const value = config.params[propName];
-          if (value !== null && typeof (value) !== "undefined") {
+          if (value !== null && typeof value !== "undefined") {
             if (value instanceof Array) {
               for (const key of Object.keys(value)) {
-                let params = propName + '[' + key + ']';
-                config.params[params] = value[key]
+                let params = propName + "[" + key + "]";
+                config.params[params] = value[key];
               }
-              delete config.params[propName]
+              delete config.params[propName];
             }
           }
         }
       }
-      console.log(config, 427)
-      config.params.bsType = 'TKXS'
+      console.log(config, 427);
+      config.params.bsType = "TKXS";
       const routeData = this.$router.resolve({
-        path: '/api/blade-sales-part/returns/listExport',      //跳转目标下载地址
+        path: "/api/blade-sales-part/returns/listExport", //跳转目标下载地址
         query: {
-          ...config.params    //括号内是要传递给新窗口的参数
+          ...config.params //括号内是要传递给新窗口的参数
         }
-      })
-      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+      });
+      window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
     },
     check(row) {
-      this.form = row
-      this.detailsOpen = true
+      this.form = row;
+      this.detailsOpen = true;
     },
     backToList(type) {
-      this.form = {}
-      this.detailsOpen = false
+      this.form = {};
+      this.detailsOpen = false;
       if (type === 0) {
-        this.detailData = {}
+        this.detailData = {};
       }
       if (this.$route.query.bsType) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
@@ -356,12 +386,11 @@ export default {
           path: "/tirePartsMall/salesService/returns/index"
         });
       }
-      this.onLoad(this.page, this.search)
+      this.onLoad(this.page, this.search);
       this.$store.commit("XSTH_OUT_DETAIL");
-
     },
     editOpen(row, status) {
-      this.form = row
+      this.form = row;
       this.detailData = {
         id: row.id,
         status: status
@@ -371,7 +400,7 @@ export default {
     },
     //刷新
     refreshChange() {
-      this.onLoad(this.page, this.search)
+      this.onLoad(this.page, this.search);
     },
     expandChange(row) {
       if (!row.itemData) {
@@ -385,26 +414,27 @@ export default {
       }
     },
     rowDel(form, index) {
-      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        remove({ ids: form.id }).then(res => {
-          this.$message({
-            type: 'success',
-            message: '删除成功!'
+      this.$confirm("此操作将永久删除该行, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          remove({ ids: form.id }).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.dataList.splice(index, 1);
+            this.onLoad(this.page);
           });
-          this.dataList.splice(index, 1);
-          this.onLoad(this.page)
         })
-      }).catch(() => {
-      });
+        .catch(() => {});
     },
     searchChange(params, done) {
-      this.page.currentPage = 1
+      this.page.currentPage = 1;
       done();
-      this.onLoad(this.page, params)
+      this.onLoad(this.page, params);
     },
     onLoad(page, params = {}) {
       params = {
@@ -413,27 +443,29 @@ export default {
         size: page.pageSize,
         bsType: "TKXS",
         ...Object.assign(params, this.search)
-      }
-      this.loading = true
+      };
+      this.loading = true;
       this.dataList.forEach(item => {
         this.$refs.crud.toggleRowExpansion(item, false);
       });
-      getList(params).then(res => {
-        if (res.data.data.records) {
-          res.data.data.records.forEach(e => {
-            e.itemLoading = true;
+      getList(params)
+        .then(res => {
+          if (res.data.data.records) {
+            res.data.data.records.forEach(e => {
+              e.itemLoading = true;
+            });
+          }
+          this.dataList = res.data.data.records;
+          this.page.total = res.data.data.total;
+          this.$nextTick(() => {
+            this.$refs.crud.doLayout();
+            this.$refs.crud.dicInit();
           });
-        }
-        this.dataList = res.data.data.records
-        this.page.total = res.data.data.total
-        this.$nextTick(() => {
-          this.$refs.crud.doLayout()
-          this.$refs.crud.dicInit()
+          this.loading = false;
         })
-        this.loading = false
-      }).finally(() => {
-        this.loading = false
-      })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
@@ -459,7 +491,7 @@ export default {
       }
     }
   }
-}
+};
 </script>
 
 <style scoped>

Some files were not shown because too many files changed in this diff