Browse Source

bug 修复

lilei 3 years ago
parent
commit
db811914b6

+ 2 - 1
src/store/getters.js

@@ -16,7 +16,8 @@ const getters = {
   isNewSubTab: state => state.app.isNewSubTab,
   isNewSubTab: state => state.app.isNewSubTab,
   closeTabPages: state => state.app.closeTabPages,
   closeTabPages: state => state.app.closeTabPages,
   loadingStatus: state => state.app.loadingStatus,
   loadingStatus: state => state.app.loadingStatus,
-  employeeList: state => state.app.employeeList
+  employeeList: state => state.app.employeeList,
+  tempBillOfData: state => state.app.tempBillOfData
 }
 }
 
 
 export default getters
 export default getters

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

@@ -35,6 +35,7 @@ const app = {
     closeTabPages: [], // 已关闭的页面
     closeTabPages: [], // 已关闭的页面
     employeeList: [], // 申请人列表
     employeeList: [], // 申请人列表
     returnReason: [], // 申请退货列表
     returnReason: [], // 申请退货列表
+    tempBillOfData: null, // 临时存储收货单数据
   },
   },
   mutations: {
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {
     SET_SIDEBAR_TYPE: (state, type) => {

+ 7 - 0
src/views/salesReturnManagement/billOfLading/add.vue

@@ -371,9 +371,16 @@ export default {
       this.form.attachmentList = ''
       this.form.attachmentList = ''
       this.$refs.attachList.setFileList('')
       this.$refs.attachList.setFileList('')
       this.$refs.ruleForm.resetFields()
       this.$refs.ruleForm.resetFields()
+
       if (this.$route.params.sn) { //  编辑页
       if (this.$route.params.sn) { //  编辑页
         this.getDetail()
         this.getDetail()
         this.getReturnOrderList()
         this.getReturnOrderList()
+      } else {
+        // 从销售退货列表过来的数据
+        const cd = this.$store.state.app.tempBillOfData
+        if (cd) {
+          this.chooseData.push(cd)
+        }
       }
       }
     }
     }
   },
   },

+ 1 - 1
src/views/salesReturnManagement/billOfLading/selectXtModal.vue

@@ -51,7 +51,7 @@
           </template>
           </template>
           <!-- 操作 -->
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
           <template slot="action" slot-scope="text, record">
-            <div v-if="record.billStatus == 'FINISH'">
+            <div v-if="record.billStatus == 'WAIT_RECEIVE'">
               <a-button
               <a-button
                 size="small"
                 size="small"
                 type="link"
                 type="link"

+ 7 - 3
src/views/salesReturnManagement/salesReturn/chooseDepartUserModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :maskClosable="false"
     :title="title+'选择审批人员'"
     :title="title+'选择审批人员'"
     v-model="isShow"
     v-model="isShow"
-    @cancel="isShow=false"
+    @cancel="cancel"
     width="60%">
     width="60%">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <div>
       <div>
@@ -25,7 +25,6 @@
               <dingDepartUser
               <dingDepartUser
                 ref="departUserApp"
                 ref="departUserApp"
                 @loaded="uploading=false"
                 @loaded="uploading=false"
-                @close="isShow=false"
                 id="departUser-approvers"
                 id="departUser-approvers"
                 :disabled="uploading"
                 :disabled="uploading"
                 v-model="form.approvers"
                 v-model="form.approvers"
@@ -50,7 +49,7 @@
         <div class="btn-cont">
         <div class="btn-cont">
           <a-button type="primary" id="departUser-save" @click="handleSave">确定</a-button>
           <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 :loading="uploading" style="margin-left: 15px;" @click="updateUser">刷新人员</a-button>
-          <a-button id="departUser-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+          <a-button id="departUser-back" @click="cancel" style="margin-left: 15px;">取消</a-button>
         </div>
         </div>
       </div>
       </div>
     </a-spin>
     </a-spin>
@@ -80,6 +79,7 @@ export default {
         wrapperCol: { span: 16 }
         wrapperCol: { span: 16 }
       },
       },
       form: {
       form: {
+        applyPersonSn: undefined,
         approvers: [], // 审批人
         approvers: [], // 审批人
         ccList: [] // 抄送人
         ccList: [] // 抄送人
       },
       },
@@ -142,9 +142,13 @@ export default {
         this.$refs.ruleForm.resetFields()
         this.$refs.ruleForm.resetFields()
       })
       })
       this.form = {
       this.form = {
+        applyPersonSn: undefined,
         ccList: undefined,
         ccList: undefined,
         approvers: undefined
         approvers: undefined
       }
       }
+    },
+    cancel () {
+      this.isShow = false
     }
     }
   },
   },
   watch: {
   watch: {

+ 27 - 6
src/views/salesReturnManagement/salesReturn/list.vue

@@ -132,8 +132,8 @@
               size="small"
               size="small"
               type="link"
               type="link"
               class="button-warning"
               class="button-warning"
-              v-if="record.billStatus == 'WAIT_SUBMIT'"
-              @click="handleSubmit(record)"
+              v-if="record.salesReturnBillSource != 'SALES'&&record.billStatus == 'WAIT_SUBMIT'"
+              @click="beforeSubmit(record)"
               id="salesReturn-eexamine-btn">提交</a-button>
               id="salesReturn-eexamine-btn">提交</a-button>
             <a-button
             <a-button
               size="small"
               size="small"
@@ -161,7 +161,7 @@
               type="link"
               type="link"
               class="button-info"
               class="button-info"
               v-if="record.billStatus == 'WAIT_RECEIVE'"
               v-if="record.billStatus == 'WAIT_RECEIVE'"
-              @click="handleEdit(record)"
+              @click="handlePickUp(record)"
               id="salesReturn-edit-btn">申请提货</a-button>
               id="salesReturn-edit-btn">申请提货</a-button>
             <a-button
             <a-button
               size="small"
               size="small"
@@ -178,6 +178,8 @@
     <choose-custom-modal :show="openModal" @ok="handleEdit" @cancel="openModal=false"></choose-custom-modal>
     <choose-custom-modal :show="openModal" @ok="handleEdit" @cancel="openModal=false"></choose-custom-modal>
     <!-- 审核进度 -->
     <!-- 审核进度 -->
     <verifyModal :openModal="visibleAudit" :itemSn="auditInfo&&auditInfo.salesReturnBillSn" @close="visibleAudit=false"></verifyModal>
     <verifyModal :openModal="visibleAudit" :itemSn="auditInfo&&auditInfo.salesReturnBillSn" @close="visibleAudit=false"></verifyModal>
+    <!-- 选择审核人员 -->
+    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
@@ -189,8 +191,9 @@ import { getArea } from '@/api/data'
 import chooseCustomModal from './chooseCustomModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import verifyModal from './verifyModal.vue'
 import verifyModal from './verifyModal.vue'
+import chooseDepartUserModal from './chooseDepartUserModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { salesReturnList, updateAgain, salesReturnDel } from '@/api/salesReturn'
+import { salesReturnList, updateAgain, salesReturnDel, salesReturnSubmit } from '@/api/salesReturn'
 import moment from 'moment'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import getDate from '@/libs/getDate.js'
 export default {
 export default {
@@ -203,6 +206,7 @@ export default {
     dealerSubareaScopeList,
     dealerSubareaScopeList,
     rangeDate,
     rangeDate,
     verifyModal,
     verifyModal,
+    chooseDepartUserModal,
     subarea
     subarea
   },
   },
   data () {
   data () {
@@ -217,6 +221,7 @@ export default {
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  创建时间
       ], //  创建时间
       openModal: false, // 选择客户弹框是否显示
       openModal: false, // 选择客户弹框是否显示
+      openDepartUserModal: false,
       // 查询参数
       // 查询参数
       queryParam: {
       queryParam: {
         beginDate: getDate.getThreeMonthDays().starttime,
         beginDate: getDate.getThreeMonthDays().starttime,
@@ -296,6 +301,11 @@ export default {
     handleConfirm (row) {
     handleConfirm (row) {
       this.$router.push({ name: 'custConfirm', params: { sn: row.salesReturnBillSn } })
       this.$router.push({ name: 'custConfirm', params: { sn: row.salesReturnBillSn } })
     },
     },
+    // 申请提货
+    handlePickUp (row) {
+      this.$store.state.app.tempBillOfData = row
+      this.$router.push({ name: 'billOfLadingAdd' })
+    },
     // 编辑
     // 编辑
     handleEdit (row) {
     handleEdit (row) {
       this.$router.push({ name: 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
       this.$router.push({ name: 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
@@ -351,9 +361,20 @@ export default {
       this.auditInfo = row
       this.auditInfo = row
       this.visibleAudit = true
       this.visibleAudit = true
     },
     },
+    beforeSubmit (row) {
+      this.auditInfo = row
+      this.openDepartUserModal = true
+    },
     // 提交
     // 提交
-    handleSubmit (row) {
-
+    handleSubmit (data) {
+      this.spinning = true
+      salesReturnSubmit({ salesReturnBillSn: this.auditInfo.salesReturnBillSn, ...data }).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh()
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+      })
     },
     },
     resetSearchForm () {
     resetSearchForm () {
       this.$refs.rangeCreateDate.resetDate()
       this.$refs.rangeCreateDate.resetDate()