Browse Source

修改bug

web100 2 years ago
parent
commit
72a9915042

+ 24 - 0
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -53,3 +53,27 @@ export const delOrderItem = (data) => {
     params: data
   })
 }
+//申请退款 
+export const checkOrder = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/checkOrder',
+    method: 'post',
+    data: data
+  })
+}
+//确认退款
+export const confirmRefund = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/confirmRefund',
+    method: 'post',
+    data: data
+  })
+}
+//撤销请核
+export const revokeCheckOrder = (data) => {
+  return request({
+    url: '/api/blade-sales-part/order/revokeCheckOrder',
+    method: 'post',
+    data: data
+  })
+}

+ 1 - 0
src/views/approveData/index.vue

@@ -47,6 +47,7 @@
         <span v-else-if="scope.row.checkType == 'HYJK-FY'">海运进口费用</span>
         <span v-else-if="scope.row.checkType == 'XSTD'">销售退单请核</span>
         <span v-else-if="scope.row.checkType == 'YPJ-XSTH'">销售退款退货</span>
+        <span v-else-if="scope.row.checkType == 'PJTK'">售后</span>
       </template>
       <!-- <template slot="menuLeft">
         <el-button size="small" type="success" :disabled="selectionList.length == 0" @click.stop="batchCheck">批量审批

+ 1 - 0
src/views/purchasingManagement/inStock/index.vue

@@ -77,6 +77,7 @@ export default {
     },
     activated() {
         setTimeout(() => {
+            console.log(this.$route.query.check);
             if (this.$route.query.check && this.show) {
                 this.editOpen({ id: this.$route.query.check.srcBillId }, 1)
                 this.show = false;

+ 2 - 2
src/views/tirePartsMall/basicData/customerInformation/index.vue

@@ -263,7 +263,7 @@ export default {
   },
   activated(){
     console.log(1);
-    this.$refs.crud.refreshTable()
+    // this.$refs.crud.refreshTable()
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(207), option);
@@ -356,7 +356,7 @@ export default {
       this.show = false;
     },
     onLoad(page, params = {}) {
-      this.$refs.crud.refreshTable()
+      // this.$refs.crud.refreshTable()
       let data = this.deepClone(Object.assign(params, this.search));
       if (data.date && data.date.length > 0) {
         data.startTime = data.date[0]

+ 15 - 3
src/views/tirePartsMall/inventory/index.vue

@@ -51,6 +51,7 @@ export default {
         delBtn: false,
         addBtn: false,
         index: true,
+        width:'100%',
         span: 8,
         border: true,
         menu:false,
@@ -66,19 +67,30 @@ export default {
         dialogWidth: "70%",
         summaryText: "合计",
         showSummary: true,
-        sumColumnList:[],
+        sumColumnList:[
+            {
+              name: 'balanceQuantity',
+              type: 'sum',
+            },
+            {
+              name: 'storeInventory',
+              type: 'sum',
+            },
+            {
+              name: 'inventoryAmount',
+              type: 'sum',
+            },
+        ],
         column: [{
           label: '物料编号',
           prop: "code",
           search: true,
           overHidden: true,
-          width:100
         },{
           label: '商品名称',
           prop: "cname",
           search: true,
           overHidden: true,
-          width:120
         },{
           label: '品牌',
           prop: "brandName",

+ 2 - 2
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -49,7 +49,7 @@
                             </template>
                         </avue-crud>
                     </el-tab-pane>
-                    <el-tab-pane label="订单信息" name="payment_details">
+                    <el-tab-pane label="采购信息" name="payment_details">
                         <avue-crud :option="optionPaymentDetails" ref="payment_details" :data="form.shipVOList" :key="key"
                             @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 274.2)"
                             @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 274.2)">
@@ -345,7 +345,7 @@ export default {
                 }, {
                     label: "入库数量",
                     prop: "goodsNum",
-                    disabled:false,
+                    disabled:true,
                     ovrHidden: true,
                 }, {
                     label: "实际数量",

+ 20 - 15
src/views/tirePartsMall/salesManagement/outboundWorkOrder/detailsPage.vue

@@ -15,7 +15,7 @@
         </el-button>
         <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer" v-if="form.statusName !== '已出库'">保存数据
         </el-button>
-        <el-button class="el-button--small-yh" type="success" size="small" v-if="form.statusName == '待出库' || form.statusName == '撤销出库'"
+        <el-button class="el-button--small-yh" type="success" size="small" style="margin-left: 6px;" v-if="form.statusName == '待出库' || form.statusName == '撤销出库'"
           @click="complete">出库完成
         </el-button>
       </div>
@@ -139,17 +139,8 @@ export default {
             message: " ",
             trigger: "blur"
           }]
-        }, {
-          label: '商品数量',
-          prop: "goodsTotalNum",
-          rules: [
-            {
-              required: true,
-              message: " ",
-              trigger: "blur"
-            }
-          ]
-        }, {
+        },
+        {
           label: '业务日期',
           prop: "createTime",
           type: "datetime",
@@ -163,7 +154,8 @@ export default {
               trigger: "blur"
             }
           ]
-        }, {
+        },
+        {
           label: '入库单号',
           disabled:true,
           prop: "ordNo",
@@ -174,11 +166,24 @@ export default {
               trigger: "blur"
             }
           ],
-        }, {
+        }, 
+        {
           label: '来源单号',
           disabled:true,
           prop: "srcOrdNo"
-        }, {
+        }, 
+         {
+          label: '商品数量',
+          prop: "goodsTotalNum",
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
+        },
+        {
           label: '备注',
           prop: "remarks",
           type: 'textarea',

+ 178 - 31
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -21,9 +21,9 @@
                         售 后<i class="el-icon-arrow-down el-icon--right"></i>
                     </el-button>
                     <el-dropdown-menu slot="dropdown">
-                        <el-dropdown-item @click.native="applySettlement('申请')">申请退款
+                        <el-dropdown-item @click.native="applySettlement('申请')" :disabled="isApplySettlement">申请退款
                         </el-dropdown-item>
-                        <el-dropdown-item @click.native="applySettlement('确认')">确认退款
+                        <el-dropdown-item @click.native="confirmRefundBtn('确认')" :disabled="isConfirmRefundBtn">确认退款
                         </el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
@@ -32,13 +32,12 @@
                         审 批<i class="el-icon-arrow-down el-icon--right"></i>
                     </el-button>
                     <el-dropdown-menu slot="dropdown">
-                        <el-dropdown-item @click.native="applySettlement('审批')">审批
+                        <el-dropdown-item @click.native="examineBtn('审批')" :disabled="isExamineBtn">审批
                         </el-dropdown-item>
-                        <el-dropdown-item @click.native="applySettlement('请核')">请核进度
+                        <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">请核进度
                         </el-dropdown-item>
-                        <el-dropdown-item @click.native="applySettlement('撤销')">撤销请核
+                        <el-dropdown-item @click.native="revocationRequest('撤销')" :disabled="isRevocationRequest">撤销请核
                         </el-dropdown-item>
-
                     </el-dropdown-menu>
                 </el-dropdown>
             </div>
@@ -111,22 +110,42 @@
                 </el-tabs>
             </trade-card>
             <report-dialog :switchDialog="switchDialog" @onClose="onClose()"></report-dialog>
+            <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
+                :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+                <check :checkData="checkData" :checkDetail="true" :idList="[]" @operationType="operationType"
+                    @choceCheckFun="choceCheckFun">
+                </check>
+            </el-dialog>
+            <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
+                :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+                <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
+            </el-dialog>
         </div>
     </div>
 </template>
 
 <script>
 import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
-import { getDetails, submit, generateShipTask, tradingBox,delOrderItem } from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { getDetails, submit, generateShipTask, tradingBox, delOrderItem, checkOrder, confirmRefund, revokeCheckOrder } from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
 import reportDialog from "@/components/report-dialog/main";
-
+import checkSchedule from "@/components/check/checkSchedule";
+import check from "@/components/check/check";
 export default {
     name: "detailsPage",
     data() {
         return {
             isDisabled: false,
             contactsOption: [],
+            checkData: {},
+            checkScheduleDialog: false,
+            isApplySettlement: true,
+            isConfirmRefundBtn: true,
+            isExamineBtn: true,
+            isRevocationRequest: true,
+            checkDialog: false,
+            checkId: '',
+            batchNo: '',
             switchDialog: false,
             activeName: "sale_detail",
             disabled: false,
@@ -359,13 +378,14 @@ export default {
                     prop: 'goodsId',
                     width: 200,
                     disabled: false,
+                    remote: true,
                     overHidden: true,
                     type: 'select',
                     props: {
                         label: 'cname',
                         value: 'id'
                     },
-                    dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll'
+                    dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
                 }, {
                     label: '物料编码',
                     prop: 'goodsNo',
@@ -435,7 +455,12 @@ export default {
                     prop: 'goodsNum',
                     overHidden: true,
                     disabled: false,
-                    width: 100
+                    width: 100,
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }]
                 },
 
                 {
@@ -444,6 +469,11 @@ export default {
                     overHidden: true,
                     width: 100,
                     disabled: false,
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }]
                 },
 
                 {
@@ -452,8 +482,9 @@ export default {
                     disabled: false,
                     overHidden: true,
                     width: 100,
-                    disabled: true
-
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
                 },
                 // {
                 //     label: '利润',
@@ -466,7 +497,9 @@ export default {
                     prop: 'subTotalMoney',
                     overHidden: true,
                     width: 100,
-                    disabled: true
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
                 },
                 // {
                 //     label: '返利',
@@ -479,15 +512,19 @@ export default {
                     prop: 'costprie',
                     overHidden: true,
                     width: 100,
-                    disabled: true
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
+
                 },
                 {
                     label: '毛利',
                     prop: 'grossProfit',
                     overHidden: true,
                     width: 100,
-                    disabled: true
-
+                    disabled: true,
+                    editDisplay: false,
+                    addDisplay: false
                 },
                 {
                     label: '备注',
@@ -564,14 +601,13 @@ export default {
             }
         }
     },
-    components: { reportDialog },
+    components: { reportDialog, check, checkSchedule },
     props: {
         onLoad: Object,
         detailData: Object
     },
     async created() {
         this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
-            console.log('走i在');
             if (this.formContacts.goodsId !== value) {
                 goodsDetail({ id: value }).then(res => {
                     this.formContacts.goodsNo = res.data.data.code
@@ -594,9 +630,8 @@ export default {
                 })
             }
         }
-        console.log(1);
         this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
-        console.log('this.optionContacts.column',this.optionContacts.column);
+        console.log('this.optionContacts.column', this.optionContacts.column);
         this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
             console.log('走i在');
             if (this.formContacts.goodsId !== value) {
@@ -628,17 +663,18 @@ export default {
             console.log(1);
             this.refresh(this.onLoad.id, true)
         } else if (this.onLoad.id) {
-            console.log(2);
             this.refresh(this.onLoad.id, true)
         }
-
+        if(!this.form.id){
+            this.$set(this.optionContacts, "addBtn", true)
+        }
     },
     methods: {
         generateOutbound() {
-            if(this.form.orderItemsList.length <=0){
+            if (this.form.orderItemsList.length <= 0) {
                 this.$message.error('请录入明细');
-            
-            }else{
+
+            } else {
                 this.$refs["form"].validate((valid, done) => {
                     done();
                     if (valid) {
@@ -658,7 +694,6 @@ export default {
                 })
             }
         },
-
         //联系人change
         contactsChange(e) {
             console.log(e);
@@ -667,8 +702,8 @@ export default {
             // 假设this.contactsOption是你的数组对象
             let matchedContact = this.contactsOption.find(item => item.contacts == e);
             // 判断是否找到匹配的对象
-            this.$set(this.form,'phone',matchedContact.tel)
-            this.$set(this.form,'recAddress',matchedContact.belongtoarea + matchedContact.detailedAddress)
+            this.$set(this.form, 'phone', matchedContact.tel)
+            this.$set(this.form, 'recAddress', matchedContact.belongtoarea + matchedContact.detailedAddress)
 
         },
         //修改提交触发
@@ -707,17 +742,42 @@ export default {
             getDetails({ id: id }).then(res => {
                 console.log('res', res);
                 this.form = res.data.data
-                console.log(this.form.businessSource);
+                if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核') {
+                    console.log(1);
+                    this.isApplySettlement = false;
+                }
+
+                if (this.form.status == '退款中' ) {
+                    console.log(2);
+                    this.isConfirmRefundBtn = false;
+                }
+
+                if (this.form.status == '退款请核') {
+                    console.log(3);
+                    this.isExamineBtn = false;
+                }
+
+                console.log(this.form.status == '退款请核' || this.form.status == '退款中');
+
+                if (this.form.status == '退款请核' || this.form.status == '退款中') {
+                    console.log(4);
+                    this.isRevocationRequest = false;
+                }
                 this.form.orderItemsList.forEach((items) => {
                     if (!items.subTotalMoney) {
                         items.subTotalMoney = items.goodsNum * items.price
                         items.grossProfit = items.subTotalMoney - items.costprie
                     }
                 })
-
                 loading.close();
+
                 if (this.form.businessSource == "外部销售") {
                     console.log('外部销售');
+                    this.optionForm.column.forEach(its => {
+                        if (its.prop == 'customerId') {
+                            this.$set(its, 'disabled', true)
+                        }
+                    })
                     //不能录入不能删除
                     this.$set(this.optionContactsBack, "addBtn", false)
                     this.isDisabled = true
@@ -750,6 +810,7 @@ export default {
                             item.disabled = true;
                         }
                     })
+                    console.log(324324);
                     this['optionContacts'] = this['optionContactsBack'];
                     this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
                 }
@@ -759,6 +820,92 @@ export default {
                 loading.close();
             })
         },
+        //请核关闭
+        choceScheduleFun() {
+            this.checkScheduleDialog = false
+        },
+        //关闭审核
+        choceCheckFun() {
+            this.checkDialog = false;
+        },
+        //申请退款
+        applySettlement(type) {
+            this.$confirm("您确定申请退款吗?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                this.$refs["form"].validate((valid, done) => {
+                    done()
+                    if (valid) {
+                        console.log(this.form);
+                        console.log(this.$store.getters.domSaleStatus);
+                        const data = {
+                            id: this.form.id,
+                            url: '/tirePartsMall/salesManagement/saleOrder/index',
+                            pageStatus: "this.$store.getters.domSaleStatus",
+                            pageLabel: "销售订单",
+                        }
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        checkOrder({ ...data }).then((res) => {
+                            loading.close();
+                            this.$message.success('申请退款成功');
+                            console.log(res);
+                        }).catch(() => { loading.close(); })
+                    }
+                })
+            })
+        },
+        //确认退款
+        confirmRefundBtn() {
+            this.$confirm("您确定退款吗?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '加载中',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(255,255,255,0.7)'
+                });
+                confirmRefund({ ...this.form }).then((res) => {
+                    loading.close()
+                    this.$message.success('确定退款成功');
+                }).catch(() => { loading.close(); })
+            })
+        },
+        //审批
+        examineBtn() {
+            console.log(this.$route.query.check);
+            this.checkData = this.$route.query.check
+            this.checkDialog = true;
+        },
+        //撤销请核
+        revocationRequest() {
+            this.$confirm("您确定撤回此次申请吗?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '加载中',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(255,255,255,0.7)'
+                });
+                revokeCheckOrder({ ...this.form }).then(res => {
+                    loading.close();
+                    this.$message.success('撤回成功')
+                    this.refresh(this.form.id)
+                })
+            })
+        },
         rowDelBox(row, index, type) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
@@ -768,7 +915,7 @@ export default {
                 if (row.id) {
                     console.log(index);
                     console.log(this.form.orderItemsList);
-                    delOrderItem({ids:row.id}).then(res => {
+                    delOrderItem({ ids: row.id }).then(res => {
                         this.form.orderItemsList.splice(index, 1);
                         this.$message.success("操作成功!");
                     });

+ 27 - 23
src/views/tirePartsMall/salesManagement/saleOrder/index.vue

@@ -1,24 +1,13 @@
 <template>
   <div>
     <basic-container v-show="!detailsOpen">
-      <avue-crud
-          :option="option"
-          :search.sync="search"
-          v-model="form"
-          :table-loading="loading"
-          :data="dataList"
-          ref="crud"
-          :key="key"
-          @on-load="onLoad"
-          @search-change="searchChange"
-          @row-del="rowDel"
-          @refresh-change="refreshChange"
-          @resetColumn="resetColumnTwo('crud','option','optionList',269)"
-          @saveColumn="saveColumnTwo('crud','option','optionList',269)"
-          :page.sync="page">
+      <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
+        ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange" @row-del="rowDel"
+        @refresh-change="refreshChange" @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 269)"
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 269)" :page.sync="page">
         <template slot-scope="{type,size,row,index}" slot="menu">
-          <el-button  :size="size" :type="type" @click="check(row)">查看</el-button>
-          <el-button :size="size" :type="type" @click="$refs.crud.rowDel(row,index)" >删除</el-button>
+          <el-button :size="size" :type="type" @click="check(row)">查看</el-button>
+          <el-button :size="size" :type="type" @click="$refs.crud.rowDel(row, index)">删除</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>
@@ -34,7 +23,7 @@
 </template>
 
 <script>
-import {getList, remove} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { getList, remove } from "@/api/tirePartsMall/salesManagement/saleOrder";
 import detailsPage from "./detailsPage"
 
 export default {
@@ -78,7 +67,7 @@ export default {
         dialogWidth: "70%",
         summaryText: "合计",
         showSummary: true,
-        sumColumnList:[],
+        sumColumnList: [],
         column: [{
           label: '销售单号',
           prop: "ordNo",
@@ -89,7 +78,7 @@ export default {
           prop: "srcOrdNo",
           search: true,
           overHidden: true,
-        }, 
+        },
         {
           label: "业务来源",
           prop: "businessSource",
@@ -196,6 +185,15 @@ export default {
       }
     }
   },
+  activated() {
+    console.log(213213213213);
+    setTimeout(() => {
+      console.log(this.$route.query.check);
+      if (this.$route.query.check) {
+        this.editOpen({ id: this.$route.query.check.srcBillId }, 1)
+      }
+    }, 100);
+  },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(269), this.optionList);
     this.key++
@@ -222,6 +220,14 @@ export default {
       }
       this.onLoad(this.page, this.search)
     },
+    editOpen(row, status) {
+      this.form = row
+      // this.detailData = {
+      //   id: row.id,
+      //   status: status
+      // };
+      this.detailsOpen = true;
+    },
     //刷新
     refreshChange() {
       this.onLoad(this.page, this.search)
@@ -291,6 +297,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>