|
@@ -65,8 +65,9 @@
|
|
|
@click="handlePrint">打印</el-button>
|
|
|
<el-button type="danger" plain size="small" @click="batchDelete"
|
|
|
:disabled="form.generateTask == '已生成' || form.businessSource == '外部销售'">一键删除</el-button>
|
|
|
- <el-button type="primary" plain size="small">派发销售单</el-button>
|
|
|
- <el-button type="danger" plain size="small">撤销派发</el-button>
|
|
|
+ <el-button type="primary" plain size="small" :disabled="selectionMultilist.length == 0"
|
|
|
+ @click="allClick('派发销售单')">派发销售单</el-button>
|
|
|
+ <el-button type="danger" plain size="small" @click="allClick('撤销派发')">撤销派发</el-button>
|
|
|
</template>
|
|
|
<template slot="goodsId" slot-scope="{ row }">
|
|
|
{{ row.goodsName }}
|
|
@@ -75,7 +76,7 @@
|
|
|
<template slot="goodsNum" slot-scope="{ row }">
|
|
|
<el-input-number v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
|
|
|
v-model="row.goodsNum" :precision="numberDecimal" :controls="false"
|
|
|
- @blur="goodsNumblurfun(row)" style="width: 100%"></el-input-number>
|
|
|
+ @change="goodsNumblurfun(row)" style="width: 100%"></el-input-number>
|
|
|
<span v-else>{{ row.goodsNum }}</span>
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{ row }">
|
|
@@ -160,7 +161,7 @@
|
|
|
|
|
|
<el-dialog title="选择商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
|
|
|
:close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
|
|
|
- <el-row :style="{ height: rowHeight }">
|
|
|
+ <el-row>
|
|
|
<el-col :span="5">
|
|
|
<div>
|
|
|
<el-scrollbar>
|
|
@@ -174,9 +175,8 @@
|
|
|
<el-col :span="19">
|
|
|
<basic-container>
|
|
|
<avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="crud"
|
|
|
- :search.sync="SelectSearch" @refresh-change="refreshChange"
|
|
|
- @selection-change="selectionChange" @search-change="goodsSearch" :page.sync="page"
|
|
|
- @on-load="onLoad" @resetColumn="resetCrud" @saveColumn="saveCrud">
|
|
|
+ :search.sync="SelectSearch" @refresh-change="refreshChange" @search-change="goodsSearch"
|
|
|
+ :page.sync="page" @on-load="onLoad" @resetColumn="resetCrud" @saveColumn="saveCrud">
|
|
|
<template slot="menuLeft">
|
|
|
<el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
|
|
|
<el-tab-pane label="查询结果" name="searchList" />
|
|
@@ -229,6 +229,37 @@
|
|
|
<!-- :disabled="tableData.length !== 1">导入</el-button>-->
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="派发销售单" append-to-body class="el-dialogDeep" :visible.sync="distributeVisible" width="60%"
|
|
|
+ :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false"
|
|
|
+ @close="distributeGoods">
|
|
|
+ <div>
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <span>
|
|
|
+ 共享公司:
|
|
|
+ </span>
|
|
|
+ <dic-select v-model="sharedCompany" placeholder="共享公司" key="id" label="deptName"
|
|
|
+ url="/blade-system/dept/deptListAll" :filterable="true"
|
|
|
+ @selectChange="dicChange('sharedCompany', $event)"></dic-select>
|
|
|
+ </div>
|
|
|
+ <avue-crud :data="selectionMultilist" :option="distributeOption">
|
|
|
+ <template slot="outGoodsTotalShipNum" slot-scope="{row}">
|
|
|
+ <el-input-number v-model="row.outGoodsTotalShipNum" size="small" :controls="false"
|
|
|
+ style="width: 100%" @change="outGoodsChange(row)" />
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{type,size,row,index}" slot="menu">
|
|
|
+ <el-popover placement="top" width="400" trigger="click" @show="inventoryShow(row)">
|
|
|
+ <avue-crud :data="inventoryList" :option="inventoryOption">
|
|
|
+ </avue-crud>
|
|
|
+ <el-button slot="reference" size="small" type="text">查看库存</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="distributeVisible = false" :loading="saveLoading" size="small">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="inDistribute" :loading="saveLoading" size="small">确认派发</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -247,7 +278,8 @@ import {
|
|
|
distributeShareSales,
|
|
|
revokeDistributeShareSales,
|
|
|
confirmShipment,
|
|
|
- revokeShipment
|
|
|
+ revokeShipment,
|
|
|
+ listAllByGoodsId
|
|
|
} from "@/api/tirePartsMall/basicData/shareSales";
|
|
|
import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
@@ -275,10 +307,13 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ sharedCompany: null,
|
|
|
+ distributeVisible: false,
|
|
|
numberDecimal: 0,
|
|
|
inventoryOption: {
|
|
|
header: false,
|
|
|
menu: false,
|
|
|
+ align: 'center',
|
|
|
column: [
|
|
|
{
|
|
|
label: '商品名称',
|
|
@@ -292,9 +327,36 @@ export default {
|
|
|
label: '库存数量',
|
|
|
prop: 'balanceQuantity',
|
|
|
overHidden: true,
|
|
|
- }, {
|
|
|
- label: '批次号',
|
|
|
- prop: 'dot',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ distributeOption: {
|
|
|
+ header: false,
|
|
|
+ border: true,
|
|
|
+ stripe: true,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ menuWidth: '80',
|
|
|
+ align: 'center',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '商品名称',
|
|
|
+ prop: 'goodsName',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '商品数量',
|
|
|
+ prop: 'goodsNum',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '发货数量',
|
|
|
+ prop: 'sendNum',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '派发数量',
|
|
|
+ prop: 'outGoodsTotalShipNum',
|
|
|
overHidden: true,
|
|
|
}
|
|
|
]
|
|
@@ -309,7 +371,7 @@ export default {
|
|
|
// 添加商品弹窗
|
|
|
dialogVisible: false,
|
|
|
// 弹窗高度
|
|
|
- rowHeight: '',
|
|
|
+ // rowHeight: '',
|
|
|
// 左侧选择搜索
|
|
|
treeDataGoods: [],
|
|
|
treeDeptId: '',
|
|
@@ -1008,10 +1070,16 @@ export default {
|
|
|
this.optionOutboundRecords = await this.getColumnData(this.getColumnName(435), this.optionOutboundRecordsBack);
|
|
|
this.key++
|
|
|
if (this.detailData.id) {
|
|
|
- this.refresh(this.detailData.id, true)
|
|
|
+ this.getDetail(this.detailData.id, true)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ outGoodsChange(row) {
|
|
|
+ if (Number(row.outGoodsTotalShipNum) > Number(Number(row.goodsNum) - Number(row.sendNum))) {
|
|
|
+ this.$set(row, 'outGoodsTotalShipNum', null)
|
|
|
+ return this.$message.error("派发数量不能超过" + (Number(row.goodsNum) - Number(row.sendNum)));
|
|
|
+ }
|
|
|
+ },
|
|
|
dicChange(name, row) {
|
|
|
if (name == 'customerName') {
|
|
|
if (row) {
|
|
@@ -1043,26 +1111,148 @@ export default {
|
|
|
this.form.storageName = ''
|
|
|
}
|
|
|
}
|
|
|
+ if (name == 'sharedCompany') {
|
|
|
+ if (row) {
|
|
|
+ this.form.sharedCompanyId = row.id
|
|
|
+ this.form.sharedCompanyName = row.deptName
|
|
|
+ } else {
|
|
|
+ this.form.sharedCompanyId = null
|
|
|
+ this.form.sharedCompanyName = null
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
confirm(type) {
|
|
|
if (type == 1) {
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- confirmShipment(this.form).then(res => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- this.refresh(res.data.data.id)
|
|
|
- this.isDisabledTask = false
|
|
|
- // this.editButton = true
|
|
|
- this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- loading.close();
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- });
|
|
|
+ for (let item of this.form.orderItemsList) {
|
|
|
+ if (item.sendNum != item.goodsNum) {
|
|
|
+ return this.$message.error("明细中存在未派发完的数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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)'
|
|
|
+ });
|
|
|
+ confirmShipment(this.form).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ })
|
|
|
}
|
|
|
+ if (type == 2) {
|
|
|
+ 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)'
|
|
|
+ });
|
|
|
+ revokeShipment(this.form).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ allClick(name) {
|
|
|
+ if (name == '派发销售单') {
|
|
|
+ this.sharedCompany = null
|
|
|
+ this.distributeVisible = true
|
|
|
+ }
|
|
|
+ if (name == '撤销派发') {
|
|
|
+ for (let item of this.selectionMultilist) {
|
|
|
+ if (item.sendNum == 0) {
|
|
|
+ return this.$message.error("请正确选择明细");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$confirm('是否撤销派发?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let obj = {}
|
|
|
+ obj = {
|
|
|
+ ...this.form,
|
|
|
+ orderItemsList: this.selectionMultilist
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ revokeDistributeShareSales(this.form).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 数量失焦触发
|
|
|
+ goodsNumblurfun(row) {
|
|
|
+ if (Number(row.goodsNum) > Number(row.inventory)) {
|
|
|
+ this.$set(row, 'goodsNum', null)
|
|
|
+ return this.$message.warning("不能大于库存数量");
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ inventoryShow(row) {
|
|
|
+ this.inventoryList = []
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ listAllByGoodsId({ goodsId: row.id }).then(res => {
|
|
|
+ this.inventoryList = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ inDistribute() {
|
|
|
+ if (!this.sharedCompany) {
|
|
|
+ return this.$message.error("请选择共享公司");
|
|
|
+ }
|
|
|
+ for (let item of this.selectionMultilist) {
|
|
|
+ if (item.outGoodsTotalShipNum==0) {
|
|
|
+ return this.$message.error("请输入派件数量");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let obj = {}
|
|
|
+ obj = {
|
|
|
+ ...this.form,
|
|
|
+ orderItemsList: this.selectionMultilist
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ distributeShareSales(obj).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getDetail(this.form.id)
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
},
|
|
|
uploadAfter(res, done, loading, column) {
|
|
|
if (Array.isArray(res)) {
|
|
@@ -1148,10 +1338,6 @@ export default {
|
|
|
this.page.currentPage = 1;
|
|
|
this.onLoad(this.page);
|
|
|
},
|
|
|
- //选中触发
|
|
|
- selectionChange(list) {
|
|
|
- this.tableData = list
|
|
|
- },
|
|
|
// 点击搜索触发
|
|
|
goodsSearch(params, done) {
|
|
|
this.page.currentPage = 1;
|
|
@@ -1161,10 +1347,10 @@ export default {
|
|
|
this.onLoad(this.page, params);
|
|
|
done()
|
|
|
},
|
|
|
- rowCell(){
|
|
|
+ rowCell() {
|
|
|
this.mingxibaocun = false
|
|
|
},
|
|
|
- rowSave(){
|
|
|
+ rowSave() {
|
|
|
this.mingxibaocun = true
|
|
|
},
|
|
|
// 标签页切换
|
|
@@ -1179,15 +1365,10 @@ export default {
|
|
|
},
|
|
|
// 商品信息价格计算
|
|
|
amountChange(value, row) {
|
|
|
- if (value > 0) {
|
|
|
- this.$refs.crud.toggleRowSelection(row, true);
|
|
|
- } else {
|
|
|
- this.$refs.crud.toggleRowSelection(row, false);
|
|
|
+ if (value > row.inventory) {
|
|
|
+ this.$set(row, 'goodsNum', null)
|
|
|
+ return this.$message.error("数量不能超过库存数量");
|
|
|
}
|
|
|
- // 价格
|
|
|
- // if (!row.price) {
|
|
|
- // row.price = 0;
|
|
|
- // }
|
|
|
},
|
|
|
importStagList(row, index, type) {
|
|
|
this.goodsListSave.push(row);
|
|
@@ -1204,10 +1385,10 @@ export default {
|
|
|
item.goodsNo = item.goodsCode
|
|
|
item.propertyName = item.specificationAndModel
|
|
|
item.pattern = item.brandItem
|
|
|
- item.costpriePrice=item.shareCost
|
|
|
- item.rebatePrice=item.costpriePrice
|
|
|
+ item.costpriePrice = item.shareCost
|
|
|
+ item.rebatePrice = item.costpriePrice
|
|
|
item.subTotalMoney = Number(item.goodsNum * item.price) ? Number(item.goodsNum * item.price).toFixed(2) : 0,
|
|
|
- delete item.id
|
|
|
+ delete item.id
|
|
|
this.form.orderItemsList.push(item)
|
|
|
})
|
|
|
this.dialogVisible = false
|
|
@@ -1247,6 +1428,7 @@ export default {
|
|
|
bsType: "GX",
|
|
|
...this.form
|
|
|
}).then(res => {
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
this.$message.success("保存成功");
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
@@ -1256,7 +1438,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- refresh(id, type) {
|
|
|
+ getDetail(id, type) {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: '加载中',
|