Просмотр исходного кода

修改仓库下拉接口 新加审批接口

Qukatie 1 неделя назад
Родитель
Сommit
69825f9d41

+ 8 - 0
src/api/storehouse/plan.js

@@ -39,6 +39,14 @@ export const itemRemove = (data) => {
     })
 }
 
+//审核
+export const auditPlan = (data) => {
+    return request({
+        url: '/api/blade-sales-part//tire/center/warehouse/plan/auditPlan',
+        method: 'POST',
+        data: data
+    })
+}
 export const goodsListXs = (customId, stock) => {
     return request({
         url: '/api/blade-sales-part/goodsDesc/goodsListXs',

+ 61 - 12
src/views/storehouse/inStockManage/inStockPlan/detailsPage.vue

@@ -16,12 +16,21 @@
                 <el-button class="el-button--small-yh" v-if="form.id && form.status == 0" style="margin-left: 6px;"
                     type="success" size="small" @click="editCustomer(1)" :disabled="form.status == 1">提 交
                 </el-button>
-                <el-button class="el-button--small-yh" v-if="form.status == 1" style="margin-left: 6px;" type="success"
+                <!-- <el-button class="el-button--small-yh" v-if="form.status == 1" style="margin-left: 6px;" type="success"
                     size="small" @click="editCustomer(2)">通 过
                 </el-button>
                 <el-button class="el-button--small-yh" v-if="form.status == 1" style="margin-left: 6px;" type="danger"
                     size="small" @click="approve()">驳 回
-                </el-button>
+                </el-button> -->
+                <el-dropdown v-if="form.status == 1">
+                    <el-button style="margin-left: 6px;" type="success" size="small">
+                        审 核<i class="el-icon-arrow-down el-icon--right"></i>
+                    </el-button>
+                    <el-dropdown-menu slot="dropdown">
+                        <el-dropdown-item @click.native="auditPlan(2)">通过</el-dropdown-item>
+                        <el-dropdown-item @click.native="approve()">驳回</el-dropdown-item>
+                    </el-dropdown-menu>
+                </el-dropdown>
             </div>
         </div>
         <div style="margin-top: 50px">
@@ -204,12 +213,12 @@
         <el-dialog title="驳回数据" append-to-body :visible.sync="approveVisible" width="30%" :close-on-click-modal="false"
             v-dialog-drag>
             <span>
-                <el-input type="textarea" :rows="5" placeholder="请输入驳回原因" v-model="textarea">
+                <el-input type="textarea" :rows="5" placeholder="请输入驳回原因" v-model="auditMsg">
                 </el-input>
             </span>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="approveVisible = false" size="mini">取消</el-button>
-                <el-button type="danger" @click="approveVisible = false; editCustomer(3)" size="mini">确定</el-button>
+                <el-button type="danger" @click="approveVisible = false; auditPlan(3)" size="mini">确定</el-button>
             </span>
         </el-dialog>
     </div>
@@ -228,12 +237,13 @@ import check from "@/components/checkL/check";
 import { getCorpType, getList } from "@/api/tirePartsMall/basicData/commodityInformation"
 import { isProcurement } from "@/api/basicData/configuration";
 import commodity from "../../configuration/commodity.json";
-import { getDetails, submit, itemRemove } from "@/api/storehouse/plan.js";
+import { getDetails, submit, itemRemove, auditPlan } from "@/api/storehouse/plan.js";
 import dicSelect from "@/components/dicSelect/main";
 export default {
     name: "detailsPage",
     data() {
         return {
+            auditMsg: null,
             approveVisible: false,
             excelBox: false,
             numberDecimal: 0,
@@ -820,7 +830,7 @@ export default {
                     getCustom({ id: row.id }).then(res => {
                         if (res.data.data) {
                             this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
-                            this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
+                            // this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
                             this.form.contacts = res.data.data.corpsAttnList[0].cname
                             this.form.phone = res.data.data.corpsAttnList[0].tel
                             this.contactsOption = res.data.data.corpsAddrList
@@ -830,7 +840,7 @@ export default {
                     this.form.customerId = null
                     this.form.customerName = null
                     this.dicUrlWithCustomId = null
-                    this.form.storageId = null
+                    // this.form.storageId = null
                     this.form.contacts = null
                     this.form.phone = null
                 }
@@ -1173,6 +1183,38 @@ export default {
         },
         approve(type) {
             this.approveVisible = true
+            this.auditMsg = null
+        },
+        auditPlan(type) {
+            if (type == 2) {
+                this.$confirm('是否提交审核?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let obj = {
+                        id: this.form.id,
+                        status: type,
+                        auditMsg: type == 3 ? this.auditMsg : null,
+                        version: this.form.version
+                    }
+                    auditPlan(obj).then(res => {
+                        this.getDetail(this.form.id)
+                    })
+                })
+            }
+            if (type == 3) {
+                let obj = {
+                    id: this.form.id,
+                    status: type,
+                    auditMsg: type == 3 ? this.auditMsg : null,
+                    version: this.form.version
+                }
+                auditPlan(obj).then(res => {
+                    this.getDetail(this.form.id)
+                })
+            }
+
         },
         //修改提交触发
         editCustomer(type) {
@@ -1201,19 +1243,22 @@ export default {
                             this.form.planItemsList[i].sendNum = 0
                         }
                     }
-                    this.form.status = type
+                    let obj = {
+                        ...this.form,
+                        storageName: this.form.$storageId ? this.form.$storageId : '',
+                        status: type,
+                    }
                     const loading = this.$loading({
                         lock: true,
                         text: '加载中',
                         spinner: 'el-icon-loading',
                         background: 'rgba(255,255,255,0.7)'
                     });
-                    this.form.storageName = this.form.$storageId ? this.form.$storageId : ''
-                    submit(this.form).then(res => {
+
+                    submit(obj).then(res => {
                         this.$message.success("操作成功");
                         this.mingxibaocun = true
                         this.getDetail(res.data.data)
-                        loading.close();
                     }).finally(() => {
                         loading.close();
                     });
@@ -1319,7 +1364,11 @@ export default {
         },
         rowAdd(row) {
             if (!this.form.customerId) {
-                this.$message.error('请选择供应商')
+                this.$message.error('请选择货主')
+                return
+            }
+            if (!this.form.storageId) {
+                this.$message.error('请选择仓库')
                 return
             }
             this.optionContactsBack.column.forEach(its => {

+ 1 - 1
src/views/storehouse/inStockManage/wordOrder/detailsPage.vue

@@ -226,7 +226,7 @@ export default {
                         search: true,
                         overHidden: true,
                         type: 'select',
-                        dicUrl: "/api/blade-sales-part/storageDesc/listAll",
+                        dicUrl: "/api/blade-sales-part/tire/center/warehouse/storage/storageSelectedList",
                         disabled: false,
                         props: {
                             label: 'cname',

+ 1 - 1
src/views/storehouse/inStockManage/wordOrder/index.vue

@@ -239,7 +239,7 @@ export default {
           overHidden: true,
           filterable: true,
           type: 'select',
-          dicUrl: "/api/blade-sales-part/storageDesc/listAll",
+          dicUrl: "/api/blade-sales-part/tire/center/warehouse/storage/storageSelectedList",
           props: {
             label: 'cname',
             value: 'id'

+ 11 - 2
src/views/storehouse/outStockManage/outStockPlan/detailsPage.vue

@@ -434,6 +434,11 @@ export default {
                         value: 'id'
                     },
                     dicUrl: '/api/blade-sales-part/tire/center/warehouse/storage/storageSelectedList',
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }]
                 },
                 {
                     label: '计划出库日期',
@@ -916,7 +921,7 @@ export default {
                     getCustom({ id: row.id }).then(res => {
                         if (res.data.data) {
                             this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
-                            this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
+                            // this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
                             this.form.contacts = res.data.data.corpsAttnList[0].cname
                             this.form.phone = res.data.data.corpsAttnList[0].tel
                             this.contactsOption = res.data.data.corpsAddrList
@@ -926,7 +931,7 @@ export default {
                     this.form.customerId = null
                     this.form.customerName = null
                     this.dicUrlWithCustomId = null
-                    this.form.storageId = null
+                    // this.form.storageId = null
                     this.form.contacts = null
                     this.form.phone = null
                 }
@@ -1406,6 +1411,10 @@ export default {
                 this.$message.error('请选择货主')
                 return
             }
+            if (!this.form.storageId) {
+                this.$message.error('请选择仓库')
+                return
+            }
             this.findObject(this.optionContactsBack.column, 'goodsId').dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=1&stock=${this.form.storageId}`
             this.goodsType = type
             this.optionContactsBack.column.forEach(its => {

+ 1 - 1
src/views/storehouse/outStockManage/wordOrder/detailsPage.vue

@@ -156,7 +156,7 @@ export default {
             label: 'cname',
             value: 'id'
           },
-          dicUrl: '/api/blade-sales-part/storageDesc/listAll',
+          dicUrl: '/api/blade-sales-part/tire/center/warehouse/storage/storageSelectedList',
           rules: [{
             required: true,
             message: " ",

+ 1 - 14
src/views/storehouse/outStockManage/wordOrder/index.vue

@@ -32,14 +32,6 @@
           <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }}
           </span>
         </template>
-        <template slot-scope="{ row, index }" slot="statusName">
-            <span  v-for="item in statusNameData"
-                   :style="{background: item.colour}"
-                   class="bottomBox"
-                   v-if="item.dictKey == row.statusName">
-              {{ item.dictValue }}
-            </span>
-        </template>
       </avue-crud>
     </basic-container>
     <detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
@@ -110,7 +102,6 @@ export default {
   },
   data() {
     return {
-        statusNameData:[], // 状态字典
       dialogVisible: false,
       dialogForm: {},
       courierTypeList: [],
@@ -267,7 +258,7 @@ export default {
             label: 'cname',
             value: 'cname'
           },
-          dicUrl: '/api/blade-sales-part/storageDesc/listAll',
+          dicUrl: '/api/blade-sales-part/tire/center/warehouse/storage/storageSelectedList',
         }
           // , {
           //   label: '商品种类',
@@ -378,10 +369,6 @@ export default {
     }
   },
   async created() {
-      // 状态字段获取
-      this.getWorkDicts("outbound_work_order_status").then(res => {
-          this.statusNameData = res.data.data
-      });
     this.option = await this.getColumnData(this.getColumnName(270), this.optionList);
     this.key++
     let i = 0;