lilei 2 years ago
parent
commit
b4434f3f8f

+ 1 - 1
public/version.json

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

+ 11 - 1
src/api/purchaseReturnApply.js

@@ -1,5 +1,15 @@
 import { axios } from '@/utils/request'
 import { axios } from '@/utils/request'
-
+//  采购退货 详情 选择产品 列表  分页
+export const purchaseReturnPurchaseBillDetailList = (params) => {
+  const url = `/purchaseReturn/detail/queryPurchaseBillDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 //  采购退货申请单列表  分页
 //  采购退货申请单列表  分页
 export const purchaseReturnList = (params) => {
 export const purchaseReturnList = (params) => {
   const url = `/purchaseReturnApply/queryPage/${params.pageNo}/${params.pageSize}`
   const url = `/purchaseReturnApply/queryPage/${params.pageNo}/${params.pageSize}`

+ 104 - 64
src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue

@@ -5,7 +5,7 @@
         <!-- 自定义的二级文字标题 -->
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
         <template slot="subTitle">
           <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-          <span style="margin: 0 15px;color: #666;">供应商名称:{{ $route.params.name || '--' }}</span>
+          <span style="margin: 0 15px;color: #666;">供应商名称:箭冠营销中心</span>
         </template>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
         <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
@@ -20,11 +20,6 @@
             <div class="table-page-search-wrapper">
             <div class="table-page-search-wrapper">
               <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
               <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
                 <a-row :gutter="15">
                 <a-row :gutter="15">
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="采购单号" prop="purchaseBillNo">
-                      <a-input id="purchaseReturnEdit-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" placeholder="请输入采购单号" allowClear />
-                    </a-form-item>
-                  </a-col>
                   <a-col :md="6" :sm="24">
                   <a-col :md="6" :sm="24">
                     <a-form-item label="产品编码" prop="productCode">
                     <a-form-item label="产品编码" prop="productCode">
                       <a-input id="purchaseReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
                       <a-input id="purchaseReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
@@ -35,6 +30,11 @@
                       <a-input id="purchaseReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
                       <a-input id="purchaseReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
                     </a-form-item>
                     </a-form-item>
                   </a-col>
                   </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-model-item label="产品分类">
+                      <ProductType id="purchaseReturnEdit-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                    </a-form-model-item>
+                  </a-col>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                     <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
                     <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
                     <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
                     <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
@@ -54,15 +54,6 @@
               :pageSize="10"
               :pageSize="10"
               :scroll="{ y: 149 }"
               :scroll="{ y: 149 }"
               bordered>
               bordered>
-              <!-- 自定义表头 -->
-              <template slot="refundableQtyTitle">
-                <a-tooltip placement="top">
-                  <template slot="title">
-                    <span>同一个采购单,可多次退货,所以可退数量=采购数量-已退货数量</span>
-                  </template>
-                  可退数量<a-icon type="question-circle" :style="{ marginLeft: '3px' }" />
-                </a-tooltip>
-              </template>
               <!-- 数量 -->
               <!-- 数量 -->
               <template slot="returnQty" slot-scope="text, record">
               <template slot="returnQty" slot-scope="text, record">
                 <a-input-number
                 <a-input-number
@@ -75,6 +66,17 @@
                   placeholder="请输入"
                   placeholder="请输入"
                   style="width: 100%;" />
                   style="width: 100%;" />
               </template>
               </template>
+              <!-- 退货原因 -->
+              <template slot="remarks" slot-scope="text, record">
+                <v-select
+                  v-model="record.remarks"
+                  ref="billStatus"
+                  code="RETURN_APPLY_BILL_STATUS"
+                  placeholder="请选择退货原因"
+                  allowClear
+                  style="width: 100%;"
+                ></v-select>
+              </template>
               <!-- 操作 -->
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
               <template slot="action" slot-scope="text, record">
                 <span v-if="record.refundableQty==0">--</span>
                 <span v-if="record.refundableQty==0">--</span>
@@ -96,14 +98,42 @@
           <a-collapse-panel key="1">
           <a-collapse-panel key="1">
             <template slot="header">
             <template slot="header">
               已选产品
               已选产品
-              <a-button
-                size="small"
-                type="primary"
-                class="button-error"
-                id="purchaseReturnEdit-delAll-btn"
-                @click.stop="handleDel('', 'all')"
-                style="margin-right: 10px;float: right;">整单删除</a-button>
             </template>
             </template>
+            <!-- 筛选条件 -->
+            <div class="table-page-search-wrapper" style="display:flex;width:100%;">
+              <div style="width:80%;">
+                <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+                  <a-row :gutter="15">
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品编码" prop="productCode">
+                        <a-input id="purchaseReturnEdit-productCode" v-model.trim="chooseParam.productCode" placeholder="请输入产品编码" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品名称" prop="productName">
+                        <a-input id="purchaseReturnEdit-productName" v-model.trim="chooseParam.productName" placeholder="请输入产品名称" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                      <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
+                      <a-button style="margin-left: 8px" @click="resetChooseForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
+                    </a-col>
+                  </a-row>
+                </a-form>
+              </div>
+              <div style="text-align:right;width:20%;">
+                <a-button
+                  type="default"
+                  id="purchaseReturnEdit-import-btn"
+                  style="margin-right: 10px;">产品导入</a-button>
+                <a-button
+                  type="primary"
+                  class="button-error"
+                  id="purchaseReturnEdit-delAll-btn"
+                  @click.stop="handleDel('', 'all')"
+                >整单删除</a-button>
+              </div>
+            </div>
             <!-- 列表 -->
             <!-- 列表 -->
             <s-table
             <s-table
               class="sTable"
               class="sTable"
@@ -130,14 +160,15 @@
               </template>
               </template>
               <!-- 退货原因 -->
               <!-- 退货原因 -->
               <template slot="remarks" slot-scope="text, record">
               <template slot="remarks" slot-scope="text, record">
-                <a-input
-                  size="small"
-                  id="purchaseReturnEdit-remarks"
-                  v-model.trim="record.remarks"
-                  :maxLength="30"
-                  placeholder="退货原因(最多30个字符)"
-                  @blur="e => remarksBlur(e.target.value, record)"
-                  style="width: 100%;" />
+                <v-select
+                  v-model="record.remarks"
+                  ref="billStatus"
+                  code="RETURN_APPLY_BILL_STATUS"
+                  placeholder="请选择退货原因"
+                  allowClear
+                  style="width: 100%;"
+                  @change="e => remarksBlur(e, record)"
+                ></v-select>
               </template>
               </template>
               <!-- 操作 -->
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
               <template slot="action" slot-scope="text, record">
@@ -166,6 +197,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import Print from '@/views/common/print.vue'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 import { hdPrint } from '@/libs/JGPrint'
+import ProductType from '../../common/productType.js'
 import {
 import {
   purchaseReturnPurchaseBillDetailList,
   purchaseReturnPurchaseBillDetailList,
   purchaseReturnDetailList,
   purchaseReturnDetailList,
@@ -174,19 +206,22 @@ import {
   purchaseReturnSubmit,
   purchaseReturnSubmit,
   purchaseReturnDelAll,
   purchaseReturnDelAll,
   purchaseReturnDetailPrint,
   purchaseReturnDetailPrint,
-  purchaseReturnDetailExport } from '@/api/purchaseReturn'
+  purchaseReturnDetailExport } from '@/api/purchaseReturnApply'
 export default {
 export default {
   name: 'PurchaseReturnEdit',
   name: 'PurchaseReturnEdit',
-  components: { STable, VSelect, Print },
+  components: { STable, VSelect, Print, ProductType },
   mixins: [commonMixin],
   mixins: [commonMixin],
   data () {
   data () {
     return {
     return {
       spinning: false,
       spinning: false,
       queryParam: {
       queryParam: {
-        purchaseBillNo: '',
         productCode: '',
         productCode: '',
-        productName: ''
+        productName: '',
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
       },
       },
+      productType: [],
       dataSource: [],
       dataSource: [],
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
@@ -203,9 +238,13 @@ export default {
           return data
           return data
         })
         })
       },
       },
+      chooseParam: {
+        productCode: '',
+        productName: ''
+      },
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
       chooseLoadData: parameter => {
-        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.$route.params.sn, orderBy: 'qpls_purchase_return_bill_detail.CREATE_DATE desc' })).then(res => {
+        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnApplySn: this.$route.params.sn })).then(res => {
           const data = res.data
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           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++) {
@@ -223,40 +262,28 @@ export default {
   computed: {
   computed: {
     columns () {
     columns () {
       const arr = [
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购总数', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { slots: { title: 'refundableQtyTitle' }, dataIndex: 'refundableQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'stock.currentStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货数量', dataIndex: 'cancelQty', width: '7%', align: 'center' },
-        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '8%', align: 'center' },
-        // { title: '采购价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品分类', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', scopedSlots: { customRender: 'qty' }, width: '15%', align: 'center' },
+        { title: '退货原因', scopedSlots: { customRender: 'remarks' }, width: '15%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       ]
-      if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(9, 0, { title: '采购价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return arr
       return arr
     },
     },
     chooseColumns () {
     chooseColumns () {
       const arr = [
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购总数', dataIndex: 'purchaseBillQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
-        // { title: '采购价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', scopedSlots: { customRender: 'qty' }, width: '15%', align: 'center' },
         { title: '退货原因', scopedSlots: { customRender: 'remarks' }, width: '15%', align: 'center' },
         { title: '退货原因', scopedSlots: { customRender: 'remarks' }, width: '15%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       ]
-      if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(6, 0, { title: '采购价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return arr
       return arr
     }
     }
   },
   },
@@ -276,13 +303,26 @@ export default {
         _this.spinning = false
         _this.spinning = false
       })
       })
     },
     },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
     //  重置
     //  重置
     resetSearchForm () {
     resetSearchForm () {
-      this.queryParam.purchaseBillNo = ''
       this.queryParam.productCode = ''
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.productName = ''
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
+    resetChooseForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.$refs.chooseTable.refresh(true)
+    },
     //  添加/编辑
     //  添加/编辑
     handleAdd (row, isEdit) {
     handleAdd (row, isEdit) {
       // 添加时退货数量字段名为returnQty,编辑时退货数量字段名为qty
       // 添加时退货数量字段名为returnQty,编辑时退货数量字段名为qty
@@ -292,7 +332,7 @@ export default {
       }
       }
       const params = {
       const params = {
         id: isEdit ? row.id : undefined,
         id: isEdit ? row.id : undefined,
-        purchaseReturnSn: this.$route.params.sn,
+        purchaseReturnApplySn: this.$route.params.sn,
         purchaseBillSn: row.purchaseBillSn,
         purchaseBillSn: row.purchaseBillSn,
         purchaseBillNo: row.purchaseBillNo,
         purchaseBillNo: row.purchaseBillNo,
         purchaseBillDetailSn: row.purchaseBillDetailSn,
         purchaseBillDetailSn: row.purchaseBillDetailSn,
@@ -347,7 +387,7 @@ export default {
         onOk () {
         onOk () {
           if (isAll) { //  整单删除
           if (isAll) { //  整单删除
             _this.spinning = true
             _this.spinning = true
-            purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
+            purchaseReturnDelAll({ purchaseReturnApplySn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.$message.success(res.message)
                 _this.$refs.table.refresh()
                 _this.$refs.table.refresh()

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

@@ -252,13 +252,13 @@ export default {
     },
     },
     //  详情
     //  详情
     handleDetail (row) {
     handleDetail (row) {
-      this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.purchaseReturnSn}` })
+      this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.purchaseReturnApplySn}` })
     },
     },
     //  新增/编辑
     //  新增/编辑
     handleEdit (row) {
     handleEdit (row) {
       const _this = this
       const _this = this
       if (row) { //  编辑
       if (row) { //  编辑
-        _this.$router.push({ path: `/purchasingManagement/purchaseReturn/edit/${row.id}/${row.purchaseReturnSn}/${row.returnTargetName}` })
+        _this.$router.push({ name: 'purchaseReturnApplyFormEdit', params: { sn: row.purchaseReturnApplySn } })
       } else { //  新增
       } else { //  新增
         this.$confirm({
         this.$confirm({
           title: '提示',
           title: '提示',
@@ -272,7 +272,7 @@ export default {
                 _this.spinning = false
                 _this.spinning = false
                 // 重置查询条件
                 // 重置查询条件
                 _this.resetData()
                 _this.resetData()
-                _this.$router.push({ name: 'purchaseReturnApplyFormEdit', params: { sn: data.purchaseReturnSn } })
+                _this.$router.push({ name: 'purchaseReturnApplyFormEdit', params: { sn: data.purchaseReturnApplySn } })
               } else {
               } else {
                 _this.spinning = false
                 _this.spinning = false
               }
               }
@@ -290,7 +290,7 @@ export default {
         centered: true,
         centered: true,
         onOk () {
         onOk () {
           _this.spinning = true
           _this.spinning = true
-          purchaseReturnOutStockBill({ sn: row.purchaseReturnSn }).then(res => {
+          purchaseReturnOutStockBill({ sn: row.purchaseReturnApplySn }).then(res => {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
               _this.$refs.table.refresh()
@@ -311,7 +311,7 @@ export default {
         centered: true,
         centered: true,
         onOk () {
         onOk () {
           _this.spinning = true
           _this.spinning = true
-          purchaseReturnFinishBill({ sn: row.purchaseReturnSn }).then(res => {
+          purchaseReturnFinishBill({ sn: row.purchaseReturnApplySn }).then(res => {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
               _this.$refs.table.refresh()