Forráskód Böngészése

出库修改部分功能 入库修改删除

Qukatie 4 napja
szülő
commit
0e66f4b12f

+ 8 - 55
src/views/storehouse/inStockManage/inStockPlan/detailsPage.vue

@@ -13,10 +13,10 @@
                 <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
                     :disabled="isSaveBtn" @click="editCustomer(0)">保 存
                 </el-button>
-                <el-button class="el-button--small-yh" v-if="form.id && form.status == 0" style="margin-left: 6px;"
+                <!-- <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-dropdown v-if="form.status == 1">
+                </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>
@@ -24,7 +24,7 @@
                         <el-dropdown-item @click.native="auditPlan(2)">通过</el-dropdown-item>
                         <el-dropdown-item @click.native="approve()">驳回</el-dropdown-item>
                     </el-dropdown-menu>
-                </el-dropdown>
+                </el-dropdown> -->
             </div>
         </div>
         <div style="margin-top: 50px">
@@ -121,7 +121,7 @@
                                     @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
                                 </el-button>
                                 <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.status == 2"
-                                    :type="type" @click="rowDel(row, index)">删除
+                                    :type="type" @click="rowDel(row, index,'planItemsList')">删除
                                 </el-button>
                             </template>
                         </avue-crud>
@@ -165,7 +165,7 @@
                                     @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
                                 </el-button>
                                 <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.status == 2"
-                                    :type="type" @click="rowDel2(row, index)">删除
+                                    :type="type" @click="rowDel(row, index,'centerShipCostList')">删除
                                 </el-button>
                             </template>
                         </avue-crud>
@@ -1061,17 +1061,7 @@ export default {
 
                 // 获取单价数据
                 for (let item of this.goodsListShow) {
-                    let page = {}
                     item.goodsNum = item.goodsNum ? item.goodsNum : 0
-                    if (this.form.storageId) {
-                        page.storageId = this.form.storageId
-                    }
-                    page.goodsId = item.id
-                    if (this.form.storageId) {
-                        dotList(page).then(res => {
-                            item.price = res.data.data[0].inventoryCostPrice ? res.data.data[0].inventoryCostPrice : 0
-                        })
-                    }
                 }
                 this.loading = false;
             })
@@ -1084,16 +1074,6 @@ export default {
                 this.$set(row, '$cellEdit', true)
             }
         },
-        // 编辑
-        editBtn(row, index) {
-            this.$refs.formContacts.dicInit()
-            dotList({
-                storageId: this.form.storageId,
-                goodsId: this.formContacts.goodsId
-            }).then(res => {
-                this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
-            })
-        },
         //联系人change
         contactsChange(e) {
             console.log(e);
@@ -1250,26 +1230,7 @@ export default {
                 loading.close();
             })
         },
-        rowDel(row, index) {
-            this.$confirm("确定将选择数据删除?", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning"
-            }).then(() => {
-                if (row.id) {
-                    // itemRemove({ ids: row.id }).then(res => {
-                    //     this.form.planItemsList.splice(index, 1);
-                    //     this.$message.success("操作成功!");
-                    // });
-                    row.isDeleted = 1
-                } else {
-                    this.form.planItemsList.splice(index, 1);
-                    this.$message.success("操作成功!");
-                }
-            }
-            );
-        },
-        rowDel2(row, index) {
+        rowDel(row, index,list) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -1282,8 +1243,7 @@ export default {
                     // });
                     row.isDeleted = 1
                 } else {
-                    this.form.centerShipCostList.splice(index, 1);
-                    this.$message.success("操作成功!");
+                    this.form[list].splice(index, 1);
                 }
             }
             );
@@ -1337,13 +1297,6 @@ export default {
                 this.$message.error('请选择仓库')
                 return
             }
-            this.optionContactsBack.column.forEach(its => {
-                if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
-                    its.disabled = false
-                } else {
-                    its.disabled = true
-                }
-            })
             this.getAllWorkDicts()
             this.refreshChange()
             this.goodsListSave = []

+ 0 - 4
src/views/storehouse/outStockManage/configuration/commodityxsho.json

@@ -59,11 +59,7 @@
     {
       "label": "批次号",
       "prop": "dot",
-      "cell":true,
       "width": "80",
-      "disabled": true,
-      "allowCreate": true,
-      "filterable": true,
       "overHidden": true
     },
     {

+ 95 - 160
src/views/storehouse/outStockManage/outStockPlan/detailsPage.vue

@@ -19,10 +19,11 @@
             <trade-card title="基础信息">
                 <avue-form :option="optionForm" v-model="form" ref="form">
                     <template slot-scope="{row,index}" slot="contacts">
+                        <!-- 联系人 -->
                         <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
                             filterable allow-create default-first-option @change="contactsChange($event)"
-                            :disabled="form.status == 2">
-                            <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
+                            :disabled="editButton || form.status == 2">
+                            <el-option v-for="item in contactsOption" :key="item.cname" :label="item.cname"
                                 :value="item.contacts" />
                         </el-select>
                     </template>
@@ -32,6 +33,19 @@
                             :remote="true" dataName="cname" @selectChange="dicChange('customerName', $event)"
                             :disabled="editButton || form.status == 2"></dic-select>
                     </tempalte>
+                    <tempalte slot="storageName">
+                        <dic-select v-model="form.storageName" placeholder="货主" key="id" label="cname" res="records"
+                            url="/blade-sales-part/tire/center/warehouse/storage/list?current=1&size=5"
+                            :filterable="true" :remote="true" dataName="cname"
+                            @selectChange="dicChange('storageName', $event)"
+                            :disabled="editButton || form.status == 2"></dic-select>
+                    </tempalte>
+                    <tempalte slot="warehouseKeeperName">
+                        <dic-select v-model="form.warehouseKeeperName" placeholder="库管" key="id" label="realName"
+                            res="records" url="/blade-user/page?current=1&size=5&userType=2" :filterable="true"
+                            :remote="true" dataName="realName" @selectChange="dicChange('warehouseKeeperName', $event)"
+                            :disabled="editButton || form.status == 2"></dic-select>
+                    </tempalte>
                 </avue-form>
             </trade-card>
             <trade-card title="明细信息">
@@ -50,34 +64,25 @@
                                 </el-button>
                                 <el-button type="primary" icon="el-icon-printer" size="small"
                                     @click="handlePrint">打印</el-button>
-                                <el-button type="danger" plain size="small" @click="batchDelete"
-                                    :disabled="form.status == 2">一键删除</el-button>
+                                <!-- <el-button type="danger" plain size="small" @click="batchDelete"
+                                    :disabled="form.status == 2">一键删除</el-button> -->
                                 <el-popover width="600" trigger="click">
                                     <avue-crud :data="inventoryData" :option="inventoryOption"></avue-crud>
                                     <el-button type="primary" plain size="small" slot="reference" @click="viewInventory"
                                         :disabled="selectionMultilist.length != 1">查看库存</el-button>
                                 </el-popover>
                             </template>
-                            <template slot="goodsId" slot-scope="{ row }">
-                                {{ row.goodsName }}
-                            </template>
-
                             <template slot="goodsNum" slot-scope="{ row }">
-                                <el-input-number
-                                    v-if="!mingxibaocun && (form.businessSource != '外部销售' && form.businessSource != '共享销售')"
-                                    size="small" v-model="row.goodsNum" :precision="numberDecimal" :controls="false"
-                                    @blur="goodsNumblurfun(row)" style="width: 100%"></el-input-number>
+                                <el-input-number v-if="row.$cellEdit" size="small" v-model="row.goodsNum"
+                                    :precision="numberDecimal" :controls="false" @blur="goodsNumblurfun(row)"
+                                    style="width: 100%" @change="moneyChange(row)"></el-input-number>
                                 <span v-else>{{ row.goodsNum }}</span>
                             </template>
                             <template slot="price" slot-scope="{ row }">
-                                <el-input
-                                    v-if="!mingxibaocun && (form.businessSource != '外部销售' && form.businessSource != '共享销售')"
-                                    size="small" v-model="row.price" style="width: 100%"></el-input>
+                                <el-input v-if="row.$cellEdit" size="small" v-model="row.price" style="width: 100%"
+                                    @change="moneyChange(row)"></el-input>
                                 <span v-else>{{ row.price }}</span>
                             </template>
-                            <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price
-                                }}</template>
-
                             <template slot="remarks" slot-scope="{ row }">
                                 <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks"
                                     style="width: 100%"></el-input>
@@ -93,7 +98,7 @@
                                     @click="hangbaocun(row, index)">保存
                                 </el-button>
                                 <el-button icon="el-icon-delete" :size="size" :disabled="form.status == 2" :type="type"
-                                    @click="rowDelBox(row, index, 'planItemsList')">删除
+                                    @click="rowDel(row, index, 'planItemsList')">删除
                                 </el-button>
                             </template>
                         </avue-crud>
@@ -107,7 +112,7 @@
                     </el-tab-pane>
                 </el-tabs>
             </trade-card>
-            <report-dialog :switchDialog="switchDialog" :reportName="reportName" :reportId="form.id"
+            <report-dialog :switchDialog="switchDialog" reportName="仓库管理-中心仓出库单" :reportId="form.id"
                 @onClose="onClose()"></report-dialog>
         </div>
         <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
@@ -207,6 +212,7 @@ import { isProcurement } from "@/api/basicData/configuration";
 import { getList as inventoryList } from "@/api/tirePartsMall/inventory";
 import dicSelect from "@/components/dicSelect/main";
 import { stockGoodsList } from "@/api/storehouse/stock.js";
+import _ from "lodash";
 export default {
     name: "detailsPage",
     data() {
@@ -265,7 +271,6 @@ export default {
                 ]
             },
             inventoryData: [],
-            reportName: '轮胎商城-销售订单', // 打印传的名字
             SelectSearch: {}, // 添加商品检索
             // 编辑还是保存
             mingxibaocun: true,
@@ -385,7 +390,7 @@ export default {
                 menuBtn: false,
                 span: 8,
                 disabled: false,
-                labelWidth:100,
+                labelWidth: 100,
                 column: [{
                     label: '货主',
                     prop: "customerName",
@@ -397,37 +402,37 @@ export default {
                         trigger: "blur"
                     }]
                 },
-                    {
-                        label: '联系人',
-                        type: "select",
-                        prop: "contacts",
-                        disabled: false,
-                        allowCreate: true,
-                        filterable: true,
-                        dicData: [],
-                        props: {
-                            label: 'address',
-                            value: 'id'
-                        },
-                        dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
-                    }, {
-                        label: '电话',
-                        disabled: false,
+                {
+                    label: '联系人',
+                    type: "select",
+                    prop: "contacts",
+                    disabled: false,
+                    allowCreate: true,
+                    filterable: true,
+                    dicData: [],
+                    props: {
+                        label: 'address',
+                        value: 'id'
+                    },
+                    dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
+                }, {
+                    label: '电话',
+                    disabled: false,
 
-                        prop: "phone",
-                    }, {
-                        label: '收货地址',
-                        prop: "recAddress",
-                        type: 'select',
-                        allowCreate: true,
-                        filterable: true,
-                        disabled: false,
-                        props: {
-                            label: 'address',
-                            value: 'address'
-                        },
-                        dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
+                    prop: "phone",
+                }, {
+                    label: '收货地址',
+                    prop: "recAddress",
+                    type: 'select',
+                    allowCreate: true,
+                    filterable: true,
+                    disabled: false,
+                    props: {
+                        label: 'address',
+                        value: 'address'
                     },
+                    dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
+                },
                 {
                     label: '仓库',
                     prop: "storageId",
@@ -501,6 +506,11 @@ export default {
                     disabled: false,
                     prop: "expressNo"
                 },
+
+                {
+                    label: '库管',
+                    prop: "warehouseKeeperName"
+                },
                 {
                     label: '备注',
                     prop: "remarks",
@@ -513,7 +523,6 @@ export default {
             optionContacts: {},
             optionContactsBack: {
                 disabled: false,
-                goodsId: '',
                 border: true,
                 align: 'center',
                 index: true,
@@ -566,24 +575,6 @@ export default {
                 column: [
                     {
                         label: '商品名称',
-                        prop: 'goodsId',
-                        width: 250,
-                        disabled: false,
-                        remote: true,
-                        overHidden: true,
-                        hide: true,
-                        type: 'select',
-                        dicData: [],
-                        props: {
-                            label: 'goodsName',
-                            value: 'goodsId'
-                        },
-                        // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
-                        dicUrl: `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=&enableOrNot=1&stock=${this.goodsId}`
-                        // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
-                    },
-                    {
-                        label: '商品名称',
                         prop: 'goodsName',
                         width: 250,
                         disabled: false,
@@ -601,18 +592,6 @@ export default {
                             required: true,
                             message: " ",
                             trigger: "blur"
-                        }, {
-                            validator: (rule, value, callback) => {
-                                console.log(this.formContacts.inventory);
-                                if (value < 0) {
-                                    callback(new Error("数量不能小于0"));
-                                } else if (Number(value) > Number(this.formContacts.inventory)) {
-                                    callback(new Error("数量不能大于库存"));
-                                } else {
-                                    callback();
-                                }
-                            },
-                            trigger: "blur"
                         }]
                     },
                     {
@@ -626,38 +605,18 @@ export default {
                             required: true,
                             message: " ",
                             trigger: "blur"
-                        }, {
-                            validator: (rule, value, callback) => {
-                                if (value < 0) {
-                                    callback(new Error("价格不能小于0"));
-                                } else {
-                                    callback();
-                                }
-                            },
-                            trigger: "blur"
                         }]
                     },
                     {
                         label: '库存',
                         prop: 'inventory',
                         overHidden: true,
-                        hide: true,
                         width: 100
-                    }, {
+                    },
+                    {
                         label: '批次号',
                         prop: 'dot',
-                        cell: true,
-                        type: "select",
-                        width: 120,
-                        disabled: true,
-                        allowCreate: true,
-                        filterable: true,
-                        dicData: [],
-                        props: {
-                            label: "dot",
-                            value: "dot"
-                        },
-                        dicUrl: "/api/blade-sales-part/stockDesc/dotList",
+                        width: 100,
                         overHidden: true,
                     },
                     {
@@ -801,6 +760,12 @@ export default {
         })
     },
     methods: {
+        countChange(row) {
+            row.costAmount = _.multiply(Number(row.costPrice ? row.costPrice : 0), Number(row.goodsNum ? row.goodsNum : 0)).toFixed(2)
+        },
+        moneyChange(row) {
+            row.subTotalMoney = _.multiply(Number(row.price ? row.price : 0), Number(row.goodsNum ? row.goodsNum : 0)).toFixed(2)
+        },
         dicChange(name, row) {
             if (name == 'customerName') {
                 if (row) {
@@ -808,7 +773,6 @@ 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.contacts = res.data.data.corpsAttnList[0].cname
                             this.form.phone = res.data.data.corpsAttnList[0].tel
                             this.contactsOption = res.data.data.corpsAddrList
@@ -818,11 +782,28 @@ export default {
                     this.form.customerId = null
                     this.form.customerName = null
                     this.dicUrlWithCustomId = null
-                    // this.form.storageId = null
                     this.form.contacts = null
                     this.form.phone = null
                 }
             }
+            if (name == 'warehouseKeeperName') {
+                if (row) {
+                    this.form.warehouseKeeper = row.id
+                    // this.form.warehouseKeeperName=row.realName
+                } else {
+                    this.form.warehouseKeeper = null
+                    this.form.warehouseKeeperName = null
+                }
+            }
+            if (name == 'storageName') {
+                if (row) {
+                    this.form.storageId = row.id
+                    // this.form.warehouseKeeperName=row.realName
+                } else {
+                    this.form.storageId = null
+                    this.form.storageName = null
+                }
+            }
         },
         viewInventory() {
             this.inventoryData = []
@@ -830,14 +811,6 @@ export default {
                 this.inventoryData = res.data.data.records
             ])
         },
-        synchronous(row) {
-            this.form.planItemsList.forEach(e => {
-                if (e.goodsName == this.selectionMultilist[0].goodsName) {
-                    e.inventory = row.balanceQuantity
-                    e.dot = row.dot
-                }
-            })
-        },
         uploadAfter(res, done, loading, column) {
             if (Array.isArray(res)) {
                 if (res instanceof Array) {
@@ -1076,7 +1049,6 @@ export default {
             // 获取是否管理批次号
             getDetailsGods({ id: row.goodsId }).then(res => {
                 row.whether = res.data.data.whether
-                this.picihaolistfun(row.id)
                 row.dotedittype = true
                 // 价格数量
                 row.goodsNumtype = true
@@ -1093,24 +1065,6 @@ export default {
             row.pricetype = false
             this.mingxibaocun = true
         },
-        // 批次号获取数据
-        picihaolistfun(goodsId) {
-            dotList({
-                storageId: this.form.storageId,
-                goodsId: goodsId
-            }).then(res => {
-                this.picihaolist = res.data.data
-            })
-        },
-        // 批次号切换库存
-        dotchangefun(value, row) {
-            for (let item of this.picihaolist) {
-                if (item.dot == value) {
-                    this.$set(row, 'inventory', item.balanceQuantity)
-                    this.$set(row, 'rebatePrice', item.rebatePrice)
-                }
-            }
-        },
         // 数量失焦触发
         goodsNumblurfun(row) {
             if (Number(row.goodsNum) > Number(row.inventory)) {
@@ -1118,19 +1072,6 @@ export default {
                 return
             }
         },
-        editBtn(row, index) {
-            this.confirmEditing()
-            this.$refs.formContacts.rowEdit(row, index);
-            dotList({
-                storageId: this.form.storageId,
-                goodsId: this.formContacts.goodsId
-            }).then(res => {
-                this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
-            })
-            goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
-                this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
-            })
-        },
         //联系人change
         contactsChange(e) {
             // 假设this.contactsOption是你的数组对象
@@ -1165,7 +1106,6 @@ export default {
                         spinner: 'el-icon-loading',
                         background: 'rgba(255,255,255,0.7)'
                     });
-                    this.form.storageName = this.form.$storageId ? this.form.$storageId : ''
                     this.form.billType = this.form.billType ? this.form.billType : 0
                     submit(this.form).then(res => {
                         this.$message.success("保存成功");
@@ -1228,20 +1168,20 @@ export default {
                 loading.close();
             })
         },
-        rowDelBox(row, index, type) {
+        rowDel(row, index,list) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
                 type: "warning"
             }).then(() => {
                 if (row.id) {
-                    itemRemove({ ids: row.id }).then(res => {
-                        this.form.planItemsList.splice(index, 1);
-                        this.$message.success("操作成功!");
-                    });
+                    // itemRemove({ ids: row.id }).then(res => {
+                    //     this.form.planItemsList.splice(index, 1);
+                    //     this.$message.success("操作成功!");
+                    // });
+                    row.isDeleted = 1
                 } else {
-                    this.form[type].splice(index, 1);
-                    this.$message.success("操作成功!");
+                    this.form[list].splice(index, 1);
                 }
             }
             );
@@ -1301,12 +1241,7 @@ export default {
                 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
-            let columnList = ['goodsId', 'goodsNum', 'price', 'dot', 'remarks']
-            this.optionContactsBack.column.forEach(its => {
-                its.disabled = columnList.indexOf(its.prop) === -1
-            })
             this.getAllWorkDicts()
             this.goodsListSave = []
             setTimeout(res => {