Browse Source

提交轮胎商城

caojunjie 2 years ago
parent
commit
a14fc74806

+ 5 - 4
src/api/tirePartsMall/basicData/brandPage/index.js

@@ -8,12 +8,12 @@ export const getList = (params) => {
   })
 }
 //删除
-export const remove = (ids) => {
+export const remove = (id) => {
   return request({
     url: '/api/blade-sales-part/brandDesc/update',
     method: 'post',
-    params: {
-      ids,
+    data: {
+      id
     }
   })
 }
@@ -28,7 +28,8 @@ export const submit = (data) => {
 export const getDetails = (data) => {
   return request({
     url: '/api/blade-sales-part/brandDesc/detail',
-    data: data
+    method: 'get',
+    params: data
   })
 }
 export const updateEnableOrNot = (data) => {

+ 4 - 4
src/api/tirePartsMall/basicData/commodityInformation/customerCategory.js

@@ -3,7 +3,7 @@ import request from '@/router/axios';
 //商品类别列表查询
 export function customerList(data) {
     return request({
-        url: '/api/blade-sales-part/corpstype/page',
+        url: '/api/blade-sales-part/goodsType/page',
         method: 'get',
         params: data
     })
@@ -11,7 +11,7 @@ export function customerList(data) {
 //商品类别列表修改和新增
 export function typeSave(data) {
     return request({
-        url: '/api/blade-sales-part/corpstype/submit',
+        url: '/api/blade-sales-part/goodsType/submit',
         method: 'post',
         data: data
     })
@@ -19,14 +19,14 @@ export function typeSave(data) {
 //商品类别列表查看明细
 export function detail(data) {
     return request({
-        url: '/api/blade-sales-part/corpstype/detail?id='+data,
+        url: '/api/blade-sales-part/goodsType/detail?id='+data,
         method: 'get'
     })
 }
 //商品类别列表修改和新增
 export function deleteDetails(data) {
     return request({
-        url: '/api/blade-sales-part/corpstype/update',
+        url: '/api/blade-sales-part/goodsType/update',
         method: 'post',
         data: {
             id:data

+ 3 - 5
src/api/tirePartsMall/basicData/commodityInformation/index.js

@@ -4,9 +4,7 @@ export const getList = (params) => {
   return request({
     url: '/api/blade-sales-part/goodsDesc/list',
     method: 'get',
-    params: {
-      ...params
-    }
+    params: params
   })
 }
 
@@ -33,7 +31,7 @@ export const getDetails = (data) => {
 }
 export const getCorpType = (data) => {
   return request({
-    url: '/api/blade-sales-part/corpstype/tree',
+    url: '/api/blade-sales-part/goodsType/tree',
     method: 'get',
     params: data
   })
@@ -55,7 +53,7 @@ export const remove = (data) => {
 
 export function customerList(data) {
   return request({
-    url: '/api/blade-sales-part/corpstype/page',
+    url: '/api/blade-sales-part/goodsType/page',
     method: 'get',
     params: data
   })

+ 8 - 0
src/api/tirePartsMall/basicData/listingManagement/index.js

@@ -16,3 +16,11 @@ export function submit(data) {
     data
   })
 }
+// 批量修改上下架
+export function batchOperationProductLaunch(data) {
+  return request({
+    url: '/api/blade-sales-part/productLaunch/batchOperationProductLaunch',
+    method: 'post',
+    data
+  })
+}

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

@@ -0,0 +1,33 @@
+import request from '@/router/axios';
+//查询列表
+export const getList = (params) => {
+  return request({
+    url: '/api/blade-sales-part/order/list',
+    method: 'get',
+    params: params
+  })
+}
+//删除
+export const remove = (ids) => {
+  return request({
+    url: '/api/blade-sales-part/order/update',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+export const getDetails = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/detail',
+    method: 'get',
+    params: data
+  })
+}
+export const submit = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/submit',
+    method: 'POST',
+    data: data
+  })
+}

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

@@ -78,7 +78,7 @@ export default {
         dialogWidth: "70%",
         column: [{
           label: '品牌名称',
-          prop: "ordNo",
+          prop: "cname",
           search: true,
           overHidden: true,
         },{

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

@@ -152,9 +152,9 @@ export default {
     //点击新增时触发
     beforeClose(done) {
       this.parentId = "";
-      const column = this.findObject(this.option.column, "parentId");
-      column.value = "";
-      column.addDisabled = false;
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = "";
+      // column.addDisabled = false;
       done();
     },
     //点击搜索按钮触发

+ 1 - 1
src/views/tirePartsMall/basicData/commodityInformation/detailsPage.vue

@@ -180,7 +180,7 @@ export default {
               label: 'cname',
               value: 'id'
             },
-            dicUrl: '/api/blade-sales-part/corpsDesc/listAll'
+            dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=GYS'
           },
           {
             label: "所属公司",

+ 35 - 36
src/views/tirePartsMall/basicData/commodityInformation/index.vue

@@ -6,15 +6,15 @@
           <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:82vh;">
             <template slot="addBtn">
               <i class="el-icon-setting" @click="goodsTypeVisible = true"
-                style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"></i>
+                 style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"></i>
             </template>
           </avue-tree>
         </el-col>
         <el-col :span="20">
           <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
-            @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
-            @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
-            @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
+                     @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+                     @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+                     @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
             <template slot="menuLeft">
               <el-button type="primary" size="mini" @click.stop="newAdd()">新建产品
               </el-button>
@@ -27,7 +27,7 @@
             </template>
             <template slot-scope="{ row, index }" slot="menu">
               <el-tooltip class="item" effect="dark" content="删除" placement="top">
-                <i class="tradingIcon icon-del" @click.stop="rowDel(row, index)" v-if="row.status != 0" />
+                <i class="tradingIcon icon-del" @click.stop="rowDel(row, index)" v-if="row.status != 0"/>
               </el-tooltip>
               <!-- <el-tooltip class="item" effect="dark" content="新建销售订单" placement="top">
             <i class="tradingIcon icon-add" />
@@ -55,9 +55,9 @@
         </el-col>
       </el-row>
     </basic-container>
-    <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
+    <details-page v-if="!show" @goBack="goBack()" :detailData="detailData"/>
     <el-dialog title="设置产品分类" v-dialogDrag :visible.sync="goodsTypeVisible" class="avue-dialog" width="80%"
-      append-to-body @closed="goodsTypeClosed">
+               append-to-body @closed="goodsTypeClosed">
       <span>
         <!--<goods-type></goods-type>-->
         <corp-type></corp-type>
@@ -86,11 +86,12 @@
 
 <script>
 import detailsPage from "./detailsPage";
-import { option } from "./js/optionList";
-import { getList, remove, getCorpType} from "@/api/tirePartsMall/basicData/commodityInformation";
-import { getToken } from "@/util/auth";
+import {option} from "./js/optionList";
+import {getList, remove, getCorpType} from "@/api/tirePartsMall/basicData/commodityInformation";
+import {getToken} from "@/util/auth";
 // import goodsType from '@/components/goodsType/index'
 import corpType from './components/index'
+
 export default {
   name: "index",
   data() {
@@ -200,15 +201,15 @@ export default {
       //   this.findObject(this.option.column, "ids").dicData = res.data.data;
       // })
       // "/api/blade-system/dict-biz/dictionary?code=label",
-      this.getWorkDicts("label").then(res => {
-        this.findObject(this.option.column, "label").dicData = res.data.data;
-      });
-      this.getWorkDicts("unit").then(res => {
-        this.findObject(this.option.column, "unit").dicData = res.data.data;
-      });
-      this.getWorkDicts("goods_status").then(res => {
-        this.findObject(this.option.column, "status").dicData = res.data.data;
-      });
+      // this.getWorkDicts("label").then(res => {
+      //   this.findObject(this.option.column, "label").dicData = res.data.data;
+      // });
+      // this.getWorkDicts("unit").then(res => {
+      //   this.findObject(this.option.column, "unit").dicData = res.data.data;
+      // });
+      // this.getWorkDicts("goods_status").then(res => {
+      //   this.findObject(this.option.column, "status").dicData = res.data.data;
+      // });
       // getAllgoods().then(res => {
       //   this.findObject(this.option.column, "cname").dicData = res.data.data
       // });
@@ -251,7 +252,7 @@ export default {
     },
     newAdd() {
       this.detailData = {
-        goodsTypeId:this.search.goodsTypeId
+        goodsTypeId: this.search.goodsTypeId
       };
       this.show = false;
     },
@@ -282,21 +283,19 @@ export default {
     onLoad(page, params = {}) {
       let data = this.deepClone(Object.assign(params, this.search));
       this.loading = true;
-      getList(
-        page.currentPage,
-        page.pageSize,
-        data
-      )
-        .then(res => {
-          this.dataList = res.data.data.records ? res.data.data.records : [];
-          this.page.total = res.data.data.total;
-          this.$nextTick(() => {
-            this.$refs.crud.doLayout();
-          });
-        })
-        .finally(() => {
-          this.loading = false;
+      getList({
+        ...data,
+        current: page.currentPage,
+        size: page.pageSize
+      }).then(res => {
+        this.dataList = res.data.data.records ? res.data.data.records : [];
+        this.page.total = res.data.data.total;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
         });
+      }).finally(() => {
+        this.loading = false;
+      });
     },
     editOpen(row, status) {
       this.detailData = {
@@ -318,7 +317,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        remove({ id: row.id }).then(res => {
+        remove({id: row.id}).then(res => {
           if (res.data.code == 200) {
             this.$message({
               type: "success",
@@ -365,7 +364,7 @@ export default {
 }
 </script>
 
-<style  lang="scss"  scoped>
+<style lang="scss" scoped>
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }

+ 46 - 77
src/views/tirePartsMall/basicData/commodityInformation/js/optionList.js

@@ -2,7 +2,7 @@ import { number } from "echarts"
 
 export const option = {
   searchShow: true,
-  searchMenuSpan: 8,
+  searchMenuSpan: 16,
   align: "center",
   searchSpan: 8,
   tip: false,
@@ -19,106 +19,75 @@ export const option = {
     {
       label: "商品名称",
       prop: "cname",
-      // type: "select",
-      // dicUrl:"/api/blade-client/goodsdesc/descListByCname?cname={{key}}",
-      // filterable:true,
-      // remote:true,
-      // props: {
-      //   label: "cname",
-      //   value: "cname"
-      // },
       search: true,
       overHidden: true,
-      index: 1
     },
     {
-      label: "产品分类",
-      prop: "goodsTypeName",
-      overHidden: true,
-      index: 2
-    },
-    {
-      label: "单位",
-      prop: "unit",
-      type: "select",
-      filterable:true,
-      props: {
-        label: "dictValue",
-        value: "dictValue"
-      },
-      dicData:[],
+      label: "规格型号",
+      prop: "specificationAndModel",
       search: true,
       overHidden: true,
-      index: 4
     },
     {
-      label: "参考售价",
-      prop: "standardPrice",
+      label: "花纹",
+      prop: "brandItem",
+      search: true,
       overHidden: true,
-      index: 5
     },
     {
-      label: "库存数量",
-      prop: "stockGoodsNumber",
+      label: "品牌",
+      prop: "brandId",
+      search: true,
       overHidden: true,
-      index: 6
+      type: 'select',
+      props: {
+        label: 'cname',
+        value: 'id'
+      },
+      dicUrl: '/api/blade-sales-part/brandDesc/listAll'
     },{
-      label: '是否上架',
-      prop: 'upperFrame',
-      filterable: true,
+      label: "所属公司",
+      prop: "salesCompanyId",
       search: true,
+      overHidden: true,
       type: 'select',
-      dataType: "string",
-      index: 7,
-      dicData:[{
-        label: "上架",
-        value: 1
-      },{
-        label: "下架",
-        value: 0
-      }]
+      props: {
+        label: 'fullName',
+        value: 'id'
+      },
+      dicUrl: '/api/blade-system/dept/top-list'
     },
     {
-      label: "备注",
-      prop: "remarks",
+      label: "是否管理批次号",
+      prop: "whether",
+      width:120,
       search: true,
       overHidden: true,
-      index: 8
+      labelWidth:120,
+      searchLabelWidth:120,
+      type:'select',
+      dicData:[{
+        label:'否',
+        value:"0"
+      },{
+        label:'是',
+        value:"1"
+      }],
     },
     {
-      label: "状态",
-      prop: "status",
-      type: "select",
-      filterable:true,
-      dataType: "Number",
-      props: {
-        label: "dictValue",
-        value: "dictKey"
-      },
-      dicData:[],
+      label: "防爆",
+      prop: "explosionProof",
       search: true,
-      hide: true,
-      showColumn: false,
       overHidden: true,
-      index: 9
+      type:'select',
+      dicData:[{
+        label:'否',
+        value:0
+      },{
+        label:'是',
+        value:1
+      }],
     },
-    {
-      label: "标签",
-      prop: "label",
-      type: 'checkbox',
-      dataType: "string",
-      props: {
-        label: "dictValue",
-        value: "dictValue"
-      },
-      dicData:[],
-      search: true,
-      multiple:true,
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-      index: 10
-    }
   ]
 }
 export const optionList = {

+ 77 - 29
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -35,10 +35,10 @@
               <!--          <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">-->
               <!--            {{ row.upperFrame == 0 ? '上架' : '下架' }}-->
               <!--          </el-button>-->
-              <el-tooltip :content="`${row.upperFrame == 0?'上架':'下架'}`" placement="top">
+              <el-tooltip :content="`${row.flag == 0?'上架':'下架'}`" placement="top">
                 <el-switch
                     style="margin-left: 10px"
-                    v-model="row.upperFrame"
+                    v-model="row.flag"
                     @change="check(row)"
                     active-value="1"
                     inactive-value="0">
@@ -46,8 +46,6 @@
               </el-tooltip>
             </template>
             <template slot-scope="{type,size,row,$index}" slot="menuLeft">
-              <el-button class="el-icon-plus" type="primary" size="small" @click.stop="$refs.crud.rowAdd()">新增
-              </el-button>
               <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary"
                          size="small"
                          @click="change(row,'up')">批量上架
@@ -56,7 +54,7 @@
                          @click="change(row,'down')">批量下架
               </el-button>
               <el-button class="el-icon-bottom" type="warning"
-                         size="small">
+                         size="small" @click="excelBox = true">
                 导入
               </el-button>
             </template>
@@ -64,16 +62,55 @@
         </el-col>
       </el-row>
     </basic-container>
+    <el-dialog title="添加产品" append-to-body :visible.sync="excelBox" :close-on-click-modal="false" width="555px">
+      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="derivation">
+            点击下载<i class="el-icon-download el-icon--right"></i>
+          </el-button>
+        </template>
+      </avue-form>
+      <p style="text-align: center;color: #DC0505">
+        温馨提示 第一次导入时请先下载模板
+      </p>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import {getList, submit} from "@/api/tirePartsMall/basicData/listingManagement/index.js";
+import {getList, submit,batchOperationProductLaunch} from "@/api/tirePartsMall/basicData/listingManagement/index.js";
+import {getToken} from "@/util/auth";
 
 export default {
   name: "index",
   data() {
     return {
+      excelForm: {},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "模板下载",
+            prop: "excelTemplate",
+            formslot: true,
+            span: 24
+          },
+          {
+            label: "模板上传",
+            prop: "excelFile",
+            type: "upload",
+            drag: true,
+            loadText: "模板上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data"
+            },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/blade-sales-part/productLaunch/import-productLaunch"
+          }
+        ]
+      },
       treeOption: {
         addBtn: false,
         menu: false,
@@ -84,6 +121,7 @@ export default {
           value: "value",
         }
       },
+      excelBox:false,
       corpTypeVisible: false,
       treeData: [],
       loading: false,
@@ -118,24 +156,32 @@ export default {
         highlightCurrentRow: true,
         dialogWidth: "70%",
         column: [{
-          label: '名称',
-          prop: 'storage',
+          label: '商品名称',
+          prop: 'cname',
+          disabled: true,
           overHidden: true,
         }, {
           label: '规格型号',
-          prop: 'balance',
+          prop: 'specificationAndModel',
           overHidden: true,
         }, {
           label: '公司',
-          prop: 'stockPrice',
+          prop: 'salesCompanyId',
           disabled: true,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'fullName',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-system/dept/top-list'
         }, {
           label: '库存',
-          prop: 'stockPrice',
+          prop: 'inventory',
           overHidden: true,
         }, {
           label: '商城价格',
-          prop: 'stockPrice',
+          prop: 'salesPrice',
           overHidden: true,
         }, {
           label: '产品状态',
@@ -147,7 +193,6 @@ export default {
           disabled: true,
           showColumn: false,
           type: 'select',
-          span: 17,
           dicData: [{
             label: "上架",
             value: 1
@@ -176,6 +221,17 @@ export default {
     }
   },
   methods: {
+    derivation() {
+      window.open(
+          `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader
+          }=${getToken()}`
+      );
+    },
+    uploadAfter(res, done, loading, column) {
+      this.excelBox = false;
+      this.refreshChange();
+      done();
+    },
     nodeClick(data) {
       this.search.corpsTypeId = data.value
       this.page.currentPage = 1;
@@ -199,10 +255,7 @@ export default {
     //编辑确定
     rowUpdate(form, index, done, loading) {
       submit({
-        ...form,
-        label: form.label.join(","),
-        ids: form.goodsId,
-        specialOffer: form.salesPrice,
+        ...form
       }).then(res => {
         this.onLoad(this.page, this.search)
         done()
@@ -211,15 +264,11 @@ export default {
       })
     },
     check(row) {
-      if (row.upperFrame == 0) {
+      if (row.flag == 0) {
         if (!Number(row.salesPrice)) return this.$message.error("上架失败,商城价格不能为0")
       }
       submit({
-        ...row,
-        label: row.label.join(","),
-        ids: row.goodsId,
-        upperFrame: row.upperFrame,
-        specialOffer: row.salesPrice,
+        ...row
       }).then(res => {
         this.onLoad(this.page, this.search)
       })
@@ -227,7 +276,7 @@ export default {
     change(row, type) {
       let data = []
       for (let item of this.selectionList) {
-        data.push(item.goodsId)
+        data.push(item.id)
       }
       if (type === "up") {
         for (let item of this.selectionList) {
@@ -238,8 +287,8 @@ export default {
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          submit({
-            upperFrame: 1,
+          batchOperationProductLaunch({
+            flag: 1,
             ids: data.join(",")
           }).then(res => {
             this.onLoad(this.page, this.search)
@@ -252,8 +301,8 @@ export default {
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          submit({
-            upperFrame: 0,
+          batchOperationProductLaunch({
+            flag: 0,
             ids: data.join(",")
           }).then(res => {
             this.onLoad(this.page, this.search)
@@ -315,5 +364,4 @@ export default {
 </script>
 
 <style scoped>
-
 </style>

+ 135 - 57
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -16,12 +16,6 @@
             size="small"
             @click="editCustomer">保存数据
         </el-button>
-        <el-button
-            class="el-button--small-yh"
-            type="primary"
-            size="small"
-            v-if="form.id">启用
-        </el-button>
       </div>
     </div>
     <div style="margin-top: 50px">
@@ -31,7 +25,11 @@
       <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.contactsList"
+            <avue-crud :option="optionContacts"
+                       v-model="formContacts"
+                       ref="formContacts"
+                       :data="form.orderItemsList"
+                       :key="key"
                        @row-save="rowSave"
                        @row-update="rowUpdate"
                        @resetColumn="resetColumnTwo('formContacts','optionContacts','optionContactsBack',269.1)"
@@ -44,13 +42,14 @@
                 >{{ row.$cellEdit ? '确认' : '修改' }}
                 </el-button>
                 <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
-                           @click="rowDelBox(row,index)">删除
+                           @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="form.contactsList"
+            <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
+                       :data="form.paymentRecordsList"
                        @row-save="rowSave"
                        @row-update="rowUpdate"
                        @resetColumn="resetColumnTwo('payment_details','optionPaymentDetails','optionPaymentDetailsBack',269.2)"
@@ -63,13 +62,14 @@
                 >{{ row.$cellEdit ? '确认' : '修改' }}
                 </el-button>
                 <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
-                           @click="rowDelBox(row,index)">删除
+                           @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.contactsList"
+            <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)"
@@ -94,22 +94,32 @@
 </template>
 
 <script>
+import {getDetails, submit} from "@/api/tirePartsMall/salesManagement/saleOrder";
 
 export default {
   name: "detailsPage",
   data() {
     return {
-      activeName:"sale_detail",
+      activeName: "sale_detail",
       disabled: false,
+      key:0,
       form: {
-        contactsList: []
+        orderItemsList: [],
+        paymentRecordsList: [],
+        outboundRecordsList: []
       },
       optionForm: {
         menuBtn: false,
         span: 8,
         column: [{
           label: '客户',
-          prop: "corpId",
+          prop: "customerId",
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH',
           rules: [{
             required: true,
             message: " ",
@@ -117,7 +127,13 @@ export default {
           }]
         }, {
           label: '仓库',
-          prop: "accountId",
+          prop: "storageId",
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/storageDesc/listAll',
           rules: [{
             required: true,
             message: " ",
@@ -125,7 +141,7 @@ export default {
           }]
         }, {
           label: '收货地址',
-          prop: "amount",
+          prop: "recAddress",
           rules: [{
             required: true,
             message: " ",
@@ -133,39 +149,37 @@ export default {
           }]
         }, {
           label: '单据编号',
-          prop: "settlementDate",
+          prop: "ordNo",
         }, {
           label: '来源单号',
-          prop: "settlementDate",
-        }, {
-          label: '业务类型',
-          prop: "settlementDate",
+          prop: "srcOrdNo",
         }, {
           label: '应收类别',
-          prop: "settlementDate",
+          prop: "receivableType",
         }, {
           label: '联系人',
-          prop: "settlementDate",
+          prop: "contacts",
         }, {
           label: '电话',
-          prop: "settlementDate",
+          prop: "phone",
         }, {
           label: '配送方式',
-          prop: "settlementDate",
+          prop: "shipType",
         }, {
           label: '物流公司',
-          prop: "settlementDate",
+          prop: "logisticsCorpName"
         }, {
           label: '备注',
           prop: "remarks",
           type: 'textarea',
-          span: 24,
-          minRows: 2
+          span: 16,
+          minRows: 1
         }]
       },
       formContacts: {},
       optionContacts: {},
       optionContactsBack: {
+        border: true,
         align: 'center',
         index: true,
         addBtnText: "录入明细",
@@ -173,7 +187,7 @@ export default {
         dialogDrag: true,
         addBtn: false,
         span: 8,
-        height: 600,
+        height: 500,
         addRowBtn: true,
         editBtn: false,
         delBtn: false,
@@ -182,64 +196,79 @@ export default {
         dialogWidth: "80%",
         column: [{
           label: '物料编码',
-          prop: 'attn',
+          prop: 'goodsNo',
+          width:100,
           cell: true
         }, {
           label: '商品名称',
-          prop: 'contractNumber',
+          prop: 'goodsId',
+          width:100,
           cell: true
         }, {
           label: '品牌',
-          prop: 'accountsAmount',
+          prop: 'bandr',
+          width:100,
           cell: true
         }, {
           label: '规格型号',
-          prop: 'settlmentAmount',
+          prop: 'propertyName',
+          width:100,
           cell: true
         }, {
           label: '花纹',
-          prop: 'thisAmount',
+          prop: 'pattern',
+          width:100,
           cell: true
         }, {
           label: '商品描述',
-          prop: 'thisAmount',
+          prop: 'goodsDescription',
+          width:100,
           cell: true
         }, {
           label: '数量',
-          prop: 'thisAmount',
+          prop: 'goodsNum',
+          width:100,
           cell: true
         }, {
           label: '单位',
-          prop: 'thisAmount',
+          prop: 'units',
+          type: "select",
+          props: {
+            label: "dictValue",
+            value: "dictValue"
+          },
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+          width:100,
           cell: true
         }, {
           label: '价格',
-          prop: 'thisAmount',
+          prop: 'price',
+          width:100,
           cell: true
         }, {
           label: '发货数量',
-          prop: 'thisAmount',
+          prop: 'sendNum',
+          width:100,
           cell: true
         }, {
           label: '利润',
-          prop: 'thisAmount',
+          prop: 'profit',
+          width:100,
           cell: true
         }, {
           label: '小计',
-          prop: 'thisAmount',
+          prop: 'subTotalMoney',
+          width:100,
           cell: true
         }, {
           label: '返利',
           prop: 'thisAmount',
-          cell: true
-        }, {
-          label: '备注',
-          prop: 'remarks',
+          width:100,
           cell: true
         }]
       },
-      optionPaymentDetails:{},
-      optionPaymentDetailsBack:{
+      optionPaymentDetails: {},
+      optionPaymentDetailsBack: {
         align: 'center',
         index: true,
         addBtnText: "录入明细",
@@ -248,7 +277,7 @@ export default {
         addBtn: false,
         span: 8,
         height: 600,
-        addRowBtn: true,
+        addRowBtn: false,
         editBtn: false,
         delBtn: false,
         menuWidth: 140,
@@ -256,24 +285,24 @@ export default {
         dialogWidth: "80%",
         column: [{
           label: '支付编号',
-          prop: 'attn',
+          prop: 'paymentNumber',
           cell: true
         }, {
           label: '金额',
-          prop: 'contractNumber',
+          prop: 'amount',
           cell: true
         }, {
           label: '类型',
-          prop: 'accountsAmount',
+          prop: 'paymentType',
           cell: true
         }, {
           label: '支付时间',
-          prop: 'settlmentAmount',
+          prop: 'paymentTime',
           cell: true
         }]
       },
-      optionOutboundRecords:{},
-      optionOutboundRecordsBack:{
+      optionOutboundRecords: {},
+      optionOutboundRecordsBack: {
         align: 'center',
         index: true,
         addBtnText: "录入明细",
@@ -282,7 +311,7 @@ export default {
         addBtn: false,
         span: 8,
         height: 600,
-        addRowBtn: true,
+        addRowBtn: false,
         editBtn: false,
         delBtn: false,
         menuWidth: 140,
@@ -312,13 +341,62 @@ export default {
       }
     }
   },
+  props: {
+    onLoad: Object,
+    detailData: Object
+  },
   async created() {
     this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
     this.optionPaymentDetails = await this.getColumnData(this.getColumnName(269.2), this.optionPaymentDetailsBack);
     this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.2), this.optionOutboundRecordsBack);
+    this.key++
+    if (this.onLoad.id && this.detailData.id) {
+      this.refresh(this.onLoad.id, true)
+    } else if (this.onLoad.id) {
+      this.refresh(this.onLoad.id, true)
+    }
   },
   methods: {
-    rowDelBox(row, index) {
+    //修改提交触发
+    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)'
+          });
+          submit({
+            bsType:"XS",
+            ...this.form
+          }).then(res => {
+            this.$message.success("保存成功");
+            loading.close();
+          }).finally(() => {
+            loading.close();
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    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
+        loading.close();
+      }).catch(() => {
+        loading.close();
+      })
+    },
+    rowDelBox(row, index,type) {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -330,7 +408,7 @@ export default {
             //   this.$message.success("操作成功!");
             // });
           } else {
-            this.form.contactsList.splice(index, 1);
+            this.form[type].splice(index, 1);
             this.$message.success("操作成功!");
           }
         }

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

@@ -34,7 +34,7 @@
 </template>
 
 <script>
-import {getList, remove} from "@/api/oceanShipping/maritimeExport/index.js";
+import {getList, remove} from "@/api/tirePartsMall/salesManagement/saleOrder";
 import detailsPage from "./detailsPage"
 
 export default {
@@ -235,7 +235,7 @@ export default {
         ...params,
         current: page.currentPage,
         size: page.pageSize,
-        billType: "HYCK",
+        bsType: "XS",
         ...Object.assign(params, this.search)
       }
       this.loading = true