web100 2 éve
szülő
commit
dce5c9ecb2

+ 10 - 0
src/api/tirePartsMall/salesManagement/outboundTask.js

@@ -35,3 +35,13 @@ export const typeSave = (data) => {
     data: data
   })
 }
+//入库任务派工
+export const generateWarehousing = (ids) => {
+  return request({
+    url: '/api/blade-sales-part/ship/generateWarehousing',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}

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

@@ -92,4 +92,37 @@ export const goodsListXs = (customId,stock) => {
       stock
     }
   })
+}
+
+//采购订单保存
+export const inboundTask = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/inboundTask',
+    method: 'POST',
+    data: data
+  })
+}
+//请核
+export const checkOrderCG = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/checkOrderCG',
+    method: 'post',
+    data: data
+  })
+}
+//采购订单撤销请核
+export const revokeCheckOrderCG = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/revokeCheckOrderCG',
+    method: 'post',
+    data: data
+  })
+}
+//采购订单撤销任务
+export const revokeInboundTask = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/revokeInboundTask',
+    method: 'post',
+    data: data
+  })
 }

+ 1 - 0
src/components/report-dialog/main.vue

@@ -333,6 +333,7 @@ export default {
   watch: {
     switchDialog: function(i) {
       this.visible = i;
+      console.log('this.reportName',this.reportName);
       console.log(this.$router.currentRoute.name);
       this.query = {
         name: this.reportName ? this.reportName : this.$router.currentRoute.name

+ 26 - 0
src/router/views/index.js

@@ -2485,6 +2485,32 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/index')
   }]
 }, {
+  path: '/tirePartsMall/salesManagement/purchaseOrder/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/tirePartsMall/salesManagement/purchaseOrder/index',
+    name: '采购订单',
+    meta: {
+      i18n: '/tirePartsMall/salesManagement/purchaseOrder/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/salesManagement/purchaseOrder/index')
+  }]
+},{
+  path: '/tirePartsMall/salesManagement/inboundTask/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/tirePartsMall/salesManagement/inboundTask/index',
+    name: '入库任务',
+    meta: {
+      i18n: '/tirePartsMall/salesManagement/inboundTask/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/salesManagement/inboundTask/index')
+  }]
+},{
   path: '/tirePartsMall/salesManagement/saleOrder/index',
   component: Layout,
   hidden: true,

+ 1 - 0
src/store/modules/ifdetail.js

@@ -12,6 +12,7 @@ const ifdetail = {
     mainItemStatus: false, //主营业务明细
     settleStatus: false, //结算明细
     domSaleStatus: false, // 内贸销售
+    domPurchaseOrder:false,
     domStockDetail: false, // 国内库存账
     domPurStatus: false, // 内贸采购
     outputStatus: false, //销项发票

+ 2 - 0
src/views/approveData/index.vue

@@ -48,6 +48,7 @@
         <span v-else-if="scope.row.checkType == 'XSTD'">销售退单请核</span>
         <span v-else-if="scope.row.checkType == 'YPJ-XSTH'">销售退款退货</span>
         <span v-else-if="scope.row.checkType == 'PJTK'">售后</span>
+        <span v-else-if="scope.row.checkType == 'PJCG'">采购</span>
       </template>
       <!-- <template slot="menuLeft">
         <el-button size="small" type="success" :disabled="selectionList.length == 0" @click.stop="batchCheck">批量审批
@@ -185,6 +186,7 @@ export default {
     },
     //跳转页面
     jumpPage(row) {
+      console.log('row',row);
       console.log(eval("(" + row.pageStatus + ")"))
       if (row.url) {
         if (eval("(" + row.pageStatus + ")")) {

+ 7 - 0
src/views/tirePartsMall/basicData/shareListing/index.vue

@@ -15,6 +15,7 @@
                      @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 273.1)"
                      @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 273.1)" :page.sync="page">
             <template slot="filesListForm">
+              <span style="font-size: 12px;">(图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)</span>
               <c-upload :data="form.filesList" display basic deleteUrl="/api/blade-sales-part/productLaunchFiles/remove"
                         :enumerationValue="160"/>
             </template>
@@ -149,11 +150,13 @@ export default {
         index: true,
         span: 8,
         border: true,
+        updateBtnText:'保存',
         selection: true,
         height: "auto",
         searchMenuPosition: "right",
         align: "center",
         menuWidth: 100,
+        updateBtnText:'保存',
         searchSpan: 8,
         searchIcon: true,
         searchIndex: 2,
@@ -169,6 +172,7 @@ export default {
           label: '规格型号',
           prop: 'specificationAndModel',
           search: true,
+          disabled: true,
           overHidden: true,
         }, {
           label: '公司',
@@ -184,6 +188,7 @@ export default {
         }, {
           label: '库存',
           prop: 'inventory',
+          disabled: true,
           overHidden: true,
         }, {
           label: '产品状态',
@@ -205,6 +210,7 @@ export default {
         }, {
           label: "品牌",
           prop: "brandName",
+          disabled: true,
           overHidden: true,
         }, {
           label: "售价1",
@@ -241,6 +247,7 @@ export default {
           search: true,
           showColumn: true,
           overHidden: true,
+          disabled: true,
           type: 'select',
           props: {
             label: 'fullName',

+ 73 - 43
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -37,15 +37,15 @@
                                     :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="rowEdit(row, index)">编辑
                                 </el-button>
                                 <el-button icon="el-icon-delete" :size="size"
-                                    :disabled="disabled || form.statusName == '已入库' || isEdit" :type="type"
+                                    :disabled="disabled || form.statusName == '已入库' || isEdit || isEdits" :type="type"
                                     @click="rowDelBox(row, index)">删除
                                 </el-button>
                             </template>
                             <template slot-scope="{scope,row}" slot="menuLeft">
-                                <el-button type="primary" icon="el-icon-plus" size="small" @click="rowAdd(row, score)"
+                                <!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="rowAdd(row, score)"
                                     :disabled="isrowAdd">添加轮胎</el-button>
                                 <el-button type="success" size="small" :disabled="isrowAdd" icon="el-icon-bottom" @click="excelBox = true">导入
-                                </el-button>
+                                </el-button> -->
                                 <el-button type="primary" icon="el-icon-printer" size="small"
                                     @click="handlePrint">打印</el-button>
                             </template>
@@ -66,7 +66,7 @@
                     </el-tab-pane>
                 </el-tabs>
             </trade-card>
-            <report-dialog :switchDialog="switchDialog" :reportId="form.id" @onClose="onClose()"></report-dialog>
+            <report-dialog :switchDialog="switchDialog"  :reportId="form.id" reportName="入库工单"  @onClose="onClose()"></report-dialog>
         </div>
         <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
             :close-on-click-modal="false" v-dialog-drag>
@@ -108,6 +108,7 @@ export default {
         return {
             switchDialog: false,
             isEdit:false,
+            isEdits:false,
             activeName: "sale_detail",
             disabled: false,
             isrowAdd: true,
@@ -219,7 +220,7 @@ export default {
                         prop: "goodsTotalNum",
                         search: false,
                         overHidden: true,
-                        disabled: false,
+                        disabled: true,
                         // width: 120,
                         // rules: [
                         //     {
@@ -295,26 +296,28 @@ export default {
                         value: 'id'
                     },
                     dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll'
-                }, {
-                    label: "价格",
-                    prop: "price",
-                    disabled: false,
-                    ovrHidden: true,
-                    rules: [{
-                        required: true,
-                        message: " ",
-                        trigger: "blur"
-                    }, {
-                        validator: (rule, value, callback) => {
-                            if (value < 0) {
-                                callback(new Error("单价不能小于0"));
-                            } else {
-                                callback();
-                            }
-                        },
-                        trigger: "blur"
-                    }]
-                }, {
+                }, 
+                // {
+                //     label: "价格",
+                //     prop: "price",
+                //     disabled: false,
+                //     ovrHidden: true,
+                //     rules: [{
+                //         required: true,
+                //         message: " ",
+                //         trigger: "blur"
+                //     }, {
+                //         validator: (rule, value, callback) => {
+                //             if (value < 0) {
+                //                 callback(new Error("单价不能小于0"));
+                //             } else {
+                //                 callback();
+                //             }
+                //         },
+                //         trigger: "blur"
+                //     }]
+                // }, 
+                {
                     label: "实际数量",
                     prop: "sendNum",
                     disabled: false,
@@ -403,6 +406,7 @@ export default {
                 }, {
                     label: "备注",
                     prop: "remarks",
+                    span:16,
                     disabled: false,
                     overHidde: true
                 }]
@@ -430,19 +434,19 @@ export default {
                         prop: "ordNo",
                         disabled: true
                     },
-                    {
-                        label: "业务来源",
-                        prop: "stockTime",
-                        type: "date",
-                        searchRange: true,
-                        searchDefaultTime: [
-                            "00:00:00",
-                            "23:59:59"
-                        ],
-                        format: "yyyy-MM-dd",
-                        valueFormat: "yyyy-MM-dd HH:mm:ss",
-                        overHidden: true
-                    },
+                    // {
+                    //     label: "业务来源",
+                    //     prop: "stockTime",
+                    //     type: "date",
+                    //     searchRange: true,
+                    //     searchDefaultTime: [
+                    //         "00:00:00",
+                    //         "23:59:59"
+                    //     ],
+                    //     format: "yyyy-MM-dd",
+                    //     valueFormat: "yyyy-MM-dd HH:mm:ss",
+                    //     overHidden: true
+                    // },
                     {
                         prop: "itemId",
                         label: "地址",
@@ -528,7 +532,8 @@ export default {
                     storageId: this.form.storageId,
                     goodsId: this.formContacts.goodsId
             }).then(res=>{this.formContacts.price = res.data.data[0].inventoryCostPrice,console.log(res)})
-                goodsDetail({ id: value }).then(res => {
+                goodsDetail({ id: value,stock:this.form.storageId?this.form.storageId:'' }).then(res => {
+                    console.log(this.form.storageId);
                     this.formContacts.goodsNo = res.data.data.code
                     this.formContacts.brandId = res.data.data.brandId
                     this.formContacts.brandName = res.data.data.brandName
@@ -546,6 +551,7 @@ export default {
                             storageId: this.form.storageId,
                             goodsId: this.formContacts.goodsId
                         }).then(res => {
+                            console.log('dot',res);
                             this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
                         })
                     }
@@ -555,13 +561,14 @@ export default {
         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);
+            console.log(this.form.storageId);
+
             if (this.formContacts.goodsId !== value) {
                 dotListAll({
                     storageId: this.form.storageId,
                     goodsId: this.formContacts.goodsId
             }).then(res=>{ this.formContacts.price = res.data.data[0].inventoryCostPrice})
-                goodsDetail({ id: value }).then(res => {
+                goodsDetail({ id: value,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.brandName = res.data.data.brandName
@@ -579,6 +586,7 @@ export default {
                             storageId: this.form.storageId,
                             goodsId: this.formContacts.goodsId
                         }).then(res => {
+                            console.log('567');
                             this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
                         })
                     }
@@ -685,12 +693,24 @@ export default {
                     }
                 })
                 this.optionContacts.column.forEach(item => {
-                    if (item.prop == 'remarks') {
+                    if (item.prop == 'remarks'|| item.prop == 'dot' || item.prop == 'sendNum') {
                         this.$set(item, 'disabled', false)
                     } else {
                         this.$set(item, 'disabled', true)
                     }
                 })
+                if(this.form.billno.substring(0, 4) == 'TKSH'){
+                    // this.isEdit = true
+                    this.isEdits = true
+                    this.isrowAdd = true
+                    this.optionContacts.column.forEach(item => {
+                    if (item.prop == 'remarks' || item.prop == 'sendNum' || item.prop == 'price'|| item.prop == 'dot') {
+                        this.$set(item, 'disabled', false)
+                    } else {
+                        this.$set(item, 'disabled', true)
+                    }
+                })
+                }
             } else if (this.form.statusName == '已入库') {
                 this.$set(this.optionForm, 'disabled', false)
                 this.$set(this.optionContactsBack, 'disabled', false)
@@ -725,8 +745,11 @@ export default {
                         ...this.form,
                         bizTypeName: "SHGD"
                     }).then(res => {
-                        this.$message.success("保存成功");
                         this.refresh(res.data.data.id)
+                        this.$set(this.optionForm, 'disabled', true)
+                        this.$set(this.optionContactsBack, 'disabled', true)
+                        this.isEdit =true
+                        this.$message.success("保存成功");
                         loading.close();
                     }).finally(() => {
                         loading.close();
@@ -782,6 +805,13 @@ export default {
         rowEdit(row, index) {
             console.log(row, index);
             this.confirmEditing()
+            dotList({
+                storageId: this.form.storageId,
+                goodsId: row.goodsId
+            }).then(res => {
+                console.log('789');
+                this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
+            })
             this.$refs.formContacts.rowEdit(row, index)
         },
         rowDelBox(row, index) {

+ 4 - 4
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/index.vue

@@ -10,10 +10,10 @@
           <el-button :size="size" :type="type" :disabled="row.item >= 1"
             @click="$refs.crud.rowDel(row, index)">删除</el-button>
         </template>
-        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
-          <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新采购单</el-button>
+        <!-- <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> -->
         <template slot-scope="{row,index}" slot="stockClerkName">
           <el-select placeholder="请选择" v-if="row.$cellEdit" v-model="row.stockClerkName" size="small" filterable
             allow-create default-first-option clearable>
@@ -35,7 +35,7 @@
         </template>
       </avue-crud>
     </basic-container>
-    <detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
+    <detailsPage v-if="detailsOpen" :onLoad="form"  :detailData="detailData" @backToList="backToList"></detailsPage>
   </div>
 </template>
 

+ 380 - 0
src/views/tirePartsMall/salesManagement/inboundTask/index.vue

@@ -0,0 +1,380 @@
+<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" @selection-change="selectionChange" @on-load="onLoad" @search-change="searchChange"
+        @row-del="rowDel" @refresh-change="refreshChange"
+        @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 271)"
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 271)" :page.sync="page"
+        @row-update="rowUpdate">
+        <template slot-scope="{type,size,row,index}" slot="menu" >
+          <!--<el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">查看</el-button>-->
+          <el-button type="text" size="small" :disabled="Number(row.sendTotalNum) == Number(row.goodsTotalNum)" @click="rowCell(row, index)">{{ row.$cellEdit ? '保存' : '修改' }}
+          </el-button>
+          <!-- <el-button :disabled="row.statusName === '已派工'" :size="size" :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>
+        </template>
+        <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>-->
+          <el-button type="success" icon="el-icon-finished" size="small" @click="dispatching"
+            :disabled="selectionList.length <= 0">派工
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <!--<detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>-->
+  </div>
+</template>
+
+<script>
+import { getList, remove, outboundWorkOrder,typeSave,generateWarehousing } from "@/api/tirePartsMall/salesManagement/outboundTask";
+import da from "element-ui/src/locale/lang/da";
+// import detailsPage from "./detailsPage"
+
+export default {
+  name: "index",
+  components: {
+    // detailsPage
+  },
+  data() {
+    return {
+      detailsOpen: false,
+      loading: false,
+      search: {},
+      form: {},
+      dataList: [],
+      selectionList: [],
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      key: 0,
+      option: {},
+      optionList: {
+        selection: true,
+        viewBtn: false,
+        editBtn: false,
+        celBtn: true,
+        delBtn: false,
+        addBtn: false,
+        menu: true,
+        index: true,
+        span: 8,
+        border: true,
+        height: "auto",
+        searchMenuPosition: "right",
+        align: "center",
+        size: "small",
+        menuWidth: 100,
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        highlightCurrentRow: true,
+        dialogWidth: "70%",
+        summaryText: "合计",
+        // showSummary: true,
+        // sumColumnList: [],
+        column: [{
+          label: '采购单号',
+          prop: "ordNo",
+          search: true,
+          width: 140,
+          overHidden: true,
+        }, {
+          label: '业务对象',
+          prop: "customerName",
+          search: true,
+          width: 140,
+          type: 'select',
+          overHidden: true,
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH&enableOrNot=0',
+        }
+          // , {
+          //     label: "商品种类",
+          //     prop: "corpId",
+          //     width: 100,
+          //     overHidden: true,
+          // }
+          , 
+        //   {
+        //   label: '业务来源',
+        //   prop: "bsType",
+        //   width: 100,
+        //   overHidden: true,
+        // },
+        // {
+        //   label: '来源公司',
+        //   prop: "sourceCompanyName",
+        //   search: true,
+        //   width: 100,
+        //   overHidden: true,
+        //   type: 'select',
+        //   props: {
+        //     label: 'fullName',
+        //     value: 'fullName'
+        //   },
+        //   dicUrl: '/api/blade-system/dept/top-list'
+        // },
+        {
+          label: '收货仓库',
+          prop: "storageName",
+          width: 100,
+          search: true,
+          overHidden: true,
+          cell:false,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'cname'
+          },
+          dicUrl: '/api/blade-sales-part/storageDesc/listAll',
+        },
+         {
+          label: '库管',
+          prop: "stockClerkId",
+          width: 100,
+          cell:false,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'realName',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-user/stockClerkList',
+        },  
+        {
+          label: '收货地址',
+          prop: "recAddress",
+          width: 200,
+          overHidden: true,
+        },
+        {
+          label: '采购数量',
+          prop: "goodsTotalNum",
+          width: 100,
+          overHidden: true,
+        },
+        {
+          label: '收货数量',
+          prop: "sendTotalNum",
+          width: 100,
+          overHidden: true,
+        },
+        {
+          label: '联系人',
+          prop: "contacts",
+          width: 100,
+          overHidden: true,
+        }, {
+          label: '电话',
+          prop: "phone",
+          width: 100,
+          overHidden: true,
+        }, {
+          label: '状态',
+          prop: "statusName",
+          width: 100,
+          search: true,
+          type: 'select',
+          overHidden: true,
+          dicData: [{
+            label: '待处理',
+            value: '待处理'
+          }, {
+            label: '已派工',
+            value: '已派工'
+          }]
+        }, {
+          label: '备注',
+          prop: "remarks",
+          width: 200,
+          cell:false,
+          overHidden: true,
+        }, {
+          label: '业务日期',
+          prop: "createTime",
+          searchProp: "createTimeList",
+          type: "date",
+          overHidden: true,
+          search: true,
+          width: 100,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }]
+      }
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(271), this.optionList);
+    this.key++
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+    this.option = await this.getColumnData(this.getColumnName(271), this.optionList);
+
+    this.option.selectable = (row, index) => {
+      return Number(row.sendTotalNum) !== Number(row.goodsTotalNum);
+    }
+
+  },
+  methods: {
+    selectionChange(list) {
+      console.log(list);
+      this.selectionList = list
+    },
+    dispatching() {
+      this.$confirm('是否确认派工?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let data = []
+        for (let item of this.selectionList) {
+          data.push(item.id)
+        }
+        this.loading = true; // Show the loading spinner
+        generateWarehousing(data.join(',')).then(res => {
+          this.$message({
+            type: 'success',
+            message: '生成成功!'
+          });
+          this.onLoad(this.page)
+        }).finally(() => {
+          this.loading = false; // Hide the loading spinner
+        });
+      })
+    },
+    check(row) {
+      this.form = row
+      this.detailsOpen = true
+    },
+    backToList(type) {
+      this.form = {}
+      this.detailsOpen = false
+      if (type === 0) {
+        this.detailData = {}
+      }
+      this.onLoad(this.page, this.search)
+    },
+    //列表更新
+    rowUpdate(form, index, done) {
+      console.log(form);
+      typeSave(form).then(res => {
+        this.$message({type: "success", message: form.id ? "修改成功!" : "新增成功!"});
+        // this.page.currentPage = 1;
+        // this.onLoad(this.page);
+        //成功关闭此页面回到列表页
+        // this.backToList()
+      })
+      done()
+    },
+    //刷新
+    refreshChange() {
+      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, "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) {
+      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        remove(form.id).then(res => {
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+          this.dataList.splice(index, 1);
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+      });
+    },
+    searchChange(params, done) {
+      console.log(params);
+      done();
+      this.onLoad(this.page, params)
+    },
+    onLoad(page, params = {}) {
+      params = {
+        // ...params,
+        current: page.currentPage,
+        size: page.pageSize,
+        bizTypeName: "SHRW",
+        ...Object.assign(params, this.search),
+        customerName : params.$customerName
+      }
+      console.log(params);
+      this.loading = true
+      getList(params).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.loading = false
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      console.log(2132);
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      // this.option = await this.getColumnData(this.getColumnName(271), this.optionList);
+
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      console.log(this[option]);
+      console.log(this[optionBack]);
+      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.option.selectable = (row, index) => {
+      return Number(row.sendTotalNum) !== Number(row.goodsTotalNum);
+    }
+    }
+  }
+}
+</script>
+
+<style scoped></style>

+ 4 - 1
src/views/tirePartsMall/salesManagement/outboundWorkOrder/detailsPage.vue

@@ -15,7 +15,6 @@
         <el-button class="el-button--small-yh" type="warning" size="small" v-if="form.statusName == '已出库'"
           @click="revoke" :disabled="isSave">撤销出库
         </el-button>
-
         <el-button class="el-button--small-yh" type="success" size="small" style="margin-left: 6px;"
           v-if="form.statusName == '待出库' || form.statusName == '撤销出库'" @click="complete" :disabled="isSave">出库完成
         </el-button>
@@ -516,6 +515,10 @@ export default {
           })
         }
         this.isAddDisabled = true
+        if(res.data.data.statusName == '待出库'){
+              this.isAddDisabled = false
+              this.isDisabled = false
+          }
         this.form = res.data.data
         loading.close();
       }).catch(() => {

+ 1704 - 0
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -0,0 +1,1704 @@
+<template>
+    <div>
+        <div class="customer-head">
+            <div class="customer-back">
+                <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                    @click="backToList(0)">返回列表
+                </el-button>
+            </div>
+            <div class="add-customer-btn">
+                <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"
+                    :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">
+                    {{ buttonText }}
+                </el-button>
+                <el-dropdown style="padding: 0 6px;line-height: 0">
+                    <el-button type="danger" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
+                        请 核<i class="el-icon-arrow-down el-icon--right"></i>
+                    </el-button>
+                    <el-dropdown-menu slot="dropdown">
+                        <el-dropdown-item @click.native="applySettlement('申请')" :disabled="isApplySettlement || form.status !== '录入'">请核数据
+                        </el-dropdown-item>
+                        <!-- <el-dropdown-item @click.native="confirmRefundBtn('确认')" :disabled="isConfirmRefundBtn">确认退款
+                        </el-dropdown-item> -->
+                        <el-dropdown-item @click.native="revocationRequest('撤销')" :disabled="isRevocationRequest">撤销请核
+                        </el-dropdown-item>
+                    </el-dropdown-menu>
+                </el-dropdown>
+                <el-dropdown style="line-height: 0">
+                    <el-button type="warning" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
+                        审 批<i class="el-icon-arrow-down el-icon--right"></i>
+                    </el-button>
+                    <el-dropdown-menu slot="dropdown">
+                        <el-dropdown-item @click.native="examineBtn('审批')" :disabled="isExamineBtn">审批
+                        </el-dropdown-item>
+                        <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">请核进度
+                        </el-dropdown-item>
+
+                    </el-dropdown-menu>
+                </el-dropdown>
+            </div>
+        </div>
+        <div style="margin-top: 50px">
+            <trade-card title="基础信息">
+                <avue-form :option="optionForm" v-model="form" ref="form">
+                    <template slot-scope="{row,index}" slot="contacts">
+                        <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" filterable
+                            @change="contactsChange($event)" :disabled=isContacts>
+                            <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
+                                :value="item.contacts" />
+                        </el-select>
+                    </template>
+                </avue-form>
+            </trade-card>
+            <trade-card title="明细信息">
+                <el-tabs v-model="activeName" type="card">
+                    <el-tab-pane label="采购明细" name="sale_detail">
+                        <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
+                            :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
+                            @row-close="rowClose" :before-close="beforeClose"
+                            @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
+                            @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"
+                                    @click="rowAdd(row)">添加轮胎</el-button>
+                                <el-button type="primary" icon="el-icon-printer" size="small"
+                                    @click="handlePrint">打印</el-button>
+                            </template>
+                            <!-- <template slot-scope="{scope,row}" slot="goodsNum">
+                                <el-input size="small" v-model="formContacts.goodsNum" style="width: 100%">
+                                    <template slot="inventory">{{ inventory }}吨</template>
+                                </el-input>
+                            </template> -->
+                            <!-- <template slot="goodsId" slot-scope="{ row, index }">
+                                <span  style="display:flex">
+                                    <el-select v-model="row.goodsId" placeholder="请选择" size="small" filterable
+                                        style="width:60%" >
+                                        <el-option v-for="item in goodsIdoptions" :key="item.id" :label="item.cname"
+                                            :value="item.id">
+                                        </el-option>
+                                    </el-select>
+                                    <el-button icon="el-icon-search" size="small" @click="rePick(row, index)"></el-button>
+                                </span>
+                            </template> -->
+                            <template slot-scope="{type,size,row,index,disabled}" slot="menu">
+                                <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"
+                                    :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
+                                </el-button>
+                            </template>
+                        </avue-crud>
+                    </el-tab-pane>
+                    <el-tab-pane label="付款明细" name="payment_details">
+                        <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
+                            :data="dataList" @row-save="rowSave" @row-update="rowUpdate"
+                            @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)"
+                            @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)">
+                            <!-- <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.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
+                                </el-button>
+                                <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
+                                    @click="rowDelBox(row, index, 'paymentRecordsList')">删除
+                                </el-button>
+                            </template> -->
+                        </avue-crud>
+                    </el-tab-pane>
+                    <el-tab-pane label="入库记录" name="outbound_records">
+                        <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
+                            :data="form.outboundRecordsList" @row-save="rowSave" @row-update="rowUpdate"
+                            @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
+                            @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
+                            <!-- <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.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
+                                </el-button>
+                                <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
+                                    @click="rowDelBox(row, index)">删除
+                                </el-button>
+                            </template> -->
+                        </avue-crud>
+                    </el-tab-pane>
+                </el-tabs>
+            </trade-card>
+            <report-dialog :switchDialog="switchDialog" reportName="轮胎商城-采购订单" :reportId="form.id"
+                @onClose="onClose()"></report-dialog>
+            <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
+                :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+                <check :checkData="checkData" :checkDetail="true" :idList="[]" @operationType="operationType"
+                    @choceCheckFun="choceCheckFun">
+                </check>
+            </el-dialog>
+            <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
+                :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+                <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
+            </el-dialog>
+        </div>
+    </div>
+</template>
+
+<script>
+import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
+import { getDetails, submit, generateShipTask, tradingBox, delOrderItem, checkOrder, confirmRefund, goodsListXs,inboundTask,checkOrderCG,revokeCheckOrderCG,revokeInboundTask } from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
+import reportDialog from "@/components/report-dialog/main";
+import checkSchedule from "@/components/check/checkSchedule";
+import check from "@/components/check/check";
+import { getList } from "@/api/paymentManagement/paymentRecord"
+import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
+import M from "minimatch";
+import da from "element-ui/src/locale/lang/da";
+import { number } from "echarts";
+export default {
+    name: "detailsPage",
+
+    data() {
+        return {
+            inventory: 0,
+            isStatus: 1,
+            goodsIdoptions: [],
+            dataList: [],
+            dicUrlWithCustomId: '',
+            sharedCompanyId: 0,
+            isAddBtn: true,
+            isSaveBtn: false,
+            viewDisabled: false,
+            isAdd: false,
+            editButton: true,
+            isEditButton: false,
+            goods: [],
+            isDisabled: false,
+            isDisabledTask: false,
+            contactsOption: [],
+            isContacts: false,
+            checkData: {},
+            buttonText: '生成任务',
+            buttonColor: 'success', // 初始颜色为success
+            checkScheduleDialog: false,
+            isApplySettlement: false,
+            isConfirmRefundBtn: true,
+            isExamineBtn: true,
+            isRevocationRequest: true,
+            checkDialog: false,
+            checkId: '',
+            batchNo: '',
+            switchDialog: false,
+            activeName: "sale_detail",
+            disabled: false,
+            key: 0,
+            form: {
+                orderItemsList: [],
+                paymentRecordsList: [],
+                outboundRecordsList: []
+            },
+            optionForm: {
+                menuBtn: false,
+                span: 8,
+                disabled: false,
+                column: [{
+                    label: '供应商',
+                    prop: "customerId",
+                    disabled: false,
+                    remote: true,
+                    type: 'select',
+                    props: {
+                        label: 'cname',
+                        value: 'id'
+                    },
+                    cascader: ['recAddress'],
+                    change: (data) => {
+                        if (!this.onLoad.id) {
+                            // this.$set(this.optionContactsBack, "addBtn", true)
+                            // this['optionContacts'] = this['optionContactsBack'];
+                            // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
+                        }
+                        if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
+                            getCustom({ id: data.value }).then(res => {
+                                this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
+                                // this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
+                                // this.form.storageId = res.data.data.deliveryWarehouseId
+                                this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
+                                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].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
+
+                            })
+                        }
+
+                        // if (this.$refs.form.DIC.customerId || data.value) {
+                        //     for (let item of this.$refs.form.DIC.customerId) {
+                        //         if (item.id == data.value) {
+                        //             console.log(data);
+                        //             console.log(this.$refs.form);
+                        //             console.log(item);
+                        //             //   后端返回数据暂无联系人、地址等数据,无法下拉默认
+                        //             this.form.phone = item.tel
+                        //         }
+                        //     }
+                        // }
+                    },
+                    dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=GYS&enableOrNot=0',
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }]
+                }, {
+                    label: '仓库',
+                    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"
+                    // }]
+                }, {
+                    label: '单据编号',
+                    prop: "ordNo",
+                    disabled: true
+                }, 
+                // {
+                //     label: '来源单号',
+                //     prop: "srcOrdNo",
+                //     disabled: true
+                // }, {
+                //     label: '业务来源',
+                //     prop: "businessSource",
+                //     disabled: true
+                // },
+                 {
+                    label: '应收类别',
+                    prop: "receivableType",
+                    type: "select",
+                    disabled: false,
+                    dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
+                    props: {
+                        label: "dictValue",
+                        value: "dictValue"
+                    },
+                    value: '网络支付'
+                }, {
+                    label: '联系人',
+                    type: "select",
+                    prop: "contacts",
+                    disabled: false,
+                    props: {
+                        label: 'address',
+                        value: 'id'
+                    },
+                    dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
+                }, {
+                    label: '电话',
+                    disabled: false,
+
+                    prop: "phone",
+                }, {
+                    label: '收货地址',
+                    prop: "recAddress",
+                    type: 'select',
+                    disabled: false,
+                    props: {
+                        label: 'address',
+                        value: 'address'
+                    },
+                    dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
+                },
+                //  {
+                //     label: '配送方式',
+                //     type: 'select',
+                //     prop: "shipType",
+                //     disabled: false,
+                //     dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
+                //     props: {
+                //         label: "dictValue",
+                //         value: "dictValue"
+                //     },
+                //     value: '物流'
+                // }, {
+                //     label: '物流公司',
+                //     disabled: false,
+
+                //     prop: "logisticsCorpName"
+                // }, 
+                // {
+                //     label: '成本',
+                //     prop: "cost",
+                //     display: true,
+                //     disabled: true
+                // }, {
+                //     label: '毛利',
+                //     prop: "grossProfit",
+                //     disabled: true
+                // }, 
+                // {
+                //     label: '采购金额',
+                //     prop: "salesAmount",
+                //     disabled: true
+                // },
+                //  {
+                //     label: '运费',
+                //     prop: "freight",
+                //     disabled: true
+                // }, 
+                {
+                    label: '总金额',
+                    prop: "totalMoney",
+                    disabled: true
+                }, 
+                {
+                    label: '备注',
+                    prop: "remarks",
+                    type: 'textarea',
+                    disabled: false,
+                    span: 16,
+                    minRows: 1
+                }]
+            },
+            formContacts: {},
+            optionContacts: {},
+            optionContactsBack: {
+                disabled: false,
+                border: true,
+                align: 'center',
+                index: true,
+                showSummary: true,
+                sumColumnList: [
+                    {
+                        name: 'goodsNum',
+                        type: 'sum',
+                    },
+                    {
+                        name: 'sendNum',
+                        type: 'sum',
+                    },
+                    {
+                        name: 'subTotalMoney',
+                        type: 'sum',
+                    },
+                    {
+                        name: 'costprie',
+                        type: 'sum',
+                    },
+                    {
+                        name: 'grossProfit',
+                        type: 'sum',
+                    }
+                ],
+                addBtnText: "添加轮胎",
+                updateBtnText:'保存',
+                refreshBtn: false,
+                dialogDrag: true,
+                addBtn: false,
+                span: 8,
+                height: 500,
+                addRowBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menuWidth: 140,
+                dialogTop: 25,
+                dialogWidth: "80%",
+                // summaryText: "合计",
+                // showSummary: true,
+                // sumColumnList:[{
+                //   name: "goodsNum",
+                //   type: "sum",
+                //   decimals: 2
+                // },{
+                //   name: "sendNum",
+                //   type: "sum",
+                //   decimals: 2
+                // },{
+                //   name: "profit",
+                //   type: "sum",
+                //   decimals: 2
+                // },{
+                //   name: "subTotalMoney",
+                //   type: "sum",
+                //   decimals: 2
+                // },{
+                //   name: "thisAmount",
+                //   type: "sum",
+                //   decimals: 2
+                // },{
+                //   name: "costprie",
+                //   type: "sum",
+                //   decimals: 2
+                // },{
+                //   name: "grossProfit",
+                //   type: "sum",
+                //   decimals: 2
+                // }],
+                column: [{
+                    label: '轮胎名称',
+                    prop: 'goodsId',
+                    width: 200,
+                    disabled: false,
+                    remote: true,
+                    overHidden: true,
+                    type: 'select',
+                    // dicData: [],
+                    props: {
+                        label: 'cname',
+                        value: 'id'
+                    },
+                    // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
+                    dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}"
+                    // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
+                }, {
+                    label: '数量',
+                    prop: 'goodsNum',
+                    overHidden: true,
+                    disabled: false,
+                    width: 100,
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }, {
+                        validator: (rule, value, callback) => {
+                            console.log(this.formContacts.inventory);
+                            if (value < 0) {
+                                callback(new Error("数量不能小于0"));
+                            } else if (Number(value) > Number(this.formContacts.inventory)) {
+                                callback(new Error("数量不能大于库存"));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: "blur"
+                    }]
+                },
+                {
+                    label: '价格',
+                    prop: 'price',
+                    overHidden: true,
+                    width: 100,
+                    disabled: false,
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }, {
+                        validator: (rule, value, callback) => {
+                            if (value < 0) {
+                                callback(new Error("价格不能小于0"));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: "blur"
+                    }]
+                },
+                {
+                    label: '库存',
+                    prop: 'inventory',
+                    overHidden: true,
+                    hide: true,
+                    width: 100
+                }, {
+                    label: '批次号',
+                    prop: 'dot',
+                    type: "select",
+                    disabled: true,
+                    allowCreate: true,
+                    filterable: true,
+                    dicData: [],
+                    props: {
+                        label: "dot",
+                        value: "dot"
+                    },
+                    dicUrl: "/api/blade-sales-part/stockDesc/dotList",
+                    overHidden: true,
+                }, {
+                    label: '轮胎编码',
+                    prop: 'goodsNo',
+                    overHidden: true,
+                    disabled: false,
+                    width: 100
+                },
+                {
+                    label: '品牌',
+                    prop: 'brandId',
+                    disabled: false,
+                    width: 100,
+                    overHidden: true,
+                    type: 'select',
+                    props: {
+                        label: 'cname',
+                        value: 'id'
+                    },
+                    dicUrl: '/api/blade-sales-part/brandDesc/listAll'
+                },
+                {
+                    label: '规格型号',
+                    prop: 'propertyName',
+                    overHidden: true,
+                    disabled: false,
+                    width: 100
+                }, {
+                    label: '花纹',
+                    prop: 'pattern',
+                    overHidden: true,
+                    disabled: false,
+                    width: 100
+                }, {
+                    label: '轮胎描述',
+                    prop: 'goodsDescription',
+                    disabled: false,
+                    overHidden: true,
+                    width: 100
+                },
+                {
+                    label: '单位',
+                    prop: 'units',
+                    type: "select",
+                    disabled: false,
+                    props: {
+                        label: "dictValue",
+                        value: "dictValue"
+                    },
+                    dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+                    overHidden: true,
+                    width: 100
+                },
+
+                {
+                    label: '发货数量',
+                    prop: 'sendNum',
+                    disabled: false,
+                    overHidden: true,
+                    width: 100,
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
+                },
+                // {
+                //     label: '利润',
+                //     prop: 'profit',
+                //     overHidden: true,
+                //     width: 100
+                // }, 
+                {
+                    label: '小计',
+                    prop: 'subTotalMoney',
+                    overHidden: true,
+                    width: 100,
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
+                },
+                // {
+                //     label: '返利',
+                //     prop: 'thisAmount',
+                //     overHidden: true,
+                //     width: 100
+                // }, 
+                {
+                    label: '成本',
+                    prop: 'costprie',
+                    overHidden: true,
+                    width: 100,
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
+
+                },
+                {
+                    label: '毛利',
+                    prop: 'grossProfit',
+                    overHidden: true,
+                    width: 100,
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
+                },
+                {
+                    label: '备注',
+                    prop: "remarks",
+                    overHidden: true,
+                    width: 100,
+                    disabled: false,
+
+                }
+                ]
+            },
+            optionPaymentDetails: {},
+            optionPaymentDetailsBack: {
+                align: 'center',
+                index: true,
+                addBtnText: "录入明细",
+                menu: false,
+                refreshBtn: false,
+                dialogDrag: true,
+                addBtn: false,
+                span: 8,
+                height: 600,
+                addRowBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menuWidth: 140,
+                dialogTop: 25,
+                dialogWidth: "80%",
+                column: [{
+                    label: '支付编号',
+                    prop: 'serialNumber'
+                }, {
+                    label: '金额',
+                    prop: 'amount'
+                }, {
+                    label: '类型',
+                    prop: 'type'
+                }, {
+                    label: '支付时间',
+                    prop: 'createTime'
+                }]
+            },
+            optionOutboundRecords: {},
+            optionOutboundRecordsBack: {
+                align: 'center',
+                index: true,
+                menu: false,
+                addBtnText: "录入明细",
+                refreshBtn: false,
+                dialogDrag: true,
+                addBtn: false,
+                span: 8,
+                height: 600,
+                addRowBtn: false,
+                editBtn: false,
+                delBtn: false,
+                // menuWidth: 140,
+                dialogTop: 25,
+                dialogWidth: "80%",
+                column: [{
+                    label: '出库单号',
+                    prop: 'billno'
+                }, 
+                {
+                    label: '来源单号',
+                    prop: 'ordNo'
+                }, {
+                    label: '数量',
+                    prop: 'goodsTotalNum'
+                }, {
+                    label: '状态',
+                    prop: 'statusName'
+                }, {
+                    label: '业务时间',
+                    prop: 'createTime'
+                }]
+            }
+        }
+    },
+    components: { reportDialog, check, checkSchedule },
+    props: {
+        onLoad: Object,
+        detailData: Object
+    },
+    async created() {
+        // console.log(this.$route);
+        //         if(this.$route.query.check.actId){
+
+        //             this.isExamineBtn = false
+        //         }
+        this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
+            if (this.formContacts.goodsId !== value) {
+                goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
+                    this.goods = res.data.data
+                    this.formContacts.goodsNo = res.data.data.code
+                    this.formContacts.brandId = res.data.data.brandId
+                    this.formContacts.inventory = res.data.data.inventory
+                    // this.formContacts.brandId = res.data.data.brandName
+                    // this.formContacts.brandName = res.data.data.brandId
+
+                    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.formContacts.price = res.data.data.price
+                    //
+                    this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
+                    console.log(res.data.data.sharedCompanyId);
+                    console.log(res.data.data.sharedCompanyName);
+                    this.form.sharedCompanyId = res.data.data.sharedCompanyId
+                    this.form.sharedCompanyName = res.data.data.sharedCompanyName
+                    this.sharedCompanyId = res.data.data.sharedCompanyId
+                    console.log(res.data.data.sharedCompanyId);
+                    console.log(this.form.orderItemsList);
+                    for (let i = 0; i < this.form.orderItemsList.length; i++) {
+                        console.log(Number(this.form.orderItemsList[i].sharedCompanyId));
+                        if (Number(this.form.orderItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
+                            this.isStatus = 0
+                        }
+                    }
+                    if (res.data.data.whether == 0) {
+                        this.findObject(this.optionContactsBack.column, "dot").disabled = true
+                    } else {
+                        this.findObject(this.optionContactsBack.column, "dot").disabled = false
+                        dotList({
+                            storageId: this.form.storageId,
+                            goodsId: this.formContacts.goodsId
+                        }).then(res => {
+                            this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
+                        })
+                    }
+                    // this.formContacts.goodsId = res.data.data.cname
+                    // this.formContacts.goodsName = res.data.data.id
+                })
+            }
+        }
+        this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
+
+        this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
+
+            if (this.formContacts.goodsId !== value) {
+                goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
+                    this.goods = res.data.data
+                    this.formContacts.goodsNo = res.data.data.code
+                    this.formContacts.brandId = res.data.data.brandId
+                    this.formContacts.inventory = res.data.data.inventory
+                    // this.formContacts.brandId = res.data.data.brandName
+                    // this.formContacts.brandName = res.data.data.brandId
+                    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.sharedCompanyId = res.data.data.sharedCompanyId
+                    this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
+                    //
+                    this.form.sharedCompanyId = res.data.data.sharedCompanyId
+                    this.form.sharedCompanyName = res.data.data.sharedCompanyName
+                    for (let i = 0; i < this.form.orderItemsList.length; i++) {
+                        if (this.form.orderItemsList[i].sharedCompanyId != res.data.data.sharedCompanyId) {
+                            this.isStatus = 0
+                        }
+                    }
+                    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.formContacts.goodsId = res.data.data.cname
+                    // this.formContacts.goodsName = res.data.data.id
+                })
+            }
+        }
+        this.optionPaymentDetails = await this.getColumnData(this.getColumnName(269.2), this.optionPaymentDetailsBack);
+        this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.3), this.optionOutboundRecordsBack);
+        this.key++
+        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);
+            this.refresh(this.onLoad.id, true)
+        }
+        if (!this.form.id) {
+            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
+                } else {
+                    its.disabled = true
+                }
+            })
+            this.isSaveBtn = true;
+                    this.isDisabledTask = true;
+                    this.viewDisabled = true;
+            // this.$set(this.optionContactsBack, "addBtn", false)
+            this['optionContacts'] = this['optionContactsBack'];
+            this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
+        }
+        if (!this.detailData.id) {
+            this.editButton = false
+            this.isAddBtn = false
+            this.isDisabledTask = false;
+            this.isSaveBtn = false
+            this.viewDisabled = false;
+            this.form.businessSource = '内部销售'
+        }
+        console.log(this.detailData.check);
+        if (this.detailData.check) {
+            console.log('this.detailData.check',this.detailData.check);
+            this.isExamineBtn = false
+            // this.batchNo = this.detailData.check.batchNo
+        }
+    },
+
+    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, 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
+        //     })
+        // },
+        'form.orderItemsList.length'(newformContacts, oldformContacts) {
+            console.log(this.formContacts);
+            console.log(this.form.orderItemsList);
+            // for (let i = 0; i < this.form.orderItemsList.length - 1; i++) {
+            //     const currentItem = this.form.orderItemsList[i];
+            //     const nextItem = this.form.orderItemsList[i + 1];
+
+            //     if (currentItem.sharedCompanyId !== nextItem.sharedCompanyId) {
+            //         console.log('不能添加');
+            //     }
+            // }
+            if (this.form.orderItemsList.length) {
+                this.findObject(this.optionForm.column, 'storageId').disabled = true
+            } else {
+                this.findObject(this.optionForm.column, 'storageId').disabled = false
+            }
+        },
+        'form.sharedCompanyId'(newSharedCompanyId, oldSharedCompanyId) {
+            console.log(newSharedCompanyId, oldSharedCompanyId);
+            if (newSharedCompanyId != oldSharedCompanyId) {
+                console.log('不能添加');
+            }
+            console.log(this.sharedCompanyId);
+        },
+        $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);
+                this.refresh(this.onLoad.id, true)
+            }
+            // if (!this.form.id) {
+            //     console.log(3);
+            //     // this.$set(this.optionContactsBack, "addBtn", false)
+            //     this['optionContacts'] = this['optionContactsBack'];
+            //     this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
+            // }
+            // if (!this.detailData.id) {
+            //     this.form.businessSource = '内部销售'
+            // }
+
+            if (this.detailData.status == 1) {
+                this.isExamineBtn = false;
+            }
+            // if (to.name == '销售订单') {
+            //     console.log('销售订单');
+            //     this.isExamineBtn = false;
+
+            // }
+        }
+    },
+
+    methods: {
+        editBtn(row, index) {
+            console.log(123);
+            this.confirmEditing()
+            this.$refs.formContacts.rowEdit(row, index);
+            dotList({
+                storageId: this.form.storageId,
+                goodsId: this.formContacts.goodsId
+            }).then(res => {
+                this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
+            })
+            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
+            })
+            if(this.form.status == '已发货'){
+                this.viewDisabled =false
+                return
+            }
+            if(this.form.status == '审核中'){
+                this.isRevocationRequest = false
+                this.viewDisabled =false
+                return
+            }
+            if(this.form.status == '退款中'){
+                this.viewDisabled =false
+                this.isRevocationRequest = true
+                return
+            }
+            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('当前状态不允许编辑')
+                // this.optionForm.column.forEach(item=>{
+                //     if(item.prop= 'contacts'){
+                //         item.disabled = true
+                //     }
+                // })
+            }
+            if (this.form.status == '待发货') {
+                this.isAddBtn = true
+            }
+            this.optionContactsBack.column.forEach(its => {
+                if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
+                    its.disabled = false
+                } else {
+                    its.disabled = true
+                }
+            })
+            this.$set(this.optionForm, 'disabled', false)
+            this.$set(this.optionContactsBack, 'disabled', false)
+            this.isDisabled = false
+            this.isAdd = false
+            if (this.form.businessSource == "外部销售") {
+                this.optionForm.column.forEach(its => {
+                        if (its.prop == 'contacts' || its.prop == 'phone'||its.prop == 'recAddress') {
+                            this.$set(its, 'disabled', true)
+                        }
+                    })
+                if (this.form.status == '待发货') {
+                    this.isSaveBtn = false;
+                    this.isDisabledTask = false;
+                    this.viewDisabled = false;
+                }
+                if (this.form.status == '待确认') {
+                    const loadings = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        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)
+                        }
+                        if (its.prop == 'storageId') {
+                            this.$set(its, 'disabled', false)
+                        }
+                    })
+                    //外部销售都能申请退款
+                    this.isApplySettlement = false
+                    //不能录入不能删除
+                    this.isDisabled = true
+                    this.isAdd = false
+                    this.isAddBtn= true
+                    this.$set(this.form, 'shipType', '物流')
+                    this.$set(this.form, 'receivableType', '网络支付')
+                    this.optionContactsBack.column.forEach(item => {
+                        this.$set(item, 'disabled', true)
+                        if (item.label == '批次号' || item.label == '备注') {
+                            item.disabled = false
+                        }
+                    })
+                    loadings.close()
+                } else {
+                    const loadin = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    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
+                        } else {
+                            its.disabled = false
+                        }
+                    })
+                    this.optionContactsBack.column.forEach(its => {
+                        if (its.prop != 'remarks') {
+                            its.disabled = true
+                        } else {
+                            its.disabled = false
+                        }
+                    })
+                    loadin.close()
+                }
+
+            } else {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '加载中',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(255,255,255,0.7)'
+                });
+                if (this.form.status == '待发货' || this.form.status == '已发货' || this.form.status == '已取消') {
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    this.optionForm.column.forEach(its => {
+                        if (its.prop != 'remarks') {
+                            its.disabled = true
+                        } else {
+                            its.disabled = false
+                        }
+                    })
+                    this.optionContactsBack.column.forEach(its => {
+                        if (its.prop != 'remarks') {
+                            its.disabled = true
+                        } else {
+                            its.disabled = false
+                        }
+                    })
+                    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)
+                    this.$set(this.optionContactsBack, 'disabled', false)
+                    this.isContacts = true
+                    //删除按钮
+                    this.isDisabled = false
+                    // this.optionForm.column.forEach(item => {
+                    //     item.disabled = false
+                    // })
+                    loading.close()
+
+                } else if (this.form.status == '待确认') {
+                    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 === '物流公司') {
+                            this.$set(item, 'disabled', false)
+                        } else {
+                            this.$set(item, 'disabled', true)
+                        }
+                    })
+                    this.optionContactsBack.column.forEach(its => {
+                        if (its.prop == 'remarks' || its.prop == 'dot') {
+                            this.$set(its, 'disabled', false)
+                        } else {
+                            this.$set(its, 'disabled', true)
+
+                        }
+                    })
+                    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 => {
+                //     this.$set(item, 'disabled', false)
+                // })
+                // this.optionContactsBack.column.forEach(item => {
+                //     if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '轮胎描述') {
+                //         item.disabled = true;
+                //     }
+                // })
+                // this['optionContacts'] = this['optionContactsBack'];
+                // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
+                this.form.outboundRecordsList.forEach(item=>{
+                    if(item.statusName == '待出库'){
+                        this.isDisabledTask = true
+                    }
+                })
+      
+                loading.close()
+            }
+            // this.$set(this.form.orderItemsList,'goodsNum',66)
+
+        },
+        generateOutbound() {
+            if (!this.form.id) {
+                this.$message.error('请先保存')
+            } else {
+                if (this.buttonText === '生成任务') {
+                    //生成任务逻辑
+                    if (this.form.orderItemsList.length <= 0) {
+                        this.$message.error('请录入明细');
+                    } else {
+                        this.$set(this.optionForm, 'disabled', true)
+                        this.$set(this.optionContactsBack, 'disabled', true)
+                        this.$refs["form"].validate((valid, done) => {
+                            if (valid) {
+                                // this.form.orderItemsList.forEach((items) => {
+                                //     let brandName = items.brandId
+                                //     items.brandId = items.brandName
+                                //     items.brandName = brandName
+
+                                //     let goodsName = items.goodsId
+                                //     items.goodsId = items.goodsName
+                                //     items.goodsName = goodsName
+
+                                // })
+                                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)'
+                                        });
+                                        inboundTask({
+                                            bsType: "CG",
+                                            ...this.form
+                                        }).then(res => {
+                                            console.log(1);
+                                            this.refresh(res.data.data.id)
+                                            this.isDisabledTask = false
+                                            generateShipTask(this.form).then(res => {
+                                                console.log(res.data);
+                                                // 将按钮文本更改为"撤销任务"
+                                                this.buttonText = '撤销任务';
+                                                // 将按钮颜色更改为对应的颜色
+                                                this.buttonColor = 'warning'; // 比如改为warning
+                                                this.refresh(res.data.data.id, true)
+                                                this.isContacts = true
+                                                this.isAdd = true
+                                                this.isDisabled = true
+                                                // this.findObject(this.optionForm,'disabled') = true
+                                                // this.findObject(this.optionContactsBack,'disabled') = true
+                                                this.$message.success("生成出库任务成功");
+                                                this.isApplySettlement = false
+                                            loading.close();
+
+                                            }).finally(() => {
+                                                loading.close();
+                                            });
+                                        }).finally(() => {
+                                            loading.close();
+                                        });
+                                    } else {
+                                        return false;
+                                    }
+                                });
+
+                                done();
+                            } else {
+                                this.$message.error('请选择仓库')
+                            }
+                        })
+                    }
+                } else {
+                    this.$refs["form"].validate((valid, done) => {
+                        console.log(valid);
+                        if (valid) {
+                            const loading = this.$loading({
+                                lock: true,
+                                text: '加载中',
+                                spinner: 'el-icon-loading',
+                                background: 'rgba(255,255,255,0.7)'
+                            });
+                            // this.form.orderItemsList.forEach((items) => {
+                            //     let brandName = items.brandId
+                            //     items.brandId = items.brandName
+                            //     items.brandName = brandName
+
+                            //     let goodsName = items.goodsId
+                            //     items.goodsId = items.goodsName
+                            //     items.goodsName = goodsName
+
+                            // })
+                            revokeInboundTask(this.form).then(res => {
+                                // 将按钮文本更改为"生成任务"
+                                this.buttonText = '生成任务';
+                                // 将按钮颜色还原为success
+                                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();
+                            });
+                            done();
+
+                        }
+                    })
+                }
+
+            }
+        },
+        //联系人change
+        contactsChange(e) {
+            console.log(e);
+            console.log(this.contactsOption);
+
+            // 假设this.contactsOption是你的数组对象
+            let matchedContact = this.contactsOption.find(item => item.contacts == e);
+            // 判断是否找到匹配的对象
+            this.$set(this.form, 'phone', matchedContact.tel)
+            this.$set(this.form, 'recAddress', matchedContact.belongtoarea + matchedContact.detailedAddress)
+
+        },
+        //修改提交触发
+        editCustomer() {
+            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)'
+                    });
+                    // this.form.orderItemsList.forEach(its => {
+                    //     console.log(its.goodsId);
+                    //     console.log(its.goodsName);
+                    //     its.brandId = its.brandName
+                    //     let goodsName = its.goodsId
+                    //     its.goodsId = its.goodsName
+                    //     its.goodsName = goodsName
+
+                    // })
+
+                    submit({
+                        bsType: "CG",
+                        ...this.form
+                    }).then(res => {
+                        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)'
+                    });
+                    inboundTask({
+                        bsType: "CG",
+                        ...this.form
+                    }).then(res => {
+                        console.log(1);
+                        this.refresh(res.data.data.id)
+                        this.isDisabledTask = false
+                        loading.close();
+                    }).finally(() => {
+                        loading.close();
+                    });
+                } else {
+                    return false;
+                }
+            });
+        },
+        //关闭弹窗表单
+        beforeClose(done, type) {
+            console.log(type);
+            // if(row == "add"){
+            //     this.form.sharedCompanyId = this.form.sharedCompanyId?this.form.sharedCompanyId:''
+            //     this.form.sharedCompanyName = this.form.sharedCompanyName?this.form.sharedCompanyName:''
+            // }
+            console.log('this.form.sharedCompanyId', this.form.sharedCompanyId);
+            console.log('this.form.sharedCompanyName', this.form.sharedCompanyName);
+            done()
+        },
+        refresh(id, type) {
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            })
+            getDetails({ id: id }).then(res => {
+                this.form = res.data.data
+                let ordForm = { srcBillNo: this.form.ordNo }
+                let _this = this
+                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 !== '已退款' && 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;
+                } 
+                if(this.form.status === '已发货' ){
+                    this.isDisabledTask = true;
+                    this.viewDisabled = true;
+                    this.isEditButton = false;
+                }
+                // else {
+                //     this.isSaveBtn = true;
+                //     this.isDisabledTask = true;
+                //     this.viewDisabled = true;
+                // }
+     
+                if (this.form.status == '退款中') {
+                    this.isConfirmRefundBtn = false;
+                }
+                if (this.form.status == '已取消') {
+                    this.isConfirmRefundBtn = true;
+                }
+
+                if (this.form.generateTask == '已生成') {
+                    this.buttonText = '撤销任务';
+                    // this.isDisabledTask = false;
+                    this.buttonColor = 'warning'
+                }
+                if (this.form.status == '退款请核' || this.form.status == '退款中') {
+                    this.isRevocationRequest = false;
+                }
+                //成本、毛利对销售角色隐藏
+                this.optionForm.column.forEach(its => {
+                    if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
+                        if (its.prop == 'cost' || its.prop == 'grossProfit') {
+                            this.$set(its, 'display', false)
+                        }
+                    }
+                })
+                this.form.orderItemsList.forEach((items) => {
+                    if (!items.subTotalMoney) {
+                        items.subTotalMoney = items.goodsNum * items.price
+                        items.grossProfit = items.subTotalMoney - items.costprie
+                    }
+                    // let brandName = items.brandId
+                    // items.brandId = items.brandName
+                    // items.brandName = brandName
+
+                    // let goodsName = items.goodsId
+                    // items.goodsId = items.goodsName
+                    // items.goodsName = goodsName
+
+                })
+                loading.close();
+
+                // if (this.form.businessSource == "外部销售") {
+                //     console.log('外部销售');
+                //     this.optionForm.column.forEach(its => {
+                //         if (its.prop == 'customerId') {
+                //             this.$set(its, 'disabled', true)
+                //         }
+                //     })
+                //     //不能录入不能删除
+                //     this.$set(this.optionContactsBack, "addBtn", false)
+                //     this.isDisabled = true
+                //     this.$set(this.form, 'shipType', '物流')
+                //     this.$set(this.form, 'receivableType', '网络支付')
+                //     this.optionContactsBack.column.forEach(item => {
+                //         this.$set(item, 'disabled', true)
+                //         if (item.label == '批次号' || item.label == '备注') {
+                //             item.disabled = false
+                //         }
+                //     })
+                //     this['optionContacts'] = this['optionContactsBack'];
+                //     this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
+                //     this.optionContactsBack.column.forEach(item => {
+                //         if (item.prop == 'dot') {
+                //             this.$set(item, disabled, false)
+                //         } else {
+                //             this.$set(item, disabled, true)
+                //         }
+                //     })
+
+                // } else {
+                //     this.$set(this.form, 'shipType', '物流')
+                //     this.$set(this.form, 'receivableType', '现金')
+                //     this.optionContactsBack.column.forEach(item => {
+                //         this.$set(item, 'disabled', false)
+                //     })
+                //     this.optionContactsBack.column.forEach(item => {
+                //         if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '商品描述') {
+                //             item.disabled = true;
+                //         }
+                //     })
+                //     console.log(324324);
+                //     this['optionContacts'] = this['optionContactsBack'];
+                //     this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
+                // }
+                // // this.$set(this.form.orderItemsList,'goodsNum',66)
+
+            }).catch(() => {
+                loading.close();
+            })
+        },
+        //请核关闭
+        choceScheduleFun() {
+            this.checkScheduleDialog = false
+        },
+        //关闭审核
+        choceCheckFun() {
+            this.isExamineBtn = !this.isExamineBtn
+            this.checkDialog = false;
+        },
+        //请核数据qing
+        applySettlement(type) {
+            this.$confirm("您确定请核吗?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                this.$refs["form"].validate((valid, done) => {
+                    done()
+                    if (valid) {
+                        const data = {
+                            id: this.form.id,
+                            url: '/tirePartsMall/salesManagement/purchaseOrder/index',
+                            pageStatus: "this.$store.getters.domSaleStatus",
+                            pageLabel: "采购订单",
+                        }
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        checkOrderCG({ ...data }).then((res) => {
+                            this.refresh(res.data.data.id)
+                            this.$message.success('请核成功');
+                            this.isApplySettlement = !this.isApplySettlement
+                            loading.close();
+                            console.log(res);
+                        }).catch(() => { loading.close(); })
+                    }
+                })
+            })
+        },
+        //确认退款
+        confirmRefundBtn() {
+            this.$confirm("您确定退款吗?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '加载中',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(255,255,255,0.7)'
+                });
+                // this.form.orderItemsList.forEach((items) => {
+
+                //     let brandName = items.brandId
+                //     items.brandId = items.brandName
+                //     items.brandName = brandName
+
+                //     let goodsName = items.goodsId
+                //     items.goodsId = items.goodsName
+                //     items.goodsName = goodsName
+
+                // })
+                confirmRefund({ ...this.form }).then((res) => {
+                    loading.close()
+                    this.$message.success('确定退款成功');
+                }).catch(() => { loading.close(); })
+            })
+        },
+        //审批
+        examineBtn() {
+            this.checkData = this.$route.query.check
+            this.checkDialog = true;
+        },
+        //撤销请核
+        revocationRequest() {
+            this.$confirm("您确定撤回此次申请吗?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '加载中',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(255,255,255,0.7)'
+                });
+                // this.form.orderItemsList.forEach((items) => {
+                //     if (!items.subTotalMoney) {
+                //         items.subTotalMoney = items.goodsNum * items.price
+                //         items.grossProfit = items.subTotalMoney - items.costprie
+                //     }
+                //     let brandName = items.brandId
+                //     items.brandId = items.brandName
+                //     items.brandName = brandName
+
+                //     let goodsName = items.goodsId
+                //     items.goodsId = items.goodsName
+                //     items.goodsName = goodsName
+
+                // })
+                revokeCheckOrderCG({ ...this.form }).then(res => {
+                    this.isRevocationRequest = !this.isRevocationRequest
+                    this.refresh(res.data.data.id)
+                    this.$message.success('撤回成功')
+                    loading.close();
+                })
+            })
+        },
+        rowDelBox(row, index, type) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                if (row.id) {
+
+                    delOrderItem({ ids: row.id }).then(res => {
+                        this.form.orderItemsList.splice(index, 1);
+                        this.$message.success("操作成功!");
+                    });
+                } else {
+                    this.form[type].splice(index, 1);
+                    this.$message.success("操作成功!");
+                }
+            }
+            );
+        },
+        rowSave(form, done, loading) {
+            if (this.isStatus) {
+                done(form)
+            } else {
+                this.$message.error('请选择相同商户的轮胎')
+            }
+            console.log(form);
+            // this.form.sharedCompanyId = res.data.data.sharedCompanyId
+            // this.form.sharedCompanyName = res.data.data.sharedCompanyName
+        },
+        rowUpdate(form, index, done, loading) {
+            done(form)
+        },
+        // 新增轮胎
+        rowAdd(row) {
+            if (!this.form.customerId) {
+                this.$message.error('请选择供应商')
+                return
+            }
+            this.optionContactsBack.column.forEach(its => {
+                if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
+                    its.disabled = false
+                } else {
+                    its.disabled = true
+                }
+            })
+            console.log('新增了', row);
+            this.$refs.formContacts.rowAdd()
+        },
+        //打印
+        handlePrint() {
+            this.switchDialog = !this.switchDialog;
+        },
+        onClose(val) {
+            this.switchDialog = val;
+        },
+        //自定义列保存
+        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.$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;
+            }
+        },
+        backToList(type) {
+            this.$emit("backToList", type);
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+    margin-bottom: 8px !important;
+}
+</style>

+ 333 - 0
src/views/tirePartsMall/salesManagement/purchaseOrder/index.vue

@@ -0,0 +1,333 @@
+<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"
+        @refresh-change="refreshChange" @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 269)"
+        @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.status != '待确认' && row.item>=1 || row.businessSource == '外部销售' || row.numberRows>=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>
+        </template>
+        <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>
+        </template>
+        <template slot-scope="{ row, index }" slot="srcOrdNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }}
+          </span>
+        </template>
+
+      </avue-crud>
+    </basic-container>
+    <detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
+  </div>
+</template>
+
+<script>
+import { getList, remove } from "@/api/tirePartsMall/salesManagement/saleOrder";
+import detailsPage from "./detailsPage"
+
+export default {
+  name: "index",
+  components: {
+    detailsPage
+  },
+  data() {
+    return {
+      detailsOpen: false,
+      loading: false,
+      search: {},
+      form: {},
+      dataList: [],
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      key: 0,
+      option: {},
+      optionList: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: true,
+        span: 8,
+        border: true,
+        height: "auto",
+        searchMenuPosition: "right",
+        align: "center",
+        size: "small",
+        menuWidth: 50,
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        highlightCurrentRow: true,
+        dialogWidth: "70%",
+        summaryText: "合计",
+        showSummary: true,
+        sumColumnList: [],
+        column: [{
+          label: '采购单号',
+          prop: "ordNo",
+          search: true,
+          overHidden: true,
+        },
+        //  {
+        //   label: '来源单号',
+        //   prop: "srcOrdNo",
+        //   search: true,
+        //   overHidden: true,
+        // },
+        // {
+        //   label: "业务来源",
+        //   prop: "businessSource",
+        //   overHidden: true,
+        //   search: true,
+        //   type: 'select',
+        //   dicUrl: "/api/blade-system/dict-biz/dictionary?code=business_Source",
+        //   props: {
+        //     label: "dictValue",
+        //     value: "dictKey"
+        //   }
+        // }, 
+        {
+          label: '所属公司',
+          prop: "salesCompanyName",
+          overHidden: true,
+        }, {
+          label: '业务对象',
+          prop: "customerId",
+          search: true,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH',
+        }, {
+          label: '仓库',
+          prop: "storageId",
+          search: true,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/storageDesc/listAll',
+        }, {
+          label: '行数',
+          prop: "numberRows",
+          overHidden: true,
+        }, {
+          label: '数量',
+          prop: "goodsTotalNum",
+          overHidden: true,
+        }, {
+          label: '金额',
+          prop: "totalMoney",
+          overHidden: true,
+        }, {
+          label: '状态',
+          prop: "status",
+          search: true,
+          overHidden: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=sales_Status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, 
+        // {
+        //   label: '应结日期',
+        //   prop: "dueDate",
+        //   overHidden: true,
+        // }, 
+        {
+          label: "制单人",
+          prop: "createUserName",
+          searchProp: "createUser",
+          overHidden: true,
+          width: 100,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "制单日期",
+          prop: "createTime",
+          searchProp: "createTimeList",
+          type: "date",
+          overHidden: true,
+          width: 100,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: "更新人",
+          prop: "updateUserName",
+          searchProp: "updateUser",
+          overHidden: true,
+          width: 100,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "更新日期",
+          prop: "updateTime",
+          searchProp: "updateTimeList",
+          type: "date",
+          overHidden: true,
+          width: 100,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }]
+      }
+    }
+  },
+  activated() {
+    console.log(213213213213);
+    setTimeout(() => {
+      console.log(this.$route.query.check);
+      if (this.$route.query.check) {
+        this.editOpen({ id: this.$route.query.check.srcBillId }, 1)
+      }
+      this.detailData = {
+          id: this.$route.query.check.billId,
+          check: this.$route.query.check,
+          auditId: this.$route.query.check.id
+        };
+    }, 100);
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(269), this.optionList);
+    this.key++
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    check(row) {
+      this.form = row
+      this.detailsOpen = true
+    },
+    backToList(type) {
+      this.form = {}
+      this.detailsOpen = false
+      if (type === 0) {
+        this.detailData = {}
+      }
+      this.onLoad(this.page, this.search)
+    },
+    editOpen(row, status) {
+      this.form = row
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      console.log(status);
+      this.detailsOpen = true;
+    },
+    //刷新
+    refreshChange() {
+      this.onLoad(this.page, this.search)
+    },
+    rowDel(form, index) {
+      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        remove({id:form.id}).then(res => {
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+          this.dataList.splice(index, 1);
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+      });
+    },
+    searchChange(params, done) {
+      done();
+      this.onLoad(this.page, params)
+    },
+    onLoad(page, params = {}) {
+      params = {
+        ...params,
+        current: page.currentPage,
+        size: page.pageSize,
+        bsType: "CG",
+        ...Object.assign(params, this.search)
+      }
+      this.loading = true
+      getList(params).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.loading = false
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    //自定义列保存
+    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.$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;
+      }
+    }
+  }
+}
+</script>
+
+<style scoped></style>

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

@@ -934,6 +934,15 @@ export default {
             goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
                 this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
             })
+            if(this.form.status == '已发货'){
+                this.viewDisabled =false
+                return
+            }
+            if(this.form.status == '退款中'){
+                this.viewDisabled =false
+                this.isRevocationRequest = true
+                return
+            }
             this.isAddBtn = false
             if (this.form.status == '已取消' || this.form.status == '已退款' || this.form.status == '已发货') {
                 return
@@ -968,6 +977,11 @@ export default {
             this.isDisabled = false
             this.isAdd = false
             if (this.form.businessSource == "外部销售") {
+                this.optionForm.column.forEach(its => {
+                        if (its.prop == 'contacts' || its.prop == 'phone'||its.prop == 'recAddress') {
+                            this.$set(its, 'disabled', true)
+                        }
+                    })
                 if (this.form.status == '待发货') {
                     this.isSaveBtn = false;
                     this.isDisabledTask = false;
@@ -980,7 +994,7 @@ export default {
                         spinner: 'el-icon-loading',
                         background: 'rgba(255,255,255,0.7)'
                     });
-                    console.log('外部销售');
+                    console.log('外部销售待确认');
                     this.isSaveBtn = false;
                     this.isDisabledTask = false;
                     this.viewDisabled = false;
@@ -988,10 +1002,16 @@ export default {
                         if (its.prop == 'customerId') {
                             this.$set(its, 'disabled', true)
                         }
+                        if (its.prop == 'storageId') {
+                            this.$set(its, 'disabled', false)
+                        }
                     })
+                    //外部销售都能申请退款
+                    this.isApplySettlement = false
                     //不能录入不能删除
                     this.isDisabled = true
                     this.isAdd = false
+                    this.isAddBtn= true
                     this.$set(this.form, 'shipType', '物流')
                     this.$set(this.form, 'receivableType', '网络支付')
                     this.optionContactsBack.column.forEach(item => {
@@ -1120,6 +1140,7 @@ export default {
                         this.isDisabledTask = true
                     }
                 })
+      
                 loading.close()
             }
             // this.$set(this.form.orderItemsList,'goodsNum',66)
@@ -1138,12 +1159,6 @@ export default {
                         this.$set(this.optionContactsBack, 'disabled', true)
                         this.$refs["form"].validate((valid, done) => {
                             if (valid) {
-                                const loading = this.$loading({
-                                    lock: true,
-                                    text: '加载中',
-                                    spinner: 'el-icon-loading',
-                                    background: 'rgba(255,255,255,0.7)'
-                                });
                                 // this.form.orderItemsList.forEach((items) => {
                                 //     let brandName = items.brandId
                                 //     items.brandId = items.brandName
@@ -1172,20 +1187,19 @@ export default {
                                             this.isDisabledTask = false
                                             generateShipTask(this.form).then(res => {
                                                 console.log(res.data);
-                                                this.refresh(res.data.data.id, true)
-                                                this.isContacts = true
                                                 // 将按钮文本更改为"撤销任务"
                                                 this.buttonText = '撤销任务';
                                                 // 将按钮颜色更改为对应的颜色
                                                 this.buttonColor = 'warning'; // 比如改为warning
+                                                this.refresh(res.data.data.id, true)
+                                                this.isContacts = true
                                                 this.$message.success("生成出库任务成功");
                                                 this.isApplySettlement = false
-                                                loading.close();
+                                            loading.close();
+
                                             }).finally(() => {
                                                 loading.close();
                                             });
-
-                                            loading.close();
                                         }).finally(() => {
                                             loading.close();
                                         });
@@ -1368,6 +1382,11 @@ export default {
                     this.isDisabledTask = true;
                     this.viewDisabled = true;
                 } 
+                if(this.form.status === '已发货' ){
+                    this.isDisabledTask = true;
+                    this.viewDisabled = true;
+                    this.isEditButton = false;
+                }
                 // else {
                 //     this.isSaveBtn = true;
                 //     this.isDisabledTask = true;
@@ -1597,7 +1616,7 @@ export default {
             if (this.isStatus) {
                 done(form)
             } else {
-                this.$message.error('请选择相同商户的轮胎')
+                this.$message.error('请选择相同公司的轮胎')
             }
             console.log(form);
             // this.form.sharedCompanyId = res.data.data.sharedCompanyId