Sfoglia il codice sorgente

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

lilei 2 anni fa
parent
commit
bd0a60774c

+ 19 - 0
src/api/purchaseReturnApply.js

@@ -34,6 +34,17 @@ export const createPurchaseReturnBill = (params) => {
     method: 'post'
   })
 }
+// 选择产品列表
+export const queryDealerScopeProductPage = (params) => {
+  const url = `/purchaseReturnApply/queryDealerScopeProductPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 //  采购退货 详情 添加产品
 export const purchaseReturnDetailSave = (params) => {
   return axios({
@@ -74,6 +85,14 @@ export const modifyReturnReason = (params) => {
     method: 'post'
   })
 }
+// 批量修改退货原因
+export const modifyReturnReasonList = (params) => {
+  return axios({
+    url: `/purchaseReturnApply/detail/modifyReturnReasonList`,
+    data: params,
+    method: 'post'
+  })
+}
 //  申请单详情列表  分页
 export const purchaseReturnDetailList = (params) => {
   const url = `/purchaseReturnApply/detail/queryPage/${params.pageNo}/${params.pageSize}`

+ 18 - 3
src/components/index.less

@@ -394,9 +394,24 @@
       color: #d62a00;
     }
   }
-  td > div:empty{
-    &::after{
-      content:'--'
+  .ant-table-row{
+    td{
+      > div:empty::after{
+        content: '--';
+      }
+      .ant-select-search__field__mirror{
+        white-space: pre-wrap;
+      }
+    }
+  }
+  .ant-table-small > .ant-table-content .ant-table-body,.ant-table-fixed-right{
+    margin: 0;
+    tr:hover{
+      td{
+        > div:empty::after{
+          content: '--';
+        }
+      }
     }
   }
 }

+ 1 - 1
src/config/router.config.js

@@ -835,7 +835,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'grapEdit/:sn/:returnTargetType',
+                path: 'grapEdit/:sn/:returnTargetType/:purchaseTargetSn',
                 name: 'purchaseReturnOutSyncGrapEdit',
                 component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue'),
                 meta: {

+ 42 - 8
src/views/chainReportData/chainSalesDetailsCountReport/list.vue

@@ -91,14 +91,48 @@ export default {
       exportLoading: false,
       columns: [
         { title: '门店', dataIndex: 'salesTargetName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '滤清器', dataIndex: 'lqqAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '雨刮片', dataIndex: 'ygpAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '刹车片', dataIndex: 'scpAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '蓄电池', dataIndex: 'xdcAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '润滑油', dataIndex: 'rhyAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '火花塞', dataIndex: 'hhsAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '点火线圈', dataIndex: 'dhxqAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: 'LED灯', dataIndex: 'ledAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '箭牌、冠牌',
+          children: [
+            { title: '滤清器', dataIndex: 'lqqAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+          ]
+        },
+        {
+          title: '所有品牌',
+          children: [
+            { title: '雨刮片', dataIndex: 'ygpAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+          ]
+        },
+        {
+          title: 'TBU',
+          children: [
+            { title: '刹车制动系统', dataIndex: 'scpAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+          ]
+        },
+        {
+          title: '汇箭、布瑞斯',
+          children: [
+            { title: '蓄电池', dataIndex: 'xdcAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+          ]
+        },
+        {
+          title: '德路斯',
+          children: [
+            { title: '润滑油', dataIndex: 'rhyAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+          ]
+        },
+        {
+          title: '所有品牌',
+          children: [
+            { title: '火花塞', dataIndex: 'hhsAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+          ]
+        },
+        {
+          title: '稳升',
+          children: [
+            { title: '点火线圈', dataIndex: 'dhxqAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: 'LED灯', dataIndex: 'ledAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+          ]
+        },
         { title: '其他', dataIndex: 'otherAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '合计', dataIndex: 'totalAmount', width: '8.4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],

+ 2 - 0
src/views/common/commonModal.vue

@@ -11,6 +11,7 @@
     :width="416">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main" v-html="modalHtml"></div>
+      <slot></slot>
       <div class="btn-box">
         <a-button type="primary" class="button-warning" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
         <a-button type="primary" class="button-info" @click="handleCommonOk">{{ okText }}</a-button>
@@ -65,6 +66,7 @@ export default {
     // 取消
     handleCommonCancel () {
       this.$emit('cancel')
+      this.$emit('close')
     }
   },
   watch: {

+ 108 - 0
src/views/common/returnReason.js

@@ -0,0 +1,108 @@
+const ReturnReason = {
+  template: `
+        <a-select
+            allowClear
+            :size="size"
+            mode="combobox"
+            :value="defaultVal"
+            show-search
+            :placeholder="placeholder"
+            option-filter-prop="children"
+            style="width: 100%"
+            :filter-option="filterOption"
+            :dropdownMatchSelectWidth="false"
+            @change="onChange"
+            @blur="onBlur"
+            @focus="open=true"
+            @select="open=false"
+            :open="open"
+          >
+            <a-select-option v-for="item in list" :key="item" :value="item">
+              {{item}}
+            </a-select-option>
+          </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder: {
+      type: String,
+      default: '请输入退货原因'
+    },
+    size: {
+      type: String,
+      default: 'small'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      open: false,
+      list: [
+        '漏油或者不上油',
+        '外观不良:脏污、破损、脱胶、变形等',
+        '尺寸问题',
+        '泄压',
+        '无法安装',
+        '无法或不便安装',
+        '抖动或跳动',
+        '噪音',
+        '刮雨不干净',
+        '胶条断裂、脱落',
+        '喇叭无声',
+        '声音嘶哑或者变音',
+        '浸水',
+        '伤盘',
+        '摩擦块掉渣,脱落或有残渣',
+        '制动不足,刹车不灵敏',
+        '不耐磨',
+        '冒烟',
+        '缺少感应线',
+        '尺寸不标准',
+        '不点火,间歇式失火',
+        '漏电',
+        '击穿',
+        '烧蚀',
+        '包装型号不符',
+        '整体不亮/部分能亮',
+        '灯珠脱落',
+        '漏电短路',
+        '包装型号不符/包装破损',
+        '召回'
+        ]
+    };
+  },
+  mounted() {
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    },
+  },
+  methods: {
+    filterOption(input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      );
+    },
+    onChange(value) {
+      console.log('onChange', value);
+      this.open = true;
+      this.defaultVal = value;
+      this.$emit('change', value);
+      this.$emit('input', value);
+    },
+    onBlur(value){
+      this.open = false;
+      this.$emit('blur', value);
+    }
+  },
+};
+
+export default ReturnReason

+ 4 - 3
src/views/numsGoodsShelves/approveStore/list.vue

@@ -65,10 +65,11 @@
         </template>
         <!-- 地址 -->
         <template slot="addr" slot-scope="text, record">
-          <div>
-            {{ record.addrProvinceName +'-'+ record.addrCityName +'-'+ record.addrDistrictName }}
-            <div style="word-wrap: wrap;">{{ record.addrDetail }}</div>
+          <div style="word-break:break-all;" v-if="record.addrProvinceName||record.addrDetail">
+            <div v-if="record.addrProvinceName">{{ record.addrProvinceName +'-'+ record.addrCityName +'-'+ record.addrDistrictName }}</div>
+            <div v-if="record.addrDetail">{{ record.addrDetail }}</div>
           </div>
+          <div v-else>--</div>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">

+ 2 - 2
src/views/purchasingManagement/purchaseReturnApplyForm/chooseImportModal.vue

@@ -91,7 +91,7 @@ export default {
         { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'product.unit', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'exprotQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
       nowUnColumns: [
@@ -100,7 +100,7 @@ export default {
         { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'product.unit', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'exprotQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '错误说明', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       unLoadData: [],

+ 2 - 8
src/views/purchasingManagement/purchaseReturnApplyForm/creatPurchaseReutn.vue

@@ -115,15 +115,9 @@ export default {
         if (res.status == 200) {
           if (res.data && res.data.length) {
             this.$info({
-              title: '提示',
+              title: '以下产品库存不足',
               centered: true,
-              content: (h) => {
-                const content = []
-                res.data.map(item => {
-                  content.push(h('div', item))
-                })
-                return h('div', content)
-              }
+              content: res.data.toString()
             })
           } else {
             this.$emit('creatOk')

+ 3 - 3
src/views/purchasingManagement/purchaseReturnApplyForm/detail.vue

@@ -34,7 +34,7 @@
             <!-- 总计 -->
             <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">
-                申请退货数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong>;
+                申请退货数量:<strong>{{ (basicInfoData&&(basicInfoData.totalInitialQty || basicInfoData.totalInitialQty==0)) ? basicInfoData.totalInitialQty : '--' }}</strong>;
                 总公司实收数量:<strong>{{ (basicInfoData&&(basicInfoData.totalReceiveQty || basicInfoData.totalReceiveQty==0)) ? basicInfoData.totalReceiveQty : '--' }}</strong>;
                 坏件数量:<strong>{{ (basicInfoData&&(basicInfoData.totalBadQty || basicInfoData.totalBadQty==0)) ? basicInfoData.totalBadQty : '--' }}</strong>;
                 良品数量:<strong>{{ (basicInfoData&&(basicInfoData.totalGoodQty || basicInfoData.totalGoodQty==0)) ? basicInfoData.totalGoodQty : '--' }}</strong>;
@@ -110,13 +110,13 @@ export default {
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'product.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '申请退货数量', dataIndex: 'initQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总公司实收数量', dataIndex: 'receiveQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'product.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总公司变更详情', dataIndex: 'modifyInfo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {

+ 109 - 57
src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue

@@ -73,16 +73,7 @@
               </template>
               <!-- 退货原因 -->
               <template slot="returnReason" slot-scope="text, record">
-                <a-select
-                  style="width:100%;"
-                  size="small"
-                  v-model="record.returnReason"
-                  placeholder="请选择退货原因"
-                  allowClear>
-                  <a-select-option v-for="item in returnReasonList" :value="item.code">
-                    {{ item.dispName }}
-                  </a-select-option>
-                </a-select>
+                <returnReason v-model="record.returnReason"></returnReason>
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
@@ -109,12 +100,12 @@
             <!-- 总计 -->
             <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">
-                申请退货数量:<strong>{{ (detailData&&(detailData.totalQty || detailData.totalQty==0)) ? detailData.totalQty : '--' }}</strong> ;
+                申请退货数量:<strong>{{ (detailData&&(detailData.totalInitialQty || detailData.totalInitialQty==0)) ? detailData.totalInitialQty : '--' }}</strong> ;
               </div>
             </a-alert>
             <!-- 筛选条件 -->
             <div class="table-page-search-wrapper" style="display:flex;width:100%;">
-              <div style="width:80%;">
+              <div style="flex-grow:1;">
                 <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
                   <a-row :gutter="15">
                     <a-col :md="6" :sm="24">
@@ -134,12 +125,15 @@
                   </a-row>
                 </a-form>
               </div>
-              <div style="text-align:right;width:20%;">
+              <div>
+                <span style="margin-right: 10px;" v-if="selNums">已选{{ selNums }}项</span>
+                <a-button type="default" style="margin-right: 10px;" class="button-info" @click="openPlSetReason">批量设置退货原因</a-button>
                 <a-button
-                  type="default"
+                  type="primary"
                   id="purchaseReturnEdit-import-btn"
+                  class="button-info"
                   @click="openGuideModal = true"
-                  style="margin-right: 10px;">产品导入</a-button>
+                >产品导入</a-button>
                 <a-button
                   type="primary"
                   class="button-error"
@@ -154,6 +148,8 @@
               ref="chooseTable"
               size="small"
               :rowKey="(record) => record.id"
+              :row-selection="{ columnWidth: 40 }"
+              @rowSelection="rowSelectionFun"
               :columns="chooseColumns"
               :data="chooseLoadData"
               :defaultLoadData="false"
@@ -170,7 +166,7 @@
                 <a-input-number
                   size="small"
                   id="purchaseReturnEdit-qty"
-                  v-model="record.qty"
+                  v-model="record.initQty"
                   :precision="0"
                   :min="1"
                   placeholder="请输入"
@@ -179,17 +175,7 @@
               </template>
               <!-- 退货原因 -->
               <template slot="returnReason" slot-scope="text, record">
-                <a-select
-                  style="width:100%;"
-                  size="small"
-                  v-model="record.returnReason"
-                  placeholder="请选择退货原因"
-                  @change="e => remarksBlur(e, record)"
-                  allowClear>
-                  <a-select-option v-for="item in returnReasonList" :value="item.code">
-                    {{ item.dispName }}
-                  </a-select-option>
-                </a-select>
+                <returnReason v-model="record.returnReason" @blur="e => remarksBlur(e, record)"></returnReason>
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
@@ -217,6 +203,16 @@
       :params="{purchaseReturnApplySn: $route.params.sn, purchaseReturnApplyNo:detailData?detailData.purchaseReturnApplyNo:''}"
       @close="openGuideModal=false"
       @ok="hanldeImprotOk" />
+
+    <!-- 批量设置退货原因 -->
+    <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @close="showPlModal=false" @ok="setPlReturnReason">
+      <div style="text-align: center;">
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+        <div style="line-height: 24px;">
+          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
+        </div>
+      </div>
+    </commonModal>
   </div>
 </template>
 
@@ -225,9 +221,10 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
+import returnReason from '@/views/common/returnReason'
+import commonModal from '@/views/common/commonModal.vue'
 import ProductType from '../../common/productType.js'
 import importGuideModal from './importGuideModal.vue'
-import { productList } from '@/api/product'
 import {
   purchaseReturnDetailList,
   purchaseReturnDetail,
@@ -239,10 +236,12 @@ import {
   purchaseReturnSubmit,
   purchaseReturnApplyPrint,
   purchaseReturnApplyExport,
-  purchaseReturnApplyCreateList } from '@/api/purchaseReturnApply'
+  purchaseReturnApplyCreateList,
+  queryDealerScopeProductPage,
+  modifyReturnReasonList } from '@/api/purchaseReturnApply'
 export default {
   name: 'PurchaseReturnEdit',
-  components: { STable, VSelect, Print, ProductType, importGuideModal },
+  components: { STable, VSelect, Print, ProductType, importGuideModal, returnReason, commonModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -264,7 +263,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.queryParam.sysFlag = '1' // 剪冠产品
-        return productList(Object.assign(parameter, this.queryParam)).then(res => {
+        return queryDealerScopeProductPage(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -286,17 +285,30 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
-            data.list[i].qtyBackups = data.list[i].qty
+            data.list[i].qtyBackups = data.list[i].initQty
             data.list[i].returnReasonBackups = data.list[i].returnReason
           }
           this.dataSource = data.list
           return data
         })
       },
-      detailData: null
+      detailData: null,
+      rowSelectionInfo: null,
+      plReturnReason: '',
+      showPlModal: false
+    }
+  },
+  watch: {
+    showPlModal (newValue, oldValue) {
+      if (!newValue) {
+        this.plReturnReason = ''
+      }
     }
   },
   computed: {
+    selNums () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -329,6 +341,10 @@ export default {
     handleBack () {
       this.$router.push({ name: 'purchaseReturnApplyFormList' })
     },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
@@ -378,13 +394,9 @@ export default {
         this.$message.warning('请输入退货数量')
         return
       }
-      if (!row.returnReason) {
-        this.$message.warning('请选择退货原因')
-        return
-      }
       const params = {
         purchaseReturnApplySn: this.$route.params.sn,
-        qty: row.returnQty, //  退货数量
+        initQty: row.returnQty, //  退货数量
         productSn: row.productSn,
         returnReason: row.returnReason
       }
@@ -438,7 +450,7 @@ export default {
           fun(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.$refs.table.refresh()
+              // _this.$refs.table.refresh()
               _this.$refs.chooseTable.refresh()
               _this.spinning = false
               _this.getDetail()
@@ -459,14 +471,18 @@ export default {
       _this.spinning = true
       purchaseReturnSubmit({ sn: _this.$route.params.sn }).then(res => {
         if (res.status == 200) {
-          this.$message.success(res.message)
-          setTimeout(() => {
+          if (res.data.length) {
+            _this.$warning({
+              title: '以下产品请输入退货原因',
+              centered: true,
+              content: res.data.toString()
+            })
+          } else {
+            _this.$message.success(res.message)
             _this.handleBack()
-            _this.spinning = false
-          }, 1000)
-        } else {
-          _this.spinning = false
+          }
         }
+        _this.spinning = false
       })
     },
     // 已选产品 退货数量修改
@@ -475,17 +491,17 @@ export default {
       if (val != record.qtyBackups) {
         this.spinning = true
         purchaseReturnModifyQty({
-          qty: record.qty,
+          initQty: record.initQty,
           purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
           purchaseReturnApplySn: this.$route.params.sn
         }).then(res => {
           if (res.status == 200) {
             this.$message.success(res.message)
             this.$refs.chooseTable.refresh()
-            record.qtyBackups = record.qty
+            record.qtyBackups = record.initQty
             this.getDetail()
           } else {
-            record.qty = record.qtyBackups
+            record.initQty = record.qtyBackups
           }
           this.spinning = false
         })
@@ -493,19 +509,55 @@ export default {
     },
     // 已选产品 退货原因修改
     remarksBlur (val, record) {
-      if (val && (val != record.returnReasonBackups)) {
+      // 空或没有改变时不保存数据
+      if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
+        record.returnReason = record.returnReasonBackups
+        return
+      }
+      this.spinning = true
+      modifyReturnReason({
+        returnReason: record.returnReason,
+        purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
+        purchaseReturnApplySn: this.$route.params.sn
+      }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.chooseTable.refresh()
+        } else {
+          record.returnReason = record.returnReasonBackups
+        }
+        this.spinning = false
+      })
+    },
+    // 批量设置退货原因
+    openPlSetReason () {
+      if (this.selNums) {
+        this.showPlModal = true
+      } else {
+        this.$message.warning('请先选择产品!')
+      }
+    },
+    setPlReturnReason () {
+      if (this.plReturnReason == '') {
+        this.$message.warning('请输入退货原因!')
+      } else {
         this.spinning = true
-        modifyReturnReason({
-          returnReason: record.returnReason,
-          purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
-          purchaseReturnApplySn: this.$route.params.sn
+        const snList = []
+        const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        arr.map(item => {
+          snList.push({
+            purchaseReturnApplyDetailSn: item.purchaseReturnApplyDetailSn,
+            returnReason: this.plReturnReason
+          })
+        })
+        modifyReturnReasonList({
+          purchaseReturnApplySn: this.$route.params.sn,
+          detailList: snList
         }).then(res => {
           if (res.status == 200) {
-            this.$message.success(res.message)
+            this.showPlModal = false
             this.$refs.chooseTable.refresh()
-            record.returnReasonBackups = record.returnReason
-          } else {
-            record.returnReason = record.returnReasonBackups
+            this.$refs.chooseTable.clearSelected()
           }
           this.spinning = false
         })

+ 1 - 1
src/views/purchasingManagement/purchaseReturnApplyForm/list.vue

@@ -180,7 +180,7 @@ export default {
         { title: '单据来源', dataIndex: 'billSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购退货申请单号', scopedSlots: { customRender: 'purchaseReturnApplyNo' }, width: '14%', align: 'center' },
         { title: '供应商', dataIndex: 'returnTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总公司实收数量', dataIndex: 'totalReceiveQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },

+ 2 - 1
src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue

@@ -240,7 +240,8 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        this.queryParam.returnTargetType = this.$route.params.returnTargetType
+        this.queryParam.purchaseTargetType = this.$route.params.returnTargetType
+        this.queryParam.purchaseTargetSn = this.$route.params.purchaseTargetSn
         return purchaseReturnPurchaseBillNoSyncList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize

+ 32 - 30
src/views/purchasingManagement/purchaseReturnOutSync/list.vue

@@ -107,35 +107,37 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-primary"
-            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturn_outSnycEdit')"
-            @click="handleEdit(record,1)"
-            id="purchaseReturnList-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            type="link"
-            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_purchaseReturn_outSnycAudit')"
-            @click="handleAudit(record)"
-            class="button-primary"
-            id="bulkReturnGoodsList-audit-btn">审核</a-button>
-          <a-button
-            size="small"
-            type="link"
-            v-if="record.state == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_purchaseReturn_outSnycOut')"
-            @click="handleWarehouse(record)"
-            class="button-primary"
-            id="bulkReturnGoodsList-out-btn">出库</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-error"
-            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturn_outSnycDel')"
-            @click="handleDel(record)"
-            id="purchaseReturnList-del-btn">删除</a-button>
-          <span v-if="record.state == 'FINISH'||!($hasPermissions('B_purchaseReturn_outSnycEdit') || $hasPermissions('B_purchaseReturn_outSnycDel')||$hasPermissions('B_purchaseReturn_outSnycOut')||$hasPermissions('B_purchaseReturn_outSnycAudit'))">--</span>
+          <div v-if="record.synchronizationType == '0'">
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturn_outSnycEdit')"
+              @click="handleEdit(record,1)"
+              id="purchaseReturnList-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_purchaseReturn_outSnycAudit')"
+              @click="handleAudit(record)"
+              class="button-primary"
+              id="bulkReturnGoodsList-audit-btn">审核</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.state == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_purchaseReturn_outSnycOut')"
+              @click="handleWarehouse(record)"
+              class="button-primary"
+              id="bulkReturnGoodsList-out-btn">出库</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturn_outSnycDel')"
+              @click="handleDel(record)"
+              id="purchaseReturnList-del-btn">删除</a-button>
+          </div>
+          <div v-else></div>
         </template>
       </s-table>
     </a-spin>
@@ -280,7 +282,7 @@ export default {
       if (!flag) {
         this.resetData()
       }
-      this.$router.push({ name: row.grabFlag == 1 ? 'purchaseReturnOutSyncGrapEdit' : 'purchaseReturnOutSyncEdit', params: { sn: row.purchaseReturnSn, returnTargetType: row.returnTargetType } })
+      this.$router.push({ name: row.grabFlag == 1 ? 'purchaseReturnOutSyncGrapEdit' : 'purchaseReturnOutSyncEdit', params: { sn: row.purchaseReturnSn, returnTargetType: row.returnTargetType, purchaseTargetSn: row.returnTargetSn } })
     },
     // 详情
     handleDetail (row) {

+ 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.215:8076/qpls-md',
+        target: 'http://192.168.0.182:8503/qpls-md',
         // target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,