Browse Source

bug 修复

lilei 4 years ago
parent
commit
ca9a9e4698

+ 18 - 14
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -146,7 +146,7 @@
             :dataSource="loadData"
             :dataSource="loadData"
             :pagination="pagination"
             :pagination="pagination"
             @change="getProductList"
             @change="getProductList"
-            :scroll="{ x: 1560 }"
+            :scroll="{ x: 1560, y: 300 }"
             bordered>
             bordered>
             <!-- 类别 -->
             <!-- 类别 -->
             <template slot="type" slot-scope="text, record">
             <template slot="type" slot-scope="text, record">
@@ -181,7 +181,8 @@
               <a-button
               <a-button
                 :loading="record.addLoading"
                 :loading="record.addLoading"
                 size="small"
                 size="small"
-                type="link"
+                type="primary"
+                class="button-info"
                 @click="handleAdd(record)"
                 @click="handleAdd(record)"
                 id="warehouseAllocationEdit-add-btn">添加</a-button>
                 id="warehouseAllocationEdit-add-btn">添加</a-button>
             </template>
             </template>
@@ -239,16 +240,18 @@
             </a-col>
             </a-col>
             <a-col :span="7">
             <a-col :span="7">
               <!-- 暂不做 -->
               <!-- 暂不做 -->
-              <!-- <a-button size="small" type="primary" id="warehouseAllocationEdit-pladd-btn" style="margin-bottom: 8px;">批量添加</a-button> -->
-              <a-button size="small" id="warehouseAllocationEdit-import-btn" style="margin-left: 8px">导入明细
-              </a-button>
-              <a-button
-                size="small"
-                :loading="delLoading"
-                @click="handleDel({},0)"
-                type="danger"
-                id="warehouseAllocationEdit-del-all-btn"
-                style="margin: 0 0 8px 8px;">整单删除</a-button>
+              <div style="float:right;overflow: hidden;">
+                <!-- <a-button size="small" type="primary" id="warehouseAllocationEdit-pladd-btn" style="margin-bottom: 8px;">批量添加</a-button> -->
+                <a-button size="small" id="warehouseAllocationEdit-import-btn" style="margin-left: 8px">导入明细
+                </a-button>
+                <a-button
+                  size="small"
+                  :loading="delLoading"
+                  @click="handleDel({},0)"
+                  type="danger"
+                  id="warehouseAllocationEdit-del-all-btn"
+                  style="margin: 0 0 8px 8px;">整单删除</a-button>
+              </div>
             </a-col>
             </a-col>
           </a-row>
           </a-row>
           <!-- 列表 -->
           <!-- 列表 -->
@@ -259,7 +262,7 @@
             :rowKey="(record) => record.id"
             :rowKey="(record) => record.id"
             :columns="chooseColumns"
             :columns="chooseColumns"
             :data="chooseLoadData"
             :data="chooseLoadData"
-            :scroll="{ x: 1460 }"
+            :scroll="{ x: 1460, y: 300 }"
             bordered>
             bordered>
             <!-- 类别 -->
             <!-- 类别 -->
             <template slot="type" slot-scope="text, record">
             <template slot="type" slot-scope="text, record">
@@ -296,7 +299,8 @@
             <template slot="action" slot-scope="text, record">
             <template slot="action" slot-scope="text, record">
               <a-button
               <a-button
                 size="small"
                 size="small"
-                type="link"
+                type="primary"
+                class="button-error"
                 @click="handleDel(record,1)"
                 @click="handleDel(record,1)"
                 id="warehouseAllocationEdit-del-btn">删除</a-button>
                 id="warehouseAllocationEdit-del-btn">删除</a-button>
             </template>
             </template>

+ 160 - 124
src/views/allocationManagement/warehouseAllocation/list.vue

@@ -2,11 +2,7 @@
   <a-card size="small" :bordered="false" class="warehouseAllocationList-wrap">
   <a-card size="small" :bordered="false" class="warehouseAllocationList-wrap">
     <!-- 搜索条件 -->
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
     <div class="table-page-search-wrapper">
-      <a-form
-        layout="inline"
-        ref="searchForm"
-        :model="queryParam"
-        @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" ref="searchForm" :model="queryParam" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
             <a-form-item label="创建时间">
@@ -16,34 +12,21 @@
                 :disabledDate="disabledDate"
                 :disabledDate="disabledDate"
                 v-model="creatDate"
                 v-model="creatDate"
                 :format="dateFormat"
                 :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+                :placeholder="['开始时间', '结束时间']"
+              />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :md="6" :sm="24">
           <a-col :md="6" :sm="24">
             <a-form-item label="调出仓库">
             <a-form-item label="调出仓库">
-              <a-select
-                id="warehouseAllocation-basicInfo-outWarehouseSn"
-                allowClear
-                placeholder="请选择调出仓库"
-                v-model="queryParam.outWarehouseSn"
-              >
-                <a-select-option v-for="item in warehouseList" :value="item.warehouseSn">
-                  {{ item.name }}
-                </a-select-option>
+              <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
+                <a-select-option v-for="item in warehouseList" :value="item.warehouseSn">{{ item.name }}</a-select-option>
               </a-select>
               </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :md="6" :sm="24">
           <a-col :md="6" :sm="24">
             <a-form-item label="调入仓库">
             <a-form-item label="调入仓库">
-              <a-select
-                id="warehouseAllocation-basicInfo-putWarehouseSn"
-                allowClear
-                placeholder="请选择调入仓库"
-                v-model="queryParam.putWarehouseSn"
-              >
-                <a-select-option v-for="item in warehouseList" :value="item.warehouseSn">
-                  {{ item.name }}
-                </a-select-option>
+              <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
+                <a-select-option v-for="item in warehouseList" :value="item.warehouseSn">{{ item.name }}</a-select-option>
               </a-select>
               </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
@@ -56,69 +39,64 @@
                   id="warehouseAllocationList-state"
                   id="warehouseAllocationList-state"
                   code="ALLOCATION_WAREHOUSE_STATE"
                   code="ALLOCATION_WAREHOUSE_STATE"
                   placeholder="请选择单据状态"
                   placeholder="请选择单据状态"
-                  allowClear></v-select>
+                  allowClear
+                ></v-select>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
           </template>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
           <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
+            <a @click="advanced = !advanced" style="margin-left: 8px">
               {{ advanced ? '收起' : '展开' }}
               {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
+              <a-icon :type="advanced ? 'up' : 'down'" />
             </a>
             </a>
           </a-col>
           </a-col>
         </a-row>
         </a-row>
       </a-form>
       </a-form>
     </div>
     </div>
     <!-- 操作按钮 -->
     <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="warehouseAllocationList-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
-    </div>
+    <div class="table-operator"><a-button id="warehouseAllocationList-add" type="primary" class="button-error" @click="openModal = true">新增</a-button></div>
     <!-- 列表 -->
     <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1435 }"
-      bordered>
+    <s-table class="sTable" ref="table" size="default" :rowKey="record => record.id" :columns="columns" :data="loadData" :scroll="{ x: 1435 }" bordered>
       <!-- 状态 -->
       <!-- 状态 -->
       <template slot="state" slot-scope="text, record">
       <template slot="state" slot-scope="text, record">
-        <a-tag >{{ text }}</a-tag>
+        {{ text }}
       </template>
       </template>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
-        <a-button v-if="record.stateDictValue=='待审核'" size="small" type="link" @click="handleExamine(record)" id="warehouseAllocationList-examine-btn">审核</a-button>
-        <a-divider v-if="record.stateDictValue=='待审核'" type="vertical" style="margin: 0;" />
-        <a-button v-if="record.stateDictValue!='已完结'" size="small" type="link" @click="handleEdit(record)" id="warehouseAllocationList-edit-btn">编辑</a-button>
-        <a-divider v-if="record.stateDictValue!='已完结'" type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="warehouseAllocationList-detail-btn">详情</a-button>
-        <a-divider v-if="record.stateDictValue!='已完结'" type="vertical" style="margin: 0;" />
-        <a-button v-if="record.stateDictValue!='已完结'" size="small" type="link" @click="handleDel(record)" id="warehouseAllocationList-del-btn">删除</a-button>
+        <a-button v-if="record.stateDictValue == '待审核'" size="small" type="primary" class="button-warning" @click="handleExamine(record)" id="warehouseAllocationList-examine-btn">
+          审核
+        </a-button>
+        <a-button v-if="record.stateDictValue != '已完结'" size="small" type="primary" class="button-info" @click="handleEdit(record)" id="warehouseAllocationList-edit-btn">
+          编辑
+        </a-button>
+        <a-button size="small" type="primary" class="button-success" @click="handleDetail(record)" id="warehouseAllocationList-detail-btn">详情</a-button>
+        <a-button v-if="record.stateDictValue != '已完结'" size="small" type="primary" class="button-error" @click="handleDel(record)" id="warehouseAllocationList-del-btn">
+          删除
+        </a-button>
       </template>
       </template>
     </s-table>
     </s-table>
     <!-- 新增/编辑 -->
     <!-- 新增/编辑 -->
-    <basic-info-modal :openModal="openModal" @ok="handleEdit" @close="openModal=false" />
+    <basic-info-modal :openModal="openModal" @ok="handleEdit" @close="openModal = false" />
   </a-card>
   </a-card>
 </template>
 </template>
 
 
 <script>
 <script>
-import { allocWarehouseList, allocWarehouseAudit, allocWarehouseDelete } from '@/api/allocWarehouse'
-import { warehouseAllList } from '@/api/warehouse.js'
-import { STable, VSelect } from '@/components'
-import basicInfoModal from './basicInfoModal.vue'
-import moment from 'moment'
+import { allocWarehouseList, allocWarehouseAudit, allocWarehouseDelete } from '@/api/allocWarehouse';
+import { warehouseAllList } from '@/api/warehouse.js';
+import { STable, VSelect } from '@/components';
+import basicInfoModal from './basicInfoModal.vue';
+import moment from 'moment';
 export default {
 export default {
   components: { STable, VSelect, basicInfoModal },
   components: { STable, VSelect, basicInfoModal },
-  data () {
+  data() {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
       creatDate: undefined, //  创建时间
       creatDate: undefined, //  创建时间
-	  warehouseList: [], // 仓库列表
-      queryParam: { //  查询条件
+      warehouseList: [], // 仓库列表
+      queryParam: {
+        //  查询条件
         outWarehouseSn: undefined, //  调出仓库
         outWarehouseSn: undefined, //  调出仓库
         putWarehouseSn: undefined, //  调入仓库
         putWarehouseSn: undefined, //  调入仓库
         state: undefined //  审核状态
         state: undefined //  审核状态
@@ -128,126 +106,184 @@ export default {
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '单号', dataIndex: 'allocationWarehouseNo', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '调出仓库', dataIndex: 'outWarehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调入仓库', dataIndex: 'putWarehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        {
+          title: '单号',
+          dataIndex: 'allocationWarehouseNo',
+          align: 'center',
+          ellipsis: true,
+          customRender: function(text) {
+            return text || '--';
+          }
+        },
+        {
+          title: '调出仓库',
+          dataIndex: 'outWarehouseName',
+          width: 140,
+          align: 'center',
+          customRender: function(text) {
+            return text || '--';
+          },
+          ellipsis: true
+        },
+        {
+          title: '调入仓库',
+          dataIndex: 'putWarehouseName',
+          width: 140,
+          align: 'center',
+          customRender: function(text) {
+            return text || '--';
+          },
+          ellipsis: true
+        },
+        {
+          title: '总款数',
+          dataIndex: 'productTotalCategory',
+          width: 100,
+          align: 'center',
+          customRender: function(text) {
+            return text || text == 0 ? text : '--';
+          }
+        },
+        {
+          title: '总数量',
+          dataIndex: 'productTotalQty',
+          width: 100,
+          align: 'center',
+          customRender: function(text) {
+            return text || text == 0 ? text : '--';
+          }
+        },
+        {
+          title: '总成本',
+          dataIndex: 'productTotalCost',
+          width: 100,
+          align: 'center',
+          customRender: function(text) {
+            return text || text == 0 ? text : '--';
+          }
+        },
+        {
+          title: '审核时间',
+          dataIndex: 'auditTime',
+          width: 160,
+          align: 'center',
+          customRender: function(text) {
+            return text || '--';
+          }
+        },
         { title: '状态', dataIndex: 'stateDictValue', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
         { title: '状态', dataIndex: 'stateDictValue', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 215, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 300, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
-        this.disabled = true
+        this.disabled = true;
         // 创建时间
         // 创建时间
         if (this.creatDate && this.creatDate.length > 0) {
         if (this.creatDate && this.creatDate.length > 0) {
-          this.queryParam.beginDate = moment(this.creatDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.creatDate[1]).format(this.dateFormat)
+          this.queryParam.beginDate = moment(this.creatDate[0]).format(this.dateFormat);
+          this.queryParam.endDate = moment(this.creatDate[1]).format(this.dateFormat);
         } else {
         } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
+          this.queryParam.beginDate = undefined;
+          this.queryParam.endDate = undefined;
         }
         }
         return allocWarehouseList(Object.assign(parameter, this.queryParam)).then(res => {
         return allocWarehouseList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
+          const data = res.data;
+          const no = (data.pageNo - 1) * data.pageSize;
           for (var i = 0; i < data.list.length; i++) {
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+            data.list[i].no = no + i + 1;
           }
           }
-          this.disabled = false
-          return data
-        })
+          this.disabled = false;
+          return data;
+        });
       },
       },
       openModal: false, //  新增编辑  弹框
       openModal: false, //  新增编辑  弹框
       itemId: '' //  当前品牌id
       itemId: '' //  当前品牌id
-    }
+    };
   },
   },
   methods: {
   methods: {
     // 不可选日期
     // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    disabledDate(date, dateStrings) {
+      return date && date.valueOf() > Date.now();
     },
     },
     // 获取仓库列表
     // 获取仓库列表
-    getWarehouseList () {
-	  warehouseAllList({}).then(res => {
-		  console.log(res, '-----仓库----')
-	    if (res.status == 200) {
-	      this.warehouseList = res.data || []
-	    } else {
-	      this.warehouseList = []
-	    }
-	  })
+    getWarehouseList() {
+      warehouseAllList({}).then(res => {
+        console.log(res, '-----仓库----');
+        if (res.status == 200) {
+          this.warehouseList = res.data || [];
+        } else {
+          this.warehouseList = [];
+        }
+      });
     },
     },
     //  重置
     //  重置
-    resetSearchForm () {
-      this.queryParam.outWarehouseSn = undefined
-      this.queryParam.putWarehouseSn = undefined
-      this.queryParam.state = undefined
-      this.creatDate = undefined
-      this.$refs.table.refresh(true)
+    resetSearchForm() {
+      this.queryParam.outWarehouseSn = undefined;
+      this.queryParam.putWarehouseSn = undefined;
+      this.queryParam.state = undefined;
+      this.creatDate = undefined;
+      this.$refs.table.refresh(true);
     },
     },
     //  基本信息  保存
     //  基本信息  保存
-    handleOk (data) {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/add` })
+    handleOk(data) {
+      this.$router.push({ path: `/allocationManagement/warehouseAllocation/add` });
     },
     },
     //  删除
     //  删除
-    handleDel (row) {
-      const _this = this
+    handleDel(row) {
+      const _this = this;
       this.$confirm({
       this.$confirm({
         title: '提示',
         title: '提示',
         content: '删除后不可恢复,确定要进行删除吗?',
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         centered: true,
-        onOk () {
+        onOk() {
           allocWarehouseDelete({
           allocWarehouseDelete({
             id: row.id
             id: row.id
           }).then(res => {
           }).then(res => {
-            console.log(res, 'res1111')
+            console.log(res, 'res1111');
             if (res.status == 200) {
             if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
+              _this.$message.success(res.message);
+              _this.$refs.table.refresh();
             }
             }
-          })
+          });
         }
         }
-      })
+      });
     },
     },
     //  审核
     //  审核
-    handleExamine (row) {
-      const _this = this
+    handleExamine(row) {
+      const _this = this;
       this.$confirm({
       this.$confirm({
         title: '提示',
         title: '提示',
         content: '确认要审核通过吗?',
         content: '确认要审核通过吗?',
         centered: true,
         centered: true,
-        onOk () {
+        onOk() {
           allocWarehouseAudit({
           allocWarehouseAudit({
             id: row.id
             id: row.id
           }).then(res => {
           }).then(res => {
-            console.log(res, 'res1111')
+            console.log(res, 'res1111');
             if (res.status == 200) {
             if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
+              _this.$message.success(res.message);
+              _this.$refs.table.refresh();
             }
             }
-          })
+          });
         }
         }
-      })
+      });
     },
     },
     //  详情
     //  详情
-    handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.id}/${row.allocationWarehouseSn}` })
+    handleDetail(row) {
+      this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.id}/${row.allocationWarehouseSn}` });
     },
     },
     //  新增/编辑
     //  新增/编辑
-    handleEdit (row) {
-		  this.$router.push({ path: `/allocationManagement/warehouseAllocation/edit/${row.id}/${row.allocationWarehouseSn}` })
+    handleEdit(row) {
+      this.$router.push({ path: `/allocationManagement/warehouseAllocation/edit/${row.id}/${row.allocationWarehouseSn}` });
     }
     }
   },
   },
-  beforeRouteEnter (to, from, next) {
-  	next(vm => {
-      vm.queryParam.outWarehouseSn = undefined
-      vm.queryParam.putWarehouseSn = undefined
-      vm.queryParam.state = undefined
-      vm.creatDate = undefined
-      vm.getWarehouseList()
-    })
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      vm.queryParam.outWarehouseSn = undefined;
+      vm.queryParam.putWarehouseSn = undefined;
+      vm.queryParam.state = undefined;
+      vm.creatDate = undefined;
+      vm.getWarehouseList();
+    });
   }
   }
-}
+};
 </script>
 </script>

+ 7 - 0
src/views/common/editInput.js

@@ -1,6 +1,9 @@
 const EditableCell = {
 const EditableCell = {
   template: `
   template: `
       <div style="display:flex;align-items: center;">
       <div style="display:flex;align-items: center;">
+        <span>
+        {{punit}} 
+        </span>
         <div class="editable-cell-input-wrapper">
         <div class="editable-cell-input-wrapper">
           <a-input-number 
           <a-input-number 
           size="small" 
           size="small" 
@@ -37,6 +40,10 @@ const EditableCell = {
     max: {
     max: {
       type: [Number],
       type: [Number],
       default: 999999
       default: 999999
+    },
+    punit: {
+      type: String,
+      default: ''
     }
     }
   },
   },
   data() {
   data() {

+ 26 - 11
src/views/customerManagement/customerInfo/edit.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div class="customerManagementEdit-wrap">
   <div class="customerManagementEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="customerManagementEdit-back">
+    <a-page-header :ghost="false" :backIcon="false" v-if="model=='page'" class="customerManagementEdit-back">
       <!-- 自定义的二级文字标题 -->
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
       <template slot="subTitle">
         <a id="customerManagementEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         <a id="customerManagementEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
@@ -32,7 +32,7 @@
               <a-input id="customerManagementEdit-contactTel" :maxLength="11" v-model.trim="form.contactTel" placeholder="请输入联系电话(最多11个字符)" allowClear />
               <a-input id="customerManagementEdit-contactTel" :maxLength="11" v-model.trim="form.contactTel" placeholder="请输入联系电话(最多11个字符)" allowClear />
             </a-form-model-item>
             </a-form-model-item>
           </a-col>
           </a-col>
-          <a-col :span="8">
+          <a-col :span="8" v-if="model=='page'">
             <a-form-model-item label="联系人" prop="contactName">
             <a-form-model-item label="联系人" prop="contactName">
               <a-input id="customerManagementEdit-contactName" :maxLength="30" v-model.trim="form.contactName" placeholder="请输入联系人(最多30个字符)" allowClear />
               <a-input id="customerManagementEdit-contactName" :maxLength="30" v-model.trim="form.contactName" placeholder="请输入联系人(最多30个字符)" allowClear />
             </a-form-model-item>
             </a-form-model-item>
@@ -73,7 +73,7 @@
             </a-form-model-item>
             </a-form-model-item>
           </a-col>
           </a-col>
         </a-row>
         </a-row>
-        <a-row :gutter="15">
+        <a-row :gutter="15" v-if="model=='page'">
           <a-col :span="8">
           <a-col :span="8">
             <a-form-model-item label="客户传真" prop="fax">
             <a-form-model-item label="客户传真" prop="fax">
               <a-input id="customerManagementEdit-fax" :maxLength="30" v-model.trim="form.fax" placeholder="请输入客户传真(最多30个字符)" allowClear />
               <a-input id="customerManagementEdit-fax" :maxLength="30" v-model.trim="form.fax" placeholder="请输入客户传真(最多30个字符)" allowClear />
@@ -109,7 +109,7 @@
               </a-select>
               </a-select>
             </a-form-model-item>
             </a-form-model-item>
           </a-col>
           </a-col>
-          <a-col :span="8">
+          <a-col :span="8" v-if="model=='page'">
             <a-form-model-item label="客户类型" prop="customerTypeSn">
             <a-form-model-item label="客户类型" prop="customerTypeSn">
               <a-select id="customerManagementEdit-customerTypeSn" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型">
               <a-select id="customerManagementEdit-customerTypeSn" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型">
                 <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
                 <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
@@ -133,6 +133,12 @@ import { custTypeFindAllList } from '@/api/custType'
 export default {
 export default {
   name: 'CustomerManagementEdit',
   name: 'CustomerManagementEdit',
   components: { STable, VSelect },
   components: { STable, VSelect },
+  props: {
+    model: {
+      type: String,
+      default: 'page'
+    }
+  },
   data () {
   data () {
     return {
     return {
       formItemLayout: {
       formItemLayout: {
@@ -163,6 +169,7 @@ export default {
         provinceSn: [{ required: true, message: '请选择省', trigger: 'change' }],
         provinceSn: [{ required: true, message: '请选择省', trigger: 'change' }],
         citySn: [{ required: true, message: '请选择市', trigger: 'change' }],
         citySn: [{ required: true, message: '请选择市', trigger: 'change' }],
         countySn: [{ required: true, message: '请选择区/县', trigger: 'change' }],
         countySn: [{ required: true, message: '请选择区/县', trigger: 'change' }],
+        customerAddr: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
         priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
         settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
         settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
       },
       },
@@ -224,9 +231,13 @@ export default {
           custSave(form).then(res => {
           custSave(form).then(res => {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$message.success(res.message)
-              setTimeout(() => {
-                _this.$router.push({ path: '/customerManagement/customerInfo/list' })
-              }, 1000)
+              if (_this.model == 'page') {
+                setTimeout(() => {
+                  _this.$router.push({ path: '/customerManagement/customerInfo/list' })
+                }, 600)
+              } else {
+                _this.$emit('ok', res.data)
+              }
             }
             }
           })
           })
         } else {
         } else {
@@ -298,14 +309,18 @@ export default {
           }
           }
         }
         }
       })
       })
+    },
+    // 获取基础数据
+    getBaseData () {
+      this.getArea('province') //  省市区
+      this.getCustTypeList() //  客户类型
+      this.getSettleStyleList() // 收款方式
+      this.$refs.ruleForm.resetFields()
     }
     }
   },
   },
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {
     next(vm => {
     next(vm => {
-      vm.getArea('province') //  省市区
-      vm.getCustTypeList() //  客户类型
-      vm.getSettleStyleList() // 收款方式
-      vm.$refs.ruleForm.resetFields()
+      vm.getBaseData()
       if (vm.$route.params.id) {
       if (vm.$route.params.id) {
         //  编辑页
         //  编辑页
         vm.getDetail()
         vm.getDetail()

+ 89 - 78
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -19,22 +19,13 @@
     >
     >
       <a-row :gutter="15">
       <a-row :gutter="15">
         <a-col :span="8">
         <a-col :span="8">
-          <a-form-model-item v-if="isNew" label="客户名称" prop="buyerName">
-            <a-input
-              id="chooseCustom-buyerName"
-              :maxLength="60"
-              v-model="form.buyerName"
-              placeholder="请输入客户名称"
-              allowClear />
-          </a-form-model-item>
-          <a-form-model-item v-else label="客户名称" prop="buyerSn">
+          <a-form-model-item label="客户名称" prop="buyerSn">
             <a-select
             <a-select
               id="chooseCustom-buyerSn"
               id="chooseCustom-buyerSn"
               show-search
               show-search
               placeholder="请选择客户"
               placeholder="请选择客户"
               v-model="form.buyerSn"
               v-model="form.buyerSn"
               :filter-option="filterOption"
               :filter-option="filterOption"
-              @select="custSelect"
               @change="custChange">
               @change="custChange">
               <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
               <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
             </a-select>
             </a-select>
@@ -42,8 +33,8 @@
         </a-col>
         </a-col>
         <a-col :span="16">
         <a-col :span="16">
           <a-form-model-item>
           <a-form-model-item>
-            <a-button type="dashed" @click="custModeChange" :icon="!isNew?'plus':'check'">{{ !isNew?'新增':'选择' }}</a-button>
-            ({{ !isNew?'点击新增按钮直接输入客户名称':'点击选择按钮直接选择客户' }}
+            <a-button type="dashed" @click="openNewCust" icon="plus">新增</a-button>
+            (击新增按钮新增客户
           </a-form-model-item>
           </a-form-model-item>
         </a-col>
         </a-col>
       </a-row>
       </a-row>
@@ -116,7 +107,7 @@
               <a-col :span="20">
               <a-col :span="20">
                 <v-select
                 <v-select
                   code="PRICE_TYPE"
                   code="PRICE_TYPE"
-                  :disabled="isEdit"
+                  :disabled="priceTypeDisabled"
                   id="chooseCustom-priceType"
                   id="chooseCustom-priceType"
                   v-model="form.priceType"
                   v-model="form.priceType"
                   allowClear
                   allowClear
@@ -137,8 +128,12 @@
           </a-form-model-item>
           </a-form-model-item>
         </a-col> -->
         </a-col> -->
         <a-col :span="8">
         <a-col :span="8">
-          <a-form-model-item label="收款方式" prop="settleStyle">
-            <v-select code="SETTLE_STYLE_NAME" id="chooseCustom-settleStyle" v-model="form.settleStyle" allowClear placeholder="请选择收款方式"></v-select>
+          <a-form-model-item label="收款方式" prop="settleStyleSn">
+            <a-select placeholder="请选择收款方式" v-model="form.settleStyleSn">
+              <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
+                {{ item.name }}
+              </a-select-option>
+            </a-select>
           </a-form-model-item>
           </a-form-model-item>
         </a-col>
         </a-col>
         <a-col :span="8">
         <a-col :span="8">
@@ -182,6 +177,17 @@
         <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
         <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
       </a-form-model-item>
       </a-form-model-item>
     </a-form-model>
     </a-form-model>
+    <!-- 新增客户 -->
+    <a-modal
+      v-model="isNewCust"
+      title="新增客户"
+      centered
+      width="60%"
+      :maskClosable="false"
+      :footer="null"
+    >
+      <CustomerManagementEdit ref="newCust" model="modal" @ok="newCustFun"></CustomerManagementEdit>
+    </a-modal>
   </a-modal>
   </a-modal>
 </template>
 </template>
 
 
@@ -190,10 +196,12 @@ import { getArea } from '@/api/data'
 import { custAllList, custFindById, custSave, updateByCustomerSn } from '@/api/customer'
 import { custAllList, custFindById, custSave, updateByCustomerSn } from '@/api/customer'
 import { salesSave } from '@/api/sales'
 import { salesSave } from '@/api/sales'
 import { getUserAllList } from '@/api/power-user'
 import { getUserAllList } from '@/api/power-user'
+import { settleStyleQueryAll } from '@/api/settleStyle'
 import { VSelect } from '@/components'
 import { VSelect } from '@/components'
+import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
 export default {
 export default {
   name: 'ChooseCustomModal',
   name: 'ChooseCustomModal',
-  components: { VSelect },
+  components: { VSelect, CustomerManagementEdit },
   props: {
   props: {
     show: [Boolean]
     show: [Boolean]
   },
   },
@@ -201,12 +209,12 @@ export default {
     return {
     return {
       opened: this.show,
       opened: this.show,
       title: '选择客户',
       title: '选择客户',
-      isNew: false,
       confirmLoading: false,
       confirmLoading: false,
       formItemLayout: {
       formItemLayout: {
         labelCol: { span: 8 },
         labelCol: { span: 8 },
         wrapperCol: { span: 16 }
         wrapperCol: { span: 16 }
       },
       },
+      buyerSnBak: '', // 更改前客户sn备份
       form: {
       form: {
         buyerName: '', // 客户名称
         buyerName: '', // 客户名称
         buyerSn: undefined, // 客户sn
         buyerSn: undefined, // 客户sn
@@ -223,7 +231,7 @@ export default {
         dispatchType: undefined, //  配送方式
         dispatchType: undefined, //  配送方式
         satelliteFlag: 0, //  是否卫星仓客户
         satelliteFlag: 0, //  是否卫星仓客户
         priceType: undefined, //  价格类型
         priceType: undefined, //  价格类型
-        settleStyle: '', //  收款方式
+        settleStyleSn: '', //  收款方式
         salesManSn: undefined, //  业务员
         salesManSn: undefined, //  业务员
         salesManName: '',
         salesManName: '',
         distributionFlag: '0', // 铺货出库
         distributionFlag: '0', // 铺货出库
@@ -231,9 +239,6 @@ export default {
         remarks: '' //  备注
         remarks: '' //  备注
       },
       },
       rules: {
       rules: {
-        buyerName: [
-          { required: true, message: '请输入客户名称', trigger: ['change', 'blur'] }
-        ],
         buyerSn: [
         buyerSn: [
           { required: true, message: '请选择客户', trigger: ['change', 'blur'] }
           { required: true, message: '请选择客户', trigger: ['change', 'blur'] }
         ],
         ],
@@ -255,7 +260,7 @@ export default {
         priceType: [
         priceType: [
           { required: true, message: '请选择价格类型', trigger: ['change', 'blur'] }
           { required: true, message: '请选择价格类型', trigger: ['change', 'blur'] }
         ],
         ],
-        settleStyle: [
+        settleStyleSn: [
           { required: true, message: '请选择收款方式', trigger: ['change', 'blur'] }
           { required: true, message: '请选择收款方式', trigger: ['change', 'blur'] }
         ],
         ],
         distributionFlag: [
         distributionFlag: [
@@ -270,64 +275,73 @@ export default {
       addrCityList: [], //  市下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
       addrDistrictList: [], //  区下拉
       userList: [], // 业务员 下拉
       userList: [], // 业务员 下拉
+      settleStyleList: [], // 收款方式
       custId: undefined, // 客户id
       custId: undefined, // 客户id
-      isEdit: false, //  是否可编辑
+      isEdit: false, //  是否编辑状态
+      priceTypeDisabled: false, // 价格类型可编辑
       isChangeCust: false, // 是否更换客户
       isChangeCust: false, // 是否更换客户
-      interId: null
+      interId: null,
+      isNewCust: false // 是否新增客户
     }
     }
   },
   },
   methods: {
   methods: {
-    custModeChange () {
-      this.isNew = !this.isNew
-      this.isEdit = false
-      this.form.buyerName = ''
-      this.$refs.ruleForm.resetFields()
-      this.custId = undefined
+    openNewCust () {
+      this.isNewCust = true
+      setTimeout(() => {
+        this.$refs.newCust.getBaseData()
+      }, 500)
+    },
+    // 新建客户
+    newCustFun (data) {
+      console.log(data)
+      this.isNewCust = false
+      // 更新客户信息
+      this.custAllList.unshift(data)
+      setTimeout(() => {
+        this.custChange(data.customerSn)
+      }, 300)
     },
     },
     // 业务员
     // 业务员
     salesManChange (id) {
     salesManChange (id) {
       this.form.salesManName = this.userList.find(item => item.id == id).name
       this.form.salesManName = this.userList.find(item => item.id == id).name
     },
     },
-    // 客户 select
-    custSelect (v) {
-      console.log(v, 'custSelect')
+    // 客户 change
+    custChange (val) {
+      console.log(val, 'custChange')
       const _this = this
       const _this = this
-      const cust = this.custAllList.find(item => item.customerSn == v)
+      const cust = this.custAllList.find(item => item.customerSn == val)
+      // 编辑
       if (this.isEdit) {
       if (this.isEdit) {
-        // 变更了客户信息
-        if (cust.customerSn !== this.form.customerSn) {
-          this.isChangeCust = true
-          this.$confirm({
-            title: '提示',
-            content: '更换客户后信息需要重新完善,确认要更换吗?',
-            centered: true,
-            onOk () {
-              _this.custId = cust.id
-              _this.form.buyerName = cust.customerName
-              _this.isEdit = false
-              _this.getDetail()
-            }
-          })
-          return
-        }
+        this.$confirm({
+          title: '提示',
+          content: '更换客户后信息需要重新完善,确认要更换吗?',
+          centered: true,
+          onOk () {
+            _this.custId = cust.id
+            _this.form.buyerName = cust.customerName
+            _this.priceTypeDisabled = false
+            _this.getDetail()
+          },
+          onCancel () {
+            _this.form.buyerSn = _this.buyerSnBak
+          }
+        })
+      } else {
+        _this.custId = cust.id
+        _this.form.buyerName = cust.customerName
+        _this.getDetail()
       }
       }
-      this.custId = cust.id
-      this.form.buyerName = cust.customerName
-      this.getDetail()
-    },
-    // 客户 change
-    custChange (val) {
-      this.$refs.ruleForm.resetFields()
-      this.custId = undefined
     },
     },
     // 编辑客户信息
     // 编辑客户信息
     editCust (data) {
     editCust (data) {
       console.log(data)
       console.log(data)
       this.title = '编辑客户信息'
       this.title = '编辑客户信息'
       this.isEdit = true
       this.isEdit = true
+      this.priceTypeDisabled = true
       if (data.shippingAddressProvinceSn) { this.getArea('city', data.shippingAddressProvinceSn) }
       if (data.shippingAddressProvinceSn) { this.getArea('city', data.shippingAddressProvinceSn) }
       if (data.shippingAddressCitySn) { this.getArea('district', data.shippingAddressCitySn) }
       if (data.shippingAddressCitySn) { this.getArea('district', data.shippingAddressCitySn) }
       this.form = Object.assign(this.form, data)
       this.form = Object.assign(this.form, data)
+      this.buyerSnBak = this.form.buyerSn
     },
     },
     //  获取详情
     //  获取详情
     getDetail () {
     getDetail () {
@@ -352,7 +366,7 @@ export default {
             dispatchType: data.dispatchType, //  配送方式
             dispatchType: data.dispatchType, //  配送方式
             satelliteFlag: data.satelliteFlag, //  是否卫星仓客户
             satelliteFlag: data.satelliteFlag, //  是否卫星仓客户
             priceType: data.priceType, //  价格类型
             priceType: data.priceType, //  价格类型
-            settleStyle: data.settleStyleSn //  收款方式
+            settleStyleSn: data.settleStyleSn //  收款方式
           })
           })
         } else {
         } else {
           this.$message.error('获取客户信息失败')
           this.$message.error('获取客户信息失败')
@@ -365,6 +379,7 @@ export default {
     handleSaveCust () {
     handleSaveCust () {
       const params = {
       const params = {
         customerName: this.form.buyerName,
         customerName: this.form.buyerName,
+        customerSn: this.form.buyerSn,
         contactTel: this.form.consigneeTel, //  联系电话
         contactTel: this.form.consigneeTel, //  联系电话
         contactName: this.form.consigneeName, //  联系人
         contactName: this.form.consigneeName, //  联系人
         provinceSn: this.form.shippingAddressProvinceSn, //  省
         provinceSn: this.form.shippingAddressProvinceSn, //  省
@@ -376,26 +391,13 @@ export default {
         customerAddr: this.form.shippingAddress, //  详细地址
         customerAddr: this.form.shippingAddress, //  详细地址
         dispatchType: this.form.dispatchType, //  配送方式
         dispatchType: this.form.dispatchType, //  配送方式
         priceType: this.form.priceType, //  价格类型
         priceType: this.form.priceType, //  价格类型
-        settleStyleSn: this.form.settleStyle //  收款方式
-      }
-      // 更新
-      if (this.form.buyerSn) {
-        params.customerSn = this.form.buyerSn
-        updateByCustomerSn(params).then(res => {
-          if (res.status != 200) {
-            this.$message.error(res.message)
-          }
-        })
-      } else {
-        // 新建
-        params.id = null
-        params.satelliteFlag = 0 //  是否卫星仓客户
-        custSave(params).then(res => {
-          if (res.status != 200) {
-            this.$message.error(res.message)
-          }
-        })
+        settleStyleSn: this.form.settleStyleSn //  收款方式
       }
       }
+      updateByCustomerSn(params).then(res => {
+        if (res.status != 200) {
+          this.$message.error(res.message)
+        }
+      })
     },
     },
     //  保存
     //  保存
     handleSubmit (e) {
     handleSubmit (e) {
@@ -516,6 +518,14 @@ export default {
       return (
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
       )
+    },
+    // 获取收款方式
+    getSettleStyle () {
+      settleStyleQueryAll().then(res => {
+        if (res.status == 200) {
+          this.settleStyleList = res.data
+        }
+      })
     }
     }
   },
   },
   watch: {
   watch: {
@@ -525,6 +535,7 @@ export default {
         this.getArea('province')
         this.getArea('province')
         this.getCustAllList()
         this.getCustAllList()
         this.getUserAllList()
         this.getUserAllList()
+        this.getSettleStyle()
       }
       }
     }
     }
   }
   }

+ 25 - 6
src/views/salesManagement/salesQuery/detail.vue

@@ -58,6 +58,16 @@
         bordered>
         bordered>
       </s-table>
       </s-table>
     </a-card>
     </a-card>
+    <a-card size="small" :bordered="false" class="footer-cont">
+      <a-button
+        type="primary"
+        class="button-info"
+        size="large"
+        style="width: 150px;"
+        v-if="detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_STOCK'"
+        @click="handleEdit()"
+        id="salesDetail-edit-btn">编辑</a-button>
+    </a-card>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -88,14 +98,14 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折后售价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '折后售价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center' },
-        { title: '折后小计', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '折后小计', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center' },
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center' },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
         { title: '销售类型', dataIndex: 'salesBillType', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
         { title: '销售类型', dataIndex: 'salesBillType', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
@@ -133,6 +143,11 @@ export default {
     handleBack () {
     handleBack () {
       this.$router.push({ name: 'salesQueryList' })
       this.$router.push({ name: 'salesQueryList' })
     },
     },
+    // 编辑
+    handleEdit () {
+      const row = this.detailData
+      this.$router.push({ name: 'salesEdit', params: { id: row.id, sn: row.salesBillSn } })
+    },
     //  详情
     //  详情
     getDetail () {
     getDetail () {
       salesDetail({ id: this.$route.params.id }).then(res => {
       salesDetail({ id: this.$route.params.id }).then(res => {
@@ -155,5 +170,9 @@ export default {
     .salesDetail-cont{
     .salesDetail-cont{
       margin-bottom: 15px;
       margin-bottom: 15px;
     }
     }
+    .footer-cont{
+      margin-top: 5px;
+      text-align: center;
+    }
   }
   }
 </style>
 </style>

+ 56 - 6
src/views/salesManagement/salesQuery/edit.vue

@@ -20,7 +20,25 @@
     <a-card size="small" :bordered="false" class="salesEdit-cont">
     <a-card size="small" :bordered="false" class="salesEdit-cont">
       <!-- 总计 -->
       <!-- 总计 -->
       <a-alert style="margin-bottom: 15px;" type="info">
       <a-alert style="margin-bottom: 15px;" type="info">
-        <div slot="message">总售价:<strong>{{ detailData&&detailData.totalAmount || 0 }}</strong>;总款数:<strong>{{ detailData&&detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData&&detailData.totalQty || 0 }}</strong>;赠品总数量:<strong>{{ detailData&&detailData.giftQty || 0 }}</strong>;</div>
+        <div slot="message" class="total-bar">
+          <div>
+            总售价:<strong>¥{{ detailData&&detailData.totalAmount || 0 }}</strong>;
+            总款数:<strong>{{ detailData&&detailData.totalCategory || 0 }}</strong>;
+            总数量:<strong>{{ detailData&&detailData.totalQty || 0 }}</strong>;
+            赠品总数量:<strong>{{ detailData&&detailData.giftQty || 0 }}</strong>;
+          </div>
+          <div>
+            <div>
+              折扣金额:
+              <a-input-number id="discount" v-model="detailData.discountAmount" :min="0" :precision="2" :max="999999"/>
+              <a-button type="primary" @click="salesDiscount" class="button-info">打折</a-button>
+            </div>
+            <div>
+              折扣:<strong>{{ detailData&&detailData.discountRate || 0 }}%</strong>;
+              折后总售价:<strong>¥{{ detailData&&detailData.discountedAmount || 0 }}</strong>;
+            </div>
+          </div>
+        </div>
       </a-alert>
       </a-alert>
       <!-- 查询条件 -->
       <!-- 查询条件 -->
       <a-row :gutter="15">
       <a-row :gutter="15">
@@ -63,6 +81,7 @@
             :max="999999"
             :max="999999"
             :min="0"
             :min="0"
             :precision="2"
             :precision="2"
+            punit="¥"
             @change="onCellChange(record.id, 'price', $event)" />
             @change="onCellChange(record.id, 'price', $event)" />
         </template>
         </template>
         <!-- 销售数量 -->
         <!-- 销售数量 -->
@@ -102,7 +121,7 @@
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
-import { salesDetail, salesWriteSubmit } from '@/api/sales'
+import { salesDetail, salesWriteSubmit, salesWriteDiscount } from '@/api/sales'
 import EditableCell from '@/views/common/editInput.js'
 import EditableCell from '@/views/common/editInput.js'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
 export default {
 export default {
@@ -115,7 +134,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       isInster: false, // 是否正在添加产品
       isInster: false, // 是否正在添加产品
       openModal: false, // 客户弹框
       openModal: false, // 客户弹框
-      detailData: null, // 订单基础数据
+      detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
       dataSource: [],
       productForm: {
       productForm: {
         dealerProductEntity: {
         dealerProductEntity: {
@@ -206,6 +225,23 @@ export default {
     handleBack () {
     handleBack () {
       this.$router.push({ name: 'salesQueryList' })
       this.$router.push({ name: 'salesQueryList' })
     },
     },
+    // 打折
+    salesDiscount () {
+      if (this.detailData.discountAmount <= 0) {
+        return
+      }
+      console.log(this.detailData)
+      salesWriteDiscount({
+        discountAmount: this.detailData.discountAmount,
+        salesBillSn: this.detailData.salesBillSn,
+        id: this.detailData.id
+      }).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm()
+        }
+        this.$message.info(res.message)
+      })
+    },
     // 整单删除
     // 整单删除
     delSalerDetailAll () {
     delSalerDetailAll () {
       salesDetailDelAll({ salesBillSn: this.detailData.salesBillSn }).then(res => {
       salesDetailDelAll({ salesBillSn: this.detailData.salesBillSn }).then(res => {
@@ -272,9 +308,8 @@ export default {
     getOrderDetail () {
     getOrderDetail () {
       salesDetail({ id: this.$route.params.id }).then(res => {
       salesDetail({ id: this.$route.params.id }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
-          this.detailData = res.data
-        } else {
-          this.detailData = null
+          this.detailData = Object.assign({}, this.detailData, res.data)
+          console.log(this.detailData)
         }
         }
       })
       })
     },
     },
@@ -304,6 +339,21 @@ export default {
     .salesEdit-cont{
     .salesEdit-cont{
       margin-top: 15px;
       margin-top: 15px;
     }
     }
+    .total-bar{
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      > div{
+        &:last-child{
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          > div{
+            padding: 0 10px;
+          }
+        }
+      }
+    }
   }
   }
 
 
 </style>
 </style>

+ 34 - 27
src/views/salesManagement/salesQuery/list.vue

@@ -42,13 +42,11 @@
             </a-col>
             </a-col>
             <a-col :md="6" :sm="24">
             <a-col :md="6" :sm="24">
               <a-form-item label="收款方式">
               <a-form-item label="收款方式">
-                <v-select
-                  v-model="queryParam.settleStyle"
-                  ref="settleStyle"
-                  id="salesManagementList-settleStyle"
-                  code="SETTLE_STYLE_NAME"
-                  placeholder="请选择收款方式"
-                  allowClear></v-select>
+                <a-select placeholder="请选择收款方式" v-model="queryParam.settleStyleSn">
+                  <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
+                    {{ item.name }}
+                  </a-select-option>
+                </a-select>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :md="6" :sm="24">
             <a-col :md="6" :sm="24">
@@ -110,17 +108,9 @@
       :data="loadData"
       :data="loadData"
       :scroll="{ x: 2040, y:300 }"
       :scroll="{ x: 2040, y:300 }"
       bordered>
       bordered>
-      <!-- 业务/审核状态 -->
-      <template slot="billStatus" slot-scope="text, record">
-        <a-tag :color="record.state=='FINISH'?'green':'red'" >{{ record.billStatus }}</a-tag>
-      </template>
-      <!-- 财务状态 -->
-      <template slot="financialStatus" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.financialStatus }}</a-tag>
-      </template>
       <!-- 急件 -->
       <!-- 急件 -->
       <template slot="oosFlag" slot-scope="text, record">
       <template slot="oosFlag" slot-scope="text, record">
-        <a-tag :color="record.oosFlag==1?'red':'#ccc'" >{{ record.oosFlag==1?'有':'无' }}</a-tag>
+        <a-tag :color="record.oosFlag==1?'red':'#ccc'" >{{ record.oosFlagDictValue }}</a-tag>
       </template>
       </template>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
@@ -131,20 +121,26 @@
           v-if="record.billStatus == 'WAIT_AUDIT'"
           v-if="record.billStatus == 'WAIT_AUDIT'"
           @click="handleEexamine(record)"
           @click="handleEexamine(record)"
           id="salesManagementList-eexamine-btn">审核</a-button>
           id="salesManagementList-eexamine-btn">审核</a-button>
-        <a-button size="small" type="primary" class="button-primary" @click="handleSend(record)" id="salesManagementList-send-btn">出库</a-button>
-        <a-button size="small" type="primary" class="button-success" @click="handleDetail(record)" id="salesManagementList-detail-btn">详情</a-button>
+        <a-button
+          size="small"
+          type="primary"
+          v-if="record.billStatus == 'WAIT_OUT_STOCK'"
+          class="button-primary"
+          @click="handleSend(record)"
+          id="salesManagementList-send-btn">出库</a-button>
         <a-button
         <a-button
           size="small"
           size="small"
           type="primary"
           type="primary"
           class="button-info"
           class="button-info"
-          v-if="record.billStatus !== 'CANCEL' && record.billStatus !== 'FINISH'"
+          v-if="record.billStatus !== 'CANCEL' && record.billStatus !== 'FINISH' && record.billStatus != 'WAIT_OUT_STOCK'"
           @click="handleEdit(record)"
           @click="handleEdit(record)"
           id="salesManagementList-edit-btn">编辑</a-button>
           id="salesManagementList-edit-btn">编辑</a-button>
+        <a-button size="small" type="primary" class="button-success" @click="handleDetail(record)" id="salesManagementList-detail-btn">明细</a-button>
         <a-button
         <a-button
           size="small"
           size="small"
           type="primary"
           type="primary"
           class="button-error"
           class="button-error"
-          v-if="record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT'"
+          v-if="record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT' || record.billStatus == 'WAIT_OUT_STOCK' || record.billStatus == 'CANCEL'"
           @click="handleDel(record)"
           @click="handleDel(record)"
           id="salesManagementList-del-btn">删除</a-button>
           id="salesManagementList-del-btn">删除</a-button>
       </template>
       </template>
@@ -160,6 +156,7 @@ import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import { custAllList } from '@/api/customer'
 import { custAllList } from '@/api/customer'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount } from '@/api/sales'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount } from '@/api/sales'
+import { settleStyleQueryAll } from '@/api/settleStyle'
 export default {
 export default {
   name: 'TableList',
   name: 'TableList',
   components: { STable, VSelect, chooseCustomModal },
   components: { STable, VSelect, chooseCustomModal },
@@ -171,13 +168,14 @@ export default {
       time: [], //  创建时间
       time: [], //  创建时间
       openModal: false, // 选择客户弹框是否显示
       openModal: false, // 选择客户弹框是否显示
       custAllList: [], //  客户 下拉数据
       custAllList: [], //  客户 下拉数据
+      settleStyleList: [], // 收款方式
       // 查询参数
       // 查询参数
       queryParam: {
       queryParam: {
         buyerName: undefined, //  客户名称
         buyerName: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         salesBillNo: '', //  销售单号
         purchaseBillNo: '', //  采购单号
         purchaseBillNo: '', //  采购单号
         payType: undefined, //  支付方式
         payType: undefined, //  支付方式
-        settleStyle: undefined, //  收款方式
+        settleStyleSn: undefined, //  收款方式
         billStatus: undefined, //  业务状态
         billStatus: undefined, //  业务状态
         financialStatus: undefined //  财务状态
         financialStatus: undefined //  财务状态
       },
       },
@@ -191,18 +189,18 @@ export default {
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '来源', dataIndex: 'salesBillSource', width: 160, align: 'center' },
+        { title: '来源', dataIndex: 'salesBillSourceDictValue', width: 120, align: 'center' },
         { title: '销售单号', dataIndex: 'salesBillNo', width: 180, align: 'center' },
         { title: '销售单号', dataIndex: 'salesBillNo', width: 180, align: 'center' },
         { title: '采购单号', dataIndex: 'purchaseBillNo', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购单号', dataIndex: 'purchaseBillNo', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收款方式', dataIndex: 'settleStyle', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总售价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '收款方式', dataIndex: 'settleStyleEntity.name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '急件', dataIndex: 'oosFlag', scopedSlots: { customRender: 'oosFlag' }, width: 100, align: 'center' },
         { title: '急件', dataIndex: 'oosFlag', scopedSlots: { customRender: 'oosFlag' }, width: 100, align: 'center' },
-        { title: '业务状态', scopedSlots: { customRender: 'billStatus' }, width: 110, align: 'center' },
-        { title: '财务状态', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' },
+        { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 110, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 300, align: 'center', fixed: 'right' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 300, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
@@ -341,7 +339,7 @@ export default {
       this.queryParam.salesBillNo = ''
       this.queryParam.salesBillNo = ''
       this.queryParam.purchaseBillNo = ''
       this.queryParam.purchaseBillNo = ''
       this.queryParam.payType = undefined
       this.queryParam.payType = undefined
-      this.queryParam.settleStyle = undefined
+      this.queryParam.settleStyleSn = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
       this.queryParam.financialStatus = undefined
       this.time = []
       this.time = []
@@ -351,11 +349,20 @@ export default {
       return (
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
       )
+    },
+    // 获取收款方式
+    getSettleStyle () {
+      settleStyleQueryAll().then(res => {
+        if (res.status == 200) {
+          this.settleStyleList = res.data
+        }
+      })
     }
     }
   },
   },
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {
     next(vm => {
     next(vm => {
       vm.getCustAllList()
       vm.getCustAllList()
+      vm.getSettleStyle()
     })
     })
   }
   }
 }
 }

+ 15 - 5
src/views/salesManagement/salesQuery/queryPart.vue

@@ -100,7 +100,7 @@
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
       :customRow="handleClickRow"
       :customRow="handleClickRow"
-      :scroll="{ x: 1530, y: 300 }"
+      :scroll="{ x: tableWidth, y: 300 }"
       :pageSize="30"
       :pageSize="30"
       bordered>
       bordered>
       <!-- 售价 -->
       <!-- 售价 -->
@@ -145,6 +145,7 @@
       v-model="showSetting"
       v-model="showSetting"
       title="设置要显示的列"
       title="设置要显示的列"
       centered
       centered
+      :footer="null"
       @ok="() => (showSetting = false)"
       @ok="() => (showSetting = false)"
     >
     >
       <a-checkbox-group v-model="settingColVal" @change="onSettingChange">
       <a-checkbox-group v-model="settingColVal" @change="onSettingChange">
@@ -180,6 +181,7 @@ export default {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
       showSetting: false, // 设置弹框
       showSetting: false, // 设置弹框
+      tableWidth: 1800,
       settingColVal: ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit'],
       settingColVal: ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit'],
       settingColList: [
       settingColList: [
         { label: '原厂编码', value: 'productOrigCode' },
         { label: '原厂编码', value: 'productOrigCode' },
@@ -189,7 +191,7 @@ export default {
         { label: '库存数量', value: 'currentQty' },
         { label: '库存数量', value: 'currentQty' },
         { label: '单位', value: 'unit' },
         { label: '单位', value: 'unit' },
         { label: '成本价', value: 'putCost' },
         { label: '成本价', value: 'putCost' },
-        { label: '市级价', value: 'cityPrice' }
+        { label: '市级价', value: 'dealerProduct.cityPrice' }
       ],
       ],
       productType: [],
       productType: [],
       queryParam: { //  查询条件
       queryParam: { //  查询条件
@@ -210,13 +212,15 @@ export default {
       columnsBak: [
       columnsBak: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'productName', align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center' },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center' },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center' },
         { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true },
         { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true },
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', sorter: true },
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', sorter: true },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
         { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center' },
         { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center' },
         { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
         { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
@@ -253,23 +257,29 @@ export default {
   },
   },
   created () {
   created () {
     this.columns = this.columnsBak
     this.columns = this.columnsBak
+    this.onSettingChange()
   },
   },
   methods: {
   methods: {
     // 设置列
     // 设置列
     onSettingChange (v) {
     onSettingChange (v) {
+      const k = ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit', 'putCost', 'dealerProduct.cityPrice']
       const a = ['no', 'productCode', 'productName']
       const a = ['no', 'productCode', 'productName']
       const b = ['price', 'salesNums', 'action']
       const b = ['price', 'salesNums', 'action']
       const c = this.settingColVal
       const c = this.settingColVal
-      const r = a.concat(c).concat(b)
+      const q = k.filter(item => c.indexOf(item) >= 0)
+      const r = a.concat(q).concat(b)
       const d = []
       const d = []
+      let w = 0
       for (let i = 0; i < r.length; i++) {
       for (let i = 0; i < r.length; i++) {
         const row = this.columnsBak.find(item => item.dataIndex == r[i])
         const row = this.columnsBak.find(item => item.dataIndex == r[i])
         if (row) {
         if (row) {
+          w = w + row.width
           d.push(row)
           d.push(row)
         }
         }
       }
       }
+      console.log(w)
+      this.tableWidth = w
       this.columns = d
       this.columns = d
-      console.log(d)
     },
     },
     // 双击列表
     // 双击列表
     handleClickRow (record) {
     handleClickRow (record) {