Explorar el Código

Merge branch 'develop_yh15' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh15

chenrui hace 2 años
padre
commit
f619699bae
Se han modificado 29 ficheros con 107 adiciones y 106 borrados
  1. 1 1
      public/version.json
  2. 1 1
      src/api/allocLinkageOut.js
  3. 1 1
      src/api/purchaseDetail.js
  4. 1 1
      src/api/sales.js
  5. 10 1
      src/api/salesDetail.js
  6. 1 1
      src/api/salesReturn.js
  7. 1 1
      src/api/sparePartsPur.js
  8. 3 3
      src/views/allocationManagement/chainTransferOut/edit.vue
  9. 3 3
      src/views/allocationManagement/warehouseAllocation/edit.vue
  10. 1 1
      src/views/bulkManagement/bulkReturnGoods/edit.vue
  11. 2 2
      src/views/inventoryManagement/inventoryChecking/selfDisk.vue
  12. 0 1
      src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue
  13. 3 3
      src/views/purchasingManagement/purchaseReturn/edit.vue
  14. 1 0
      src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue
  15. 3 3
      src/views/purchasingManagement/purchaseReturnOutSync/edit.vue
  16. 3 3
      src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue
  17. 1 1
      src/views/salesManagement/salesQuery/carInfoModal.vue
  18. 1 1
      src/views/salesManagement/salesQuery/edit.vue
  19. 1 1
      src/views/salesManagement/salesQuery/productSalesRecordModal.vue
  20. 1 1
      src/views/salesManagement/salesQueryNew/carInfoModal.vue
  21. 10 1
      src/views/salesManagement/salesQueryNew/chooseProductModal.vue
  22. 2 7
      src/views/salesManagement/salesQueryNew/chooseShelfProduct.vue
  23. 1 1
      src/views/salesManagement/salesQueryNew/detail.vue
  24. 47 61
      src/views/salesManagement/salesQueryNew/edit.vue
  25. 1 1
      src/views/salesManagement/salesQueryNew/list.vue
  26. 1 1
      src/views/salesManagement/salesQueryNew/productSalesRecordModal.vue
  27. 3 2
      src/views/salesManagement/salesReturn/salesReturnEdit.vue
  28. 2 1
      src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue
  29. 1 1
      vue.config.js

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1677831484666
+  "version": 1678151237231
 }

+ 1 - 1
src/api/allocLinkageOut.js

@@ -88,7 +88,7 @@ export const allocLinkageOutDetailDel = (params) => {
     method: 'get'
   })
 }
-//  连锁调拨调出  详情  整单删除
+//  连锁调拨调出  详情  清空列表
 export const allocLinkageOutDetailDelAll = (params) => {
   return axios({
     url: `/allocLinkageOut/detail/deleteAll/${params.sn}`,

+ 1 - 1
src/api/purchaseDetail.js

@@ -26,7 +26,7 @@ export const purchaseDetailDel = (params) => {
     method: 'get'
   })
 }
-//  采购详情 整单删除
+//  采购详情 清空列表
 export const purchaseDetailDelAll = (params) => {
   return axios({
     url: `/purchaseDetail/deleteAll/${params.id}`,

+ 1 - 1
src/api/sales.js

@@ -110,7 +110,7 @@ export const salesSave = (params) => {
 //  销售 删除
 export const salesDel = (params) => {
   return axios({
-    url: `/sales/delete/${params.id}`,
+    url: `/sales/delete`,
     data: params,
     method: 'post'
   })

+ 10 - 1
src/api/salesDetail.js

@@ -11,6 +11,15 @@ export const salesDetailList = (params) => {
     method: 'post'
   })
 }
+
+// 查询已经添加的产品sn数组
+export const queryCheckedList = (params) => {
+  return axios({
+    url: `/salesDetail/queryProductSnListBySalesBillSn/${params.salesBillSn}`,
+    method: 'post'
+  })
+}
+
 //  销售详情 新增配件
 export const salesDetailInsert = (params) => {
   return axios({
@@ -50,7 +59,7 @@ export const salesDetailDel = (params) => {
     method: 'get'
   })
 }
-//  销售详情 整单删除
+//  销售详情 清空列表
 export const salesDetailDelAll = (params) => {
   return axios({
     url: `/salesDetail/deleteBySalesBillSn/${params.salesBillSn}`,

+ 1 - 1
src/api/salesReturn.js

@@ -23,7 +23,7 @@ export const salesReturnDetailDel = (params) => {
   })
 }
 
-//  销售退货明细 整单删除
+//  销售退货明细 清空列表
 export const salesReturnDelAll = (params) => {
   return axios({
     url: `/salesReturn/detail/deleteAll/${params.sn}`,

+ 1 - 1
src/api/sparePartsPur.js

@@ -50,7 +50,7 @@ export const sparePartsPurDel = (params) => {
     method: 'get'
   })
 }
-// 整单删除
+// 清空列表
 export const sparePartsPurDeleteAll = (params) => {
   return axios({
     url: `/sparePartsPur/detail/deleteAll/${params.sn}`,

+ 3 - 3
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -140,7 +140,7 @@
               </a-col>
               <a-col :span="7" style="text-align: right;">
                 <!-- <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button> -->
-                <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+                <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">清空列表</a-button>
               </a-col>
             </a-row>
             <!-- 列表 -->
@@ -369,13 +369,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             allocLinkageOutDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 3 - 3
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -149,7 +149,7 @@
               <a-col :span="6">
                 <div style="margin-top: 4px;text-align: right;">
                   <!-- <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button> -->
-                  <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
+                  <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">清空列表</a-button>
                 </div>
               </a-col>
             </a-row>
@@ -423,14 +423,14 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
           let params
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             params = { allocationWarehouseSn: _this.$route.params.sn }
           } else { //  单个删除
             params = {

+ 1 - 1
src/views/bulkManagement/bulkReturnGoods/edit.vue

@@ -416,7 +416,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要清空已选产品列表吗',
+        content: '确认要清空已选产品列表吗',
         centered: true,
         onOk () {
           _this.spinning = true

+ 2 - 2
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -178,7 +178,7 @@
               class="button-error"
               style="margin-left: 5px"
               @click.stop="handleDel('', 'all')"
-              id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+              id="chainTransferOutEdit-del-all-btn">清空列表</a-button>
           </a-col>
         </a-row>
         <!-- 列表 -->
@@ -461,7 +461,7 @@ export default {
         }
         content = '删除后不可恢复,确定要进行批量删除吗?'
       } else if (isAll == 'all') { // 全部
-        content = '删除后不可恢复,确定要进行整单删除吗?'
+        content = '删除后不可恢复,确定要清空列表吗?'
       } else { // 单个
         content = '删除后不可恢复,确定要进行删除吗?'
       }

+ 0 - 1
src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue

@@ -248,7 +248,6 @@ export default {
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(this.isDealerUp ? 4 : 3, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
-
       return arr
     }
   },

+ 3 - 3
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -102,7 +102,7 @@
                 class="button-error"
                 id="purchaseReturnEdit-delAll-btn"
                 @click.stop="handleDel('', 'all')"
-                style="margin-right: 10px;float: right;">整单删除</a-button>
+                style="margin-right: 10px;float: right;">清空列表</a-button>
             </template>
             <!-- 列表 -->
             <s-table
@@ -330,13 +330,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 1 - 0
src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue

@@ -140,6 +140,7 @@
                   ghost
                   class="button-error"
                   id="purchaseReturnEdit-delAll-btn"
+                  :disabled="dataSource.length == 0"
                   @click.stop="handleDel('', 'all')"
                 >清空列表</a-button>
               </div>

+ 3 - 3
src/views/purchasingManagement/purchaseReturnOutSync/edit.vue

@@ -114,7 +114,7 @@
                 class="button-error"
                 id="purchaseReturnEdit-delAll-btn"
                 @click.stop="handleDel('', 'all')"
-                style="margin-right: 10px;float: right;">整单删除</a-button> -->
+                style="margin-right: 10px;float: right;">清空列表</a-button> -->
             </template>
             <!-- 总计 -->
             <a-alert type="info" style="margin-bottom:10px">
@@ -404,13 +404,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 3 - 3
src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue

@@ -104,7 +104,7 @@
                 class="button-error"
                 id="purchaseReturnEdit-delAll-btn"
                 @click.stop="handleDel('', 'all')"
-                style="margin-right: 10px;float: right;">整单删除</a-button> -->
+                style="margin-right: 10px;float: right;">清空列表</a-button> -->
             </template>
             <!-- 总计 -->
             <a-alert type="info" style="margin-bottom:10px">
@@ -394,13 +394,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 1 - 1
src/views/salesManagement/salesQuery/carInfoModal.vue

@@ -35,7 +35,7 @@
           <a-divider style="margin: 12px 0;" />
         </div>
         <a-descriptions bordered :column="2" size="small" v-if="infoData&&infoData.params" class="head-info-main">
-          <a-descriptions-item v-for="item in infoData.params" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
+          <a-descriptions-item v-for="item in infoData.params" :key="item.type_name" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
         </a-descriptions>
         <div class="btn-cont"><a-button id="carInfoDetail-modal-back" @click="isShow = false">返回</a-button></div>
       </div>

+ 1 - 1
src/views/salesManagement/salesQuery/edit.vue

@@ -528,7 +528,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要整单删除吗?',
+        content: '确认要清空列表吗?',
         centered: true,
         closable: true,
         onOk () {

+ 1 - 1
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -12,8 +12,8 @@
       :width="960">
       <div>
         <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
-          <div>产品名称:{{ baseData.productName }}</div>
           <div>产品编码:{{ baseData.productCode }}</div>
+          <div>产品名称:{{ baseData.productName }}</div>
         </div>
         <a-tabs size="small" type="card" v-model="curTab" @change="callback">
           <a-tab-pane key="1" tab="当前客户">

+ 1 - 1
src/views/salesManagement/salesQueryNew/carInfoModal.vue

@@ -35,7 +35,7 @@
           <a-divider style="margin: 12px 0;" />
         </div>
         <a-descriptions bordered :column="2" size="small" v-if="infoData&&infoData.params" class="head-info-main">
-          <a-descriptions-item v-for="item in infoData.params" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
+          <a-descriptions-item v-for="item in infoData.params" :key="item.type_name" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
         </a-descriptions>
         <div class="btn-cont"><a-button id="carInfoDetail-modal-back" @click="isShow = false">返回</a-button></div>
       </div>

+ 10 - 1
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -181,11 +181,13 @@
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button
+          <span style="color:#999;" v-if="hasChecked(record)">已添加</span>
+          <a-button
           size="small"
           type="link"
           class="button-primary"
           @click="handleAdd(record)"
+          v-else
           id="productInfoList-edit-btn">添加</a-button>
         <a-button
           size="small"
@@ -242,6 +244,10 @@ export default {
     },
     newLoading: {
       type: Boolean
+    },
+    checkedList: {
+      type: Array,
+      default:() => []
     }
   },
   watch: {
@@ -406,6 +412,9 @@ export default {
     }
   },
   methods: {
+    hasChecked(item){
+      return this.checkedList.includes(item.productSn)
+    },
     // 查询
     searchForm () {
       if (this.hasVaild) {

+ 2 - 7
src/views/salesManagement/salesQueryNew/chooseShelfProduct.vue

@@ -171,8 +171,6 @@
         </a-tab-pane>
       </a-tabs>
     </a-spin>
-    <!-- 销售记录 -->
-    <product-salesRecord-modal ref="salseRecord" :openModal="showRecord" @close="showRecord=false" />
   </a-drawer>
 </template>
 
@@ -180,11 +178,10 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
 import ProductType from '../../common/productType.js'
-import productSalesRecordModal from './productSalesRecordModal.vue'
 import { queryWaitReplenish, queryShelfProduct } from '@/api/shelfReplenish'
 export default {
   name: 'OutinDetailModal',
-  components: { STable, ProductType, productSalesRecordModal },
+  components: { STable, ProductType },
   mixins: [commonMixin],
   props: {
     openModal: {
@@ -211,7 +208,6 @@ export default {
     return {
       spinning: false,
       advanced: false,
-      showRecord: false,
       isShow: this.openModal, //  是否打开弹框
       options: [
         { label: '库存充足', value: 'stockEnough' },
@@ -334,8 +330,7 @@ export default {
     },
     // 销售记录
     handleDetail (row) {
-      this.showRecord = true
-      this.$refs.salseRecord.getDetail(this.baseData.customerSn, row.productSn, row)
+      this.$emit('viewRecord',row)
     },
     // 表格选中项
     rowSelectionFun (obj) {

+ 1 - 1
src/views/salesManagement/salesQueryNew/detail.vue

@@ -152,7 +152,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return salesDetailList(Object.assign(parameter, { salesBillSn: this.outBizSn || this.$route.params.sn })).then(res => {
+        return salesDetailList(Object.assign(parameter, { orderBy: "sales_bill_detail.CREATE_DATE desc", salesBillSn: this.outBizSn || this.$route.params.sn })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data

+ 47 - 61
src/views/salesManagement/salesQueryNew/edit.vue

@@ -94,23 +94,7 @@
               </a-row>
             </a-form-model>
           </div>
-          <div class="discount-box">
-            <div>
-            折扣金额:
-            <a-input-number
-              id="discount"
-              size="small"
-              v-model.trim="detailData.discountAmount"
-              :min="0"
-              :precision="2"
-              :max="999999"/>
-            <a-button size="small" type="primary" class="button-primary" @click="salesDiscount">打折</a-button>
-          </div>
-          <div style="padding:0 10px;">
-            折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
-            折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
-          </div>
-          </div>
+          
           <!-- 已选配件列表 -->
           <s-table
             class="sTable"
@@ -227,21 +211,33 @@
         <!-- 总计 -->
         <div v-if="detailData" class="total-bar">
           <div>
+            <div style="display: inline-block;">
+              折扣金额:
+              <a-input-number
+                id="discount"
+                size="small"
+                v-model.trim="detailData.discountAmount"
+                @blur="salesDiscount"
+                :min="0"
+                :precision="2"
+                :max="999999"/>
+              折扣:<span class="red">{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</span>,
+            </div>
             <div style="display: inline-block;">
               <span>共计 {{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }} 款</span>
-              <span> {{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }} 件产品,</span>
-              赠品总数量:<span class="red">{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</span>,
+              <span> {{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }} 件产品</span>
+              <span>(赠品 {{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }} 件)</span>,
               <template v-if="isCosts">
                 总成本价:<span class="red">{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</span>,
                 毛利:<span class="red">{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</span>,
               </template>
-              总售价:<span class="red">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</span>;
+              总售价:<span class="red">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</span>
             </div>
             <div class="totalPrice" style="display: inline-block;">
               折后合计:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>
             </div>
           </div>
-          <div>
+          <div style="padding:5px 0 0;">
             <a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox>
             <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox>
             <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
@@ -277,6 +273,7 @@
     <chooseProductModal
       ref="partQuery"
       :showModal="openChooseProduct"
+      :checkedList = "checkedProductList"
       @viewRecord="hanldSalesRecord" 
       @close="openChooseProduct=false"
       @add="insterProduct"
@@ -285,6 +282,7 @@
     <chooseShelfProduct
       v-if="showShelfModal"
       ref="chooseShelfProduct"
+      @viewRecord="hanldSalesRecord" 
       @add="insterProduct"
       @plAdd="plInsterProduct"
       :baseData="shelfInfo"
@@ -305,7 +303,7 @@ import productSalesRecordModal from './productSalesRecordModal.vue'
 import { stockByProductSn } from '@/api/stock'
 import { queryByCustomerSn } from '@/api/shelf'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
-import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
+import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport, queryCheckedList } from '@/api/salesDetail'
 import outInDetialModal from './outInDetialModal.vue'
 import chooseShelfProduct from './chooseShelfProduct.vue'
 import PrintPanel from '@/views/common/printPanel.vue'
@@ -334,6 +332,7 @@ export default {
       openSettleModal: false, // 打开收款弹框
       enableFundAccount: false, // 是否开启资金账户管理
       showShelfModal: false, // 货架产品弹框
+      checkedProductList: [], // 已选所有产品
       delLoading: false,
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
@@ -351,7 +350,7 @@ export default {
         this.disabled = true
         this.spinning = true
         this.productForm.salesBillSn = this.$route.params.sn
-        console.log(111)
+        this.getChoosedList({salesBillSn: this.$route.params.sn})
         return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
           let data
           if (res.status == 200) {
@@ -371,7 +370,8 @@ export default {
       },
       printerType: 'NEEDLE', //  打印机类型
       isCosts: false, // 是否显示成本价
-      shelfInfo: null // 是否有货架
+      shelfInfo: null, // 是否有货架
+      discountAmountBak: null
     }
   },
   computed: {
@@ -423,11 +423,11 @@ export default {
       if(e.key == 3){
         this.showShelfModal=true
       }
-      if(e.key == 2){
+      if(e.key == 2){ // 清空列表
         this.delSalerOrder()
       }
-      if(e.key == 1){
-        // this.delJijian()
+      if(e.key == 1){ // 删除急件
+        this.delSalerOrder(1)
       }
     },
     // 打印预览/快捷打印
@@ -467,6 +467,12 @@ export default {
       this.openSalesRecordModal = true
       this.$refs.salseRecord.getDetail(this.detailData.buyerSn, row.productSn, row)
     },
+    // 查询已选所以产品
+    getChoosedList(params){
+      queryCheckedList(params).then(res => {
+        this.checkedProductList = res.data || []
+      })
+    },
     // 更新产品列表
     updateData (priceType) {
       // 价格类型变更
@@ -582,6 +588,9 @@ export default {
     },
     // 打折
     salesDiscount () {
+      if(this.discountAmountBak == this.detailData.discountAmount){
+        return false
+      }
       this.spinning = true
       salesWriteDiscount({
         discountAmount: this.detailData.discountAmount || 0,
@@ -590,54 +599,28 @@ export default {
       }).then(res => {
         if (res.status == 200) {
           this.getOrderDetail(true)
-          this.spinning = false
         } else {
           this.spinning = false
         }
       })
     },
-    // 删除销售单
-    delSalerOrder () {
+    // 清空已选产品
+    delSalerOrder (oosFlag) {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要清空已选产品列表吗?',
+        content: oosFlag==1?'确认要删除所有急件吗?删除后不可恢复。':'确认要清空已选产品列表吗?',
         centered: true,
         closable: true,
         onOk () {
           _this.spinning = true
-          salesDel({ id: _this.orderId }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.handleBack()
-            }
-            _this.spinning = false
-          })
-        }
-      })
-    },
-    // 删除已选产品
-    delSalerDetailAll () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要整单删除吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.delLoading = true
-          _this.spinning = true
-          salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
+          let params = { id: _this.orderId, oosFlag: oosFlag==1 ? 1 : undefined }
+          console.log(params,oosFlag==1)
+          salesDel(params).then(res => {
             if (res.status == 200) {
               _this.getOrderDetail(true)
-              _this.productForm = {
-                productName: '',
-                productCode: '',
-                orderBy: 'sales_bill_detail.CREATE_DATE desc'
-              }
+              _this.$message.success(res.message)
             }
-            _this.$message.info(res.message)
-            _this.delLoading = false
             _this.spinning = false
           })
         }
@@ -779,6 +762,7 @@ export default {
       salesDetail({ id: vm.$route.params.id }).then(res => {
         if (res.status == 200) {
           vm.detailData = res.data
+          vm.discountAmountBak = vm.detailData.discountAmount
           if (flag) {
             const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
             const priceType = vm.$route.params.priceType
@@ -787,6 +771,7 @@ export default {
               vm.resetForm()
             }else{
               vm.spinning = false
+              vm.checkedProductList = []
             }
             // 查询关联的客户货架信息
             if (vm.detailData && vm.detailData.buyerSn) {
@@ -863,7 +848,7 @@ export default {
       })
     },
     setTableH () {
-      this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 330
+      this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 310
     },
     pageInit () {
       const vm = this
@@ -954,6 +939,7 @@ export default {
           }
           .red{
             color: #f5452e;
+            font-size: 14px;
           }
         }
         &:last-child{

+ 1 - 1
src/views/salesManagement/salesQueryNew/list.vue

@@ -444,7 +444,7 @@ export default {
         closable: true,
         onOk () {
           _this.spinning = true
-          salesDel({ id: row.id }).then(res => {
+          salesDel({ id: row.id, mainFlag: 1 }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()

+ 1 - 1
src/views/salesManagement/salesQueryNew/productSalesRecordModal.vue

@@ -12,8 +12,8 @@
       <div>
         <div ref="searchBox">
           <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
-            <div style="flex:1">产品名称:{{ baseData.productName }}</div>
             <div style="flex:1">产品编码:{{ baseData.productCode }}</div>
+            <div style="flex:1">产品名称:{{ baseData.productName }}</div>
           </div>
           <a-tabs size="small" type="card" v-model="curTab" @change="callback">
             <a-tab-pane key="1" tab="当前客户">

+ 3 - 2
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -83,6 +83,7 @@
                   type="primary"
                   ghost
                   @click="salesReturnDelAll"
+                  :disabled="chooseLoadData.length==0"
                   :loading="delLoading"
                   style="margin-left: 10px"
                   id="salesReturn-del-all">清空列表</a-button>
@@ -439,7 +440,7 @@ export default {
     resetSearchForm (flag) {
       this.$refs.table.refresh(!!flag)
       if (flag) {
-        this.getOrderDetail()
+        this.getOrderDetail(true)
       }
     },
     // 添加或修改产品
@@ -479,7 +480,7 @@ export default {
       salesReturnSaveProduct(params).then(res => {
         this.resetSearchForm(type == 'edit')
         if (type == 'new') {
-          this.getOrderDetail()
+          this.getOrderDetail(true)
         }
         this.isInster = false
         this.spinning = false

+ 2 - 1
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -83,6 +83,7 @@
                 <a-button
                   type="primary"
                   ghost
+                  :disabled="chooseLoadData.length==0"
                   @click="salesReturnDelAll"
                   :loading="delLoading"
                   style="margin-left: 10px"
@@ -377,7 +378,7 @@ export default {
         }
       })
     },
-    // 整单删除
+    // 清空列表
     salesReturnDelAll () {
       const _this = this
       this.$confirm({

+ 1 - 1
vue.config.js

@@ -211,7 +211,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.0.103/qpls-md',
+        // target: 'http://192.168.0.183/qpls-md',
         target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,