瀏覽代碼

销售退货对接

lilei 2 年之前
父節點
當前提交
e67f645d17

+ 12 - 3
src/api/salesReturn.js

@@ -26,6 +26,14 @@ export const salesReturnDel = (params) => {
   })
 }
 
+// 再次编辑
+export const updateAgain = (params) => {
+  return axios({
+    url: `/salesReturn/updateAgain/${params.salesReturnBillSn}`,
+    method: 'get'
+  })
+}
+
 // 根据SN查询销售退货单
 export const salesReturnDetail = (params) => {
   return axios({
@@ -94,8 +102,9 @@ export const salesReturnList = (params) => {
 //  销售退货 提交
 export const salesReturnSubmit = (params) => {
   return axios({
-    url: `/salesReturn/submit/${params.salesReturnBillSn}`,
-    method: 'get'
+    url: `/salesReturn/submit`,
+    data: params,
+    method: 'post'
   })
 }
 
@@ -144,7 +153,7 @@ export const salesReturnFinancial = (params) => {
 // 退货确认 下载模板
 export const salesReturnDownload = params => {
   return axios.request({
-    url: `/salesReturn/detail/downloadExcel/${params.grabFlag}`,
+    url: `/salesReturn/detail/downloadExcel`,
     method: 'post',
     responseType: 'blob'
   })

+ 19 - 0
src/store/modules/app.js

@@ -1,5 +1,6 @@
 import Vue from 'vue'
 import { employeeQueryList } from '@/api/expenseManagement'
+import { getLookUpData, listLookUp } from '@/api/data'
 import {
   SIDEBAR_TYPE,
   DEFAULT_THEME,
@@ -33,6 +34,7 @@ const app = {
     loadingStatus: false,
     closeTabPages: [], // 已关闭的页面
     employeeList: [], // 申请人列表
+    returnReason: [], // 申请退货列表
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {
@@ -92,6 +94,9 @@ const app = {
     SET_employeeList:(state, val) => {
       state.employeeList = val
     },
+    SET_returnReason:(state, val) => {
+      state.returnReason = val
+    },
   },
   actions: {
     setSidebar ({ commit }, type) {
@@ -145,6 +150,20 @@ const app = {
         }
       })
     },
+    getLookUpData({ commit }, code, isEnable) {
+      getLookUpData({
+        pageNo: 1,
+        pageSize: 1000,
+        lookupCode: code,
+        isEnable: isEnable ? 1 : undefined
+      }).then(res => {
+        if (res.status == 200) {
+          commit('SET_returnReason', res.data.list)
+        }else{
+          commit('SET_returnReason', [])
+        }
+      })
+    },
   }
 }
 

+ 2 - 1
src/views/Home.vue

@@ -55,9 +55,10 @@ export default {
   created () {
   },
   methods: {
-    ...mapActions(['GetEmployeeList']),
+    ...mapActions(['GetEmployeeList', 'getLookUpData']),
     hasNewProduct () {
       this.GetEmployeeList()
+      this.getLookUpData('RETURN_REASON')
       queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {
         if (res.status == 200) {
           if (res.data.count > 0) {

+ 176 - 0
src/views/salesReturnManagement/salesReturn/chooseDepartUserModal.vue

@@ -0,0 +1,176 @@
+<template>
+  <a-modal
+    centered
+    class="departUser-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="title+'选择审批人员'"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div>
+        <div class="departUser-con">
+          <a-form-model
+            id="departUser-form"
+            ref="ruleForm"
+            :model="form"
+            :rules="rules"
+            :label-col="formItemLayout.labelCol"
+            :wrapper-col="formItemLayout.wrapperCol">
+            <a-form-model-item label="申请人员" prop="applyPersonSn">
+              <employee style="width: 100%;" @change="employeeChange" id="departUser-Employee" v-model="form.applyPersonSn"></employee>
+            </a-form-model-item>
+            <a-form-model-item label="审批人员" prop="approvers">
+              <dingDepartUser
+                ref="departUserApp"
+                @loaded="uploading=false"
+                @close="isShow=false"
+                id="departUser-approvers"
+                :disabled="uploading"
+                v-model="form.approvers"
+                @change="changeApprovers"
+                allowClear
+                placeholder="请选择审批人员"
+              ></dingDepartUser>
+            </a-form-model-item>
+            <a-form-model-item label="抄送人" prop="ccList">
+              <dingDepartUser
+                ref="departUserCc"
+                @loaded="uploading=false"
+                :disabled="uploading"
+                id="departUser-ccList"
+                v-model="form.ccList"
+                allowClear
+                placeholder="请选择抄送人"
+              ></dingDepartUser>
+            </a-form-model-item>
+          </a-form-model>
+        </div>
+        <div class="btn-cont">
+          <a-button type="primary" id="departUser-save" @click="handleSave">确定</a-button>
+          <a-button :loading="uploading" style="margin-left: 15px;" @click="updateUser">刷新人员</a-button>
+          <a-button id="departUser-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import dingDepartUser from '@/views/common/dingDepartUser.js'
+import employee from '@/views/expenseManagement/expenseReimbursement/employee.js'
+export default {
+  name: 'ChooseDepartUserModal',
+  components: { dingDepartUser, employee },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      uploading: false,
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      title: '',
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        approvers: [], // 审批人
+        ccList: [] // 抄送人
+      },
+      rules: {
+        applyPersonSn: [
+          { required: true, message: '请选择申请人员', trigger: 'change' }
+        ]
+        // approvers: [
+        //   { required: true, type: 'array', message: '请选择审批人', trigger: 'change' }
+        // ]
+      }
+    }
+  },
+  methods: {
+    // 申请人员
+    employeeChange (v, r) {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.validateField(['applyPersonSn'])
+      })
+    },
+    updateUser () {
+      this.uploading = true
+      this.$refs.departUserApp.updateDeptUser()
+      // this.$refs.departUserCc.updateDeptUser()
+    },
+    changeApprovers (value) {
+      this.form.approvers = value
+      this.$refs.ruleForm.clearValidate()
+    },
+    getTreeVal (data) {
+      const ret = []
+      data.map(item => {
+        ret.push(item.value)
+      })
+      return ret.join(',')
+    },
+    // 确定
+    handleSave (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          if (form.approvers) {
+            form.approvers = this.getTreeVal(form.approvers)
+          }
+          if (form.ccList) {
+            form.ccList = this.getTreeVal(form.ccList)
+          }
+          console.log(form)
+          this.$emit('submit', form)
+          this.$emit('close')
+        } else {
+          return false
+        }
+      })
+    },
+    resetForm () {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.resetFields()
+      })
+      this.form = {
+        ccList: undefined,
+        approvers: undefined
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .departUser-modal{
+    .ant-modal-body {
+      padding: 30px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 29 - 72
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -42,61 +42,41 @@
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
             <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="单据来源">{{ detailData&&detailData.salesReturnBillSourceDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="销售退货单号">{{ detailData&&detailData.salesReturnBillNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="销退单号">{{ detailData&&detailData.salesReturnBillNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="客户采退申请单号">{{ detailData&&detailData.purchaseReturnApplyNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="是否同步给客户">{{ detailData&&detailData.syncFlag ? ['否', '是'][detailData.syncFlag] : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货数量">{{ detailData&&(detailData.totalQty || detailData.totalQty == 0) ? detailData.totalQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="坏件数量">{{ detailData&&(detailData.totalBadQty || detailData.totalBadQty == 0) ? detailData.totalBadQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="返库数量">{{ detailData&&(detailData.totalBackStockQty || detailData.totalBackStockQty == 0) ? detailData.totalBackStockQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货金额" v-if="$hasPermissions('B_isShowPrice')">{{ detailData&&(detailData.totalAmount || detailData.totalAmount == 0) ? detailData.totalAmount : '--' }}元</a-descriptions-item>
+              <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditTime || '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- 列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="record => record.id"
-          :columns="columns"
-          :data="loadData"
-          :defaultLoadData="false"
-          bordered></s-table>
-      </a-card>
-      <a-card size="small" :bordered="false" class="footer-cont">
-        <a-button
-          type="primary"
-          class="button-warning"
-          style="width: 150px;"
-          size="large"
-          v-if="detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesReturnAudit')"
-          @click="visibleAudit=true"
-          id="salesReturn-eexamine-btn">审核</a-button>
-        <a-button
-          type="primary"
-          class="button-info"
-          size="large"
-          style="width: 150px;"
-          id="salesDetail-edit-btn"
-          v-if="detailData&&detailData.salesReturnBillSource == 'SALES' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'WAIT_SUBMIT')&&$hasPermissions('B_salesReturnEdit')"
-          @click="handleEdit()"
-        >
-          编辑
-        </a-button>
-        <!-- <a-button
-          size="large"
-          style="width: 150px;"
-          v-if="detailData&&detailData.salesReturnBillSource != 'SALES' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesReturnEdit')"
-          type="primary"
-          class="button-info"
-          @click="handleEdit()"
-          id="salesReturn-edit-btn">改单</a-button> -->
+        <a-tabs default-active-key="1" @change="callback">
+          <a-tab-pane key="1" tab="产品明细" force-render>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="record => record.id"
+              :columns="columns"
+              :data="loadData"
+              :defaultLoadData="false"
+              bordered></s-table>
+          </a-tab-pane>
+          <a-tab-pane key="2" tab="审核进度" force-render>
+            审核进度
+          </a-tab-pane>
+          <a-tab-pane key="3" tab="操作记录" force-render>
+            操作记录
+          </a-tab-pane>
+        </a-tabs>
       </a-card>
     </a-spin>
-    <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_CHECK')" @fail="auditOrder('AUDIT_REJECT')" />
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -107,13 +87,12 @@ import { commonMixin } from '@/utils/mixin'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { STable, VSelect } from '@/components'
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
-import auditModal from '@/views/common/auditModal.vue'
-import { salesReturnDetail, salesReturnAudit, salesReturnPrint, salesReturnExport } from '@/api/salesReturn'
+import { salesReturnDetail, salesReturnPrint, salesReturnExport } from '@/api/salesReturn'
 import { salesReturnDetailList } from '@/api/salesReturnDetail'
 export default {
   name: 'SalesReturnDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect, auditModal },
+  components: { STable, VSelect },
   data () {
     return {
       spinning: false,
@@ -169,29 +148,7 @@ export default {
   methods: {
     //  返回
     handleBack () {
-      this.$router.push({ path: '/salesManagement/salesReturn/list', query: { closeLastOldTab: true } })
-    },
-    auditOrder (billStatus) {
-      this.spinningAudit = true
-      salesReturnAudit({
-        salesReturnBillSn: this.detailData.salesReturnBillSn,
-        billStatus: billStatus
-      }).then(res => {
-        if (res.status == 200) {
-          this.visibleAudit = false
-          this.$message.success(res.message)
-          this.handleBack()
-          this.spinningAudit = false
-        } else {
-          this.visibleAudit = false
-          this.spinningAudit = false
-        }
-      })
-    },
-    // 编辑
-    handleEdit () {
-      const row = this.detailData
-      this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+      this.$router.push({ name: 'salesReturnList', query: { closeLastOldTab: true } })
     },
     //  详情
     getDetail () {

+ 4 - 10
src/views/salesReturnManagement/salesReturn/importGuideModal.vue

@@ -15,8 +15,8 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为<span>{{ params.grabFlag=='0'?'':'“销售单号”、' }}</span>“产品编码”、“数量”、“价格”、“退货原因”的列,且名称必须相同</li>
-            <li>2) 除了<span>{{ params.grabFlag=='0'?'':'“销售单号”、' }}</span>“产品编码”、“数量”、“价格”、“退货原因”<span>{{ params.grabFlag=='0'?'':'五' }}</span>列,其他列可自定义,不影响数据导入</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“价格”、“退货原因”的列,且名称必须相同</li>
+            <li>2) 除了“产品编码”、“数量”、“价格”、“退货原因”四列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
           <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
@@ -106,7 +106,6 @@ export default {
       if (file) {
         this.paramsData = {
           salesReturnBillSn: this.params.salesReturnBillSn || '',
-          grabFlag: this.params.grabFlag || '',
           path: file
         }
       }
@@ -127,7 +126,7 @@ export default {
     handleExport () {
       const _this = this
       _this.spinning = true
-      salesReturnDownload({ grabFlag: this.params.grabFlag }).then(res => {
+      salesReturnDownload({}).then(res => {
         _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
@@ -150,12 +149,7 @@ export default {
       const link = document.createElement('a')
       link.style.display = 'none'
       link.href = url
-      let fname
-      if (this.params.grabFlag == '0') {
-        fname = '销售退货单产品导入模板-不抓单'
-      } else if (this.params.grabFlag == '1') {
-        fname = '销售退货单产品导入模板-抓单'
-      }
+      const fname = '销售退货单产品导入模板'
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()

+ 85 - 85
src/views/salesReturnManagement/salesReturn/list.vue

@@ -120,67 +120,64 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-warning"
-            v-if="(record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'FINANCIAL_REJECT')&&$hasPermissions('B_salesReturnAudit')"
-            @click="handleEexamine(record)"
-            id="salesReturn-eexamine-btn">审核进度</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource == 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesReturnEdit')"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="salesReturn-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource != 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'HQ_CHANGE'||record.billStatus == 'FINANCIAL_REJECT')&&$hasPermissions('B_salesReturnEdit')"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="salesReturn-edit-btn">改单</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource == 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesReturnDel')"
-            type="link"
-            class="button-error"
-            @click="handleDel(record)"
-            id="salesReturn-del-btn">删除</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource != 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'HQ_CHANGE'||record.billStatus == 'FINANCIAL_REJECT')&&$hasPermissions('B_salesReturnDel')"
-            type="link"
-            class="button-error"
-            @click="handleDel(record)"
-            id="salesReturn-del-btn">取消</a-button>
-
-          <a-button
-            size="small"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="salesReturn-edit-btn">再次编辑</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="salesReturn-edit-btn">申请提货</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-info"
-            @click="handleConfirm(record)"
-            id="salesReturn-edit-btn">客服确认</a-button>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              v-if="record.billStatus == 'WAIT_AUDIT'"
+              @click="handleEexamine(record)"
+              id="salesReturn-eexamine-btn">审核进度</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              v-if="record.billStatus == 'WAIT_SUBMIT'"
+              @click="handleSubmit(record)"
+              id="salesReturn-eexamine-btn">提交</a-button>
+            <a-button
+              size="small"
+              v-if="record.billStatus == 'WAIT_SUBMIT' && $hasPermissions('B_salesReturnEdit')"
+              type="link"
+              class="button-info"
+              @click="handleEdit(record)"
+              id="salesReturn-edit-btn">{{ record.salesReturnBillSource == 'SALES' ? '编辑' : '改单' }}</a-button>
+            <a-button
+              size="small"
+              v-if="record.billStatus == 'WAIT_SUBMIT' && $hasPermissions('B_salesReturnEdit')"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+              id="salesReturn-del-btn">{{ record.salesReturnBillSource == 'SALES' ? '删除' : '取消' }}</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="record.salesReturnBillSource == 'SALES'&&record.billStatus == 'AUDIT_REJECT'"
+              @click="handleAgainEdit(record)"
+              id="salesReturn-edit-btn">再次编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="record.billStatus == 'WAIT_RECEIVE'"
+              @click="handleEdit(record)"
+              id="salesReturn-edit-btn">申请提货</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'WAIT_CUSTOMER_SERVICE_CONFIRM'"
+              @click="handleConfirm(record)"
+              id="salesReturn-edit-btn">客服确认</a-button>
+          </div>
         </template>
       </s-table>
     </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="handleEdit" @cancel="openModal=false"></choose-custom-modal>
-    <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_CHECK')" @fail="auditOrder('AUDIT_REJECT')" />
+    <!-- 审核进度 -->
+    <verifyModal :openModal="visibleAudit" :itemSn="auditInfo&&auditInfo.salesReturnBillSn" @close="visibleAudit=false"></verifyModal>
   </a-card>
 </template>
 
@@ -191,9 +188,9 @@ import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
 import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
-import auditModal from '@/views/common/auditModal.vue'
+import verifyModal from './verifyModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { salesReturnList, salesReturnQueryCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
+import { salesReturnList, updateAgain, salesReturnDel } from '@/api/salesReturn'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 export default {
@@ -205,7 +202,7 @@ export default {
     chooseCustomModal,
     dealerSubareaScopeList,
     rangeDate,
-    auditModal,
+    verifyModal,
     subarea
   },
   data () {
@@ -265,14 +262,14 @@ export default {
         { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否同步给客户', dataIndex: 'syncFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户采退申请单号', dataIndex: 'purchaseReturnBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否同步给客户', dataIndex: 'syncFlag', width: '7%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
+        { title: '客户采退申请单号', dataIndex: 'purchaseReturnApplyNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请退货数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库实收数量', dataIndex: 'totalBadQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '良品数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'totalGoodQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -303,6 +300,27 @@ export default {
     handleEdit (row) {
       this.$router.push({ name: 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
     },
+    // 再次编辑
+    handleAgainEdit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '系统将自动生成一个新的销售退货单,与原单据内容相同。确认再次编辑吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          updateAgain({ salesReturnBillSn: row.salesReturnBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     // 详情
     handleDetail (row) {
       this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillSn } })
@@ -328,27 +346,14 @@ export default {
         }
       })
     },
-    //  审核
+    //  审核进度
     handleEexamine (row) {
       this.auditInfo = row
       this.visibleAudit = true
     },
-    auditOrder (billStatus) {
-      this.spinningAudit = true
-      salesReturnAudit({
-        salesReturnBillSn: this.auditInfo.salesReturnBillSn,
-        billStatus: billStatus
-      }).then(res => {
-        if (res.status == 200) {
-          this.visibleAudit = false
-          this.$message.success(res.message)
-          this.$refs.table.refresh()
-          this.spinningAudit = false
-        } else {
-          this.visibleAudit = false
-          this.spinningAudit = false
-        }
-      })
+    // 提交
+    handleSubmit (row) {
+
     },
     resetSearchForm () {
       this.$refs.rangeCreateDate.resetDate()
@@ -368,11 +373,6 @@ export default {
       this.queryParam.shippingAddrProvinceSn = undefined
       this.$refs.table.refresh(true)
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  省/市/区
     getArea (leve, sn) {
       let params

+ 28 - 22
src/views/salesReturnManagement/salesReturn/queryPart.vue

@@ -2,24 +2,26 @@
   <div class="salesReturnList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <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="产品编码">
-              <a-input id="salesReturnList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="salesReturnList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturnList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
+      <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="产品编码">
+                <a-input id="salesReturnList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="salesReturnList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturnList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
     </div>
     <!-- 列表 -->
     <s-table
@@ -49,12 +51,15 @@
       <!-- 退货原因 -->
       <template slot="returnReason" slot-scope="text, record">
         <div @dblclick.stop>
-          <v-select
+          <a-select
             style="width:100%;"
             v-model="record.returnReason"
-            code="RETURN_REASON"
             placeholder="请选择退货原因"
-            allowClear></v-select>
+            allowClear>
+            <a-select-option v-for="item in returnReasonList" :value="item.code">
+              {{ item.dispName }}
+            </a-select-option>
+          </a-select>
         </div>
       </template>
       <span slot="customTitle">
@@ -89,7 +94,8 @@ export default {
   name: 'QueryPart',
   components: { STable, VSelect },
   props: {
-    newLoading: Boolean
+    newLoading: Boolean,
+    returnReasonList: Array
   },
   data () {
     return {

+ 48 - 18
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -10,21 +10,40 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont" v-show="ordeDetail&&ordeDetail.salesReturnBillSource=='SALES'">
         <!-- 查询配件列表 -->
-        <queryPart ref="partQuery" :newLoading="isInster" @add="saveProduct"></queryPart>
+        <queryPart ref="partQuery" :returnReasonList="returnReasonList" :newLoading="isInster" @add="saveProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
-        <div style="position: relative;width: 100%;">
-          <!-- alert -->
-          <a-alert style="margin-bottom: 10px;width: 80%;" type="info">
-            <div slot="message" class="total-bar">
-              <div>
-                <span>申请退货数量:{{ ordeDetail&&(ordeDetail.totalQty || ordeDetail.totalQty==0) ? ordeDetail.totalQty : '--' }};</span>
-                <span v-if="$hasPermissions('B_isShowPrice')">参考退货金额:{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? ordeDetail.totalAmount : '--' }}元;</span>
-              </div>
+        <a-alert style="margin-bottom: 10px;" type="info">
+          <div slot="message" class="total-bar">
+            <div>
+              <span>申请退货数量:{{ ordeDetail&&(ordeDetail.totalQty || ordeDetail.totalQty==0) ? ordeDetail.totalQty : '--' }};</span>
+              <span v-if="$hasPermissions('B_isShowPrice')">参考退货金额:{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? ordeDetail.totalAmount : '--' }}元;</span>
             </div>
-          </a-alert>
-          <div style="position: absolute;right: 0;top: 3px;">
-            <a-button size="small" type="primary" class="button-info" id="salesReturnEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
+          </div>
+        </a-alert>
+        <div class="table-page-search-wrapper" style="display:flex;align-items: center;justify-content: space-between;">
+          <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="产品编码">
+                    <a-input v-model.trim="productForm.productEntity.code" allowClear placeholder="请输入产品编码"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品名称">
+                    <a-input v-model.trim="productForm.productEntity.name" allowClear placeholder="请输入产品名称"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form>
+          </div>
+          <div>
+            <a-button type="primary" class="button-info" id="salesReturnEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
           </div>
         </div>
         <!-- 已选配件列表 -->
@@ -66,13 +85,16 @@
           </template>
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
-            <v-select
+            <a-select
               style="width:100%;"
               v-model="record.returnReason"
               @change="updateReason(record)"
-              code="RETURN_REASON"
               placeholder="请选择退货原因"
-              allowClear></v-select>
+              allowClear>
+              <a-select-option v-for="item in returnReasonList" :value="item.code">
+                {{ item.dispName }}
+              </a-select-option>
+            </a-select>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
@@ -110,7 +132,7 @@ import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import queryPart from './queryPart.vue'
 import EditableCell from '@/views/common/editInput.js'
-import chooseDepartUserModal from '../../expenseManagement/expenseReimbursement/chooseDepartUserModal.vue'
+import chooseDepartUserModal from './chooseDepartUserModal.vue'
 import { salesReturnDetail, salesReturnSubmit, salesReturnBatchInsert } from '@/api/salesReturn'
 import {
   salesReturnDetailList,
@@ -144,7 +166,11 @@ export default {
       // 已选产品
       dataSource: [],
       productForm: {
-        salesReturnBillSn: ''
+        salesReturnBillSn: '',
+        productEntity: {
+          name: '', // 产品名称
+          code: '' //  产品编码
+        }
       },
       chooseLoadData: [],
       // 加载数据方法 必须为 Promise 对象
@@ -170,7 +196,8 @@ export default {
         })
       },
       openGuideModal: false, //  导入产品引导
-      total: 0
+      total: 0,
+      returnReasonList: [] // 申请退货列表
     }
   },
   computed: {
@@ -280,6 +307,8 @@ export default {
     },
     //  重置
     resetSearchForm (flag) {
+      this.productForm.productEntity.code = ''
+      this.productForm.productEntity.name = ''
       this.$refs.table.refresh(!!flag)
       this.getOrderDetail()
     },
@@ -349,6 +378,7 @@ export default {
       this.buyerSn = this.$route.params.buyerSn
       this.resetSearchForm(true)
       this.$refs.partQuery.pageInit(this.buyerSn, 0)
+      this.returnReasonList = this.$store.state.app.returnReason
     }
   },
   mounted () {

+ 97 - 0
src/views/salesReturnManagement/salesReturn/verifyModal.vue

@@ -0,0 +1,97 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="销售退货单审核进度"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <p>说明:以下信息来自钉钉</p>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        :defaultLoadData="true"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { getProcessInstance } from '@/api/expenseManagement'
+export default {
+  name: 'VerifyModal',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text != '0' ? '请在钉钉中查看附件内容' : '--' } },
+        { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return getProcessInstance({ businessType: 'SALES_RETURN', businessSn: this.itemSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
+          } else {
+            this.isShow = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 1 - 1
vue.config.js

@@ -107,7 +107,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.183:8602/ocs-admin',
+        target: 'http://192.168.0.102:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
         // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,