qb 6 months ago
parent
commit
e7979048f1
  1. 462
      src/views/distribution/inventory/delivery/distributionStockArticle.vue

462
src/views/distribution/inventory/delivery/distributionStockArticle.vue

@ -157,8 +157,17 @@
<el-text @click="handleView(slotProps.scope)"> 查看 </el-text> <el-text @click="handleView(slotProps.scope)"> 查看 </el-text>
<el-text @click="handleCallDeliveryOwn(slotProps.scope)"> 修改客户信息 </el-text> <el-text @click="handleCallDeliveryOwn(slotProps.scope)"> 修改客户信息 </el-text>
<el-text @click="handleGoLogs(slotProps.scope)"> 日志 </el-text> <el-text @click="handleGoLogs(slotProps.scope)"> 日志 </el-text>
<el-text @click="Splittheorder(slotProps.scope.row)" v-if="slotProps.scope.row.isZero ==0 && permissionList.distributionStockList_unpack"> 拆单 </el-text> <el-text
<el-text @click="zeroSplittheorder(slotProps.scope.row)" v-if="slotProps.scope.row.isZero ==1" >零担拆单</el-text> @click="Splittheorder(slotProps.scope.row)"
v-if="slotProps.scope.row.isZero == 0 && permissionList.distributionStockList_unpack"
>
拆单
</el-text>
<el-text
@click="zeroSplittheorder(slotProps.scope.row)"
v-if="slotProps.scope.row.isZero == 1"
>零担拆单</el-text
>
</template> </template>
</template> </template>
</tablecmt> </tablecmt>
@ -406,183 +415,176 @@
</div> </div>
<!-- 零担拆单 --> <!-- 零担拆单 -->
<el-dialog <el-dialog
v-model="zerodialogTableVisible" v-model="zerodialogTableVisible"
width="65%" width="65%"
title="运单信息" title="运单信息"
:show-close="false" :show-close="false"
:lock-scroll="false" :lock-scroll="false"
:align-center="true" :align-center="true"
> >
<div class="topbox"> <div class="topbox">
<div class="titlxbx"> <div class="titlxbx">
<div> <div>
<div>运单号</div> <div>运单号</div>
<div>{{ rowobj.waybillNumber }}</div> <div>{{ rowobj.waybillNumber }}</div>
</div> </div>
<div> <div>
<div>品牌</div> <div>品牌</div>
<div>{{ rowobj.brand }}</div> <div>{{ rowobj.brand }}</div>
</div> </div>
<div> <div>
<div></div> <div></div>
<div></div> <div></div>
</div> </div>
</div>
<div class="titlxbx">
<div>
<div>发货单位</div>
<div>{{ rowobj.shipper }}</div>
</div>
<div>
<div>发货人</div>
<div>{{ rowobj.shipperName }}</div>
</div>
<div>
<div>发货方电话</div>
<div>{{ rowobj.shipperMobile }}</div>
</div>
</div>
<div class="titlxbx">
<div>
<div>发货方地址</div>
<div>{{ rowobj.shipperAddress }}</div>
</div>
<div>
<div></div>
<div></div>
</div>
<div>
<div></div>
<div></div>
</div>
</div>
<div class="titlxbx">
<div>
<div>收货单位</div>
<div>{{ rowobj.consignee }}</div>
</div>
<div>
<div>收货人</div>
<div>{{ rowobj.consigneeName }}</div>
</div>
<div>
<div>收货电话</div>
<div>{{ rowobj.consigneeMobile }}</div>
</div>
</div>
<div class="titlxbx">
<div>
<div>收货地址</div>
<div>{{ rowobj.consigneeAddress }}</div>
</div> </div>
<div> <div class="titlxbx">
<div></div> <div>
<div></div> <div>发货单位</div>
<div>{{ rowobj.shipper }}</div>
</div>
<div>
<div>发货人</div>
<div>{{ rowobj.shipperName }}</div>
</div>
<div>
<div>发货方电话</div>
<div>{{ rowobj.shipperMobile }}</div>
</div>
</div> </div>
<div> <div class="titlxbx">
<div>运单总件数</div> <div>
<div>{{ rowobj.totalCount }}</div> <div>发货方地址</div>
<div>{{ rowobj.shipperAddress }}</div>
</div>
<div>
<div></div>
<div></div>
</div>
<div>
<div></div>
<div></div>
</div>
</div> </div>
<div class="titlxbx">
<div>
</div> <div>收货单位</div>
<div class="titlxbx"> <div>{{ rowobj.consignee }}</div>
<div> </div>
<div>货物类型</div> <div>
<div>{{ rowobj.goodsName }}</div> <div>收货人</div>
<div>{{ rowobj.consigneeName }}</div>
</div>
<div>
<div>收货电话</div>
<div>{{ rowobj.consigneeMobile }}</div>
</div>
</div> </div>
<div> <div class="titlxbx">
<div>订单总件数</div> <div>
<div>{{ rowobj.totalNumber }}</div> <div>收货地址</div>
<div>{{ rowobj.consigneeAddress }}</div>
</div>
<div>
<div></div>
<div></div>
</div>
<div>
<div>运单总件数</div>
<div>{{ rowobj.totalCount }}</div>
</div>
</div> </div>
<div class="titlxbx">
<div>
<div>货物类型</div>
<div>{{ rowobj.goodsName }}</div>
</div>
<div>
<div>订单总件数</div>
<div>{{ rowobj.totalNumber }}</div>
</div>
<div>
<div>剩余件数</div>
<div>{{ rowobj.handQuantity }}</div>
</div>
</div>
</div>
<div class="maxitembxlist" v-loading="zeroload"
element-loading-text="Loading...">
<div class="items" v-for="(item, index) in orderlist" :key="item">
<div class="titltophead">
<div>订单{{ index + 1 }}</div>
<div> <div>
<el-icon class="icons" @click="addorder"><CirclePlusFilled /></el-icon> <div>剩余件数</div>
<el-icon v-if="orderlist.length > 1" class="icons" @click="rmvorder(index)" <div>{{ rowobj.handQuantity }}</div>
><RemoveFilled
/></el-icon>
</div> </div>
</div> </div>
<div class="contbx"> </div>
<div class="tabitem"> <div class="maxitembxlist" v-loading="zeroload" element-loading-text="Loading...">
<div>货物名称</div> <div class="items" v-for="(item, index) in orderlist" :key="item">
<div class="titltophead">
<div>可用件数</div> <div>订单{{ index + 1 }}</div>
<div>分配数量</div>
</div>
<div class="contentitem" v-for="itemlimit in item.goods" :key="itemlimit">
<div> <div>
{{ itemlimit.productName }} <el-icon class="icons" @click="addorder"><CirclePlusFilled /></el-icon>
</div> <el-icon v-if="orderlist.length > 1" class="icons" @click="rmvorder(index)"
<div class="numbinput"> ><RemoveFilled
<el-input-number /></el-icon>
class="w100"
v-model="itemlimit.quantity"
disabled
/>
</div>
<div class="numbinput">
<el-input-number
class="w100"
:min="0"
:max="itemlimit.quantity"
:value-on-clear="0"
v-model="itemlimit.splitNum"
:controls="false"
:precision="0"
placeholder="请输入数量"
/>
</div> </div>
</div> </div>
</div> <div class="contbx">
<div class="editinput"> <div class="tabitem">
<div class="inputitem"> <div>货物名称</div>
<div class="inpts">
<span>收货人</span> <div>可用件数</div>
<div> <div>分配数量</div>
<el-input v-model="item.name" placeholder="请输入收货人" />
</div>
</div> </div>
<div class="inpts"> <div class="contentitem" v-for="itemlimit in item.goods" :key="itemlimit">
<span>收货人电话</span>
<div> <div>
<el-input v-model="item.phone" placeholder="请输入收货人电话" /> {{ itemlimit.productName }}
</div>
<div class="numbinput">
<el-input-number class="w100" v-model="itemlimit.quantity" disabled />
</div>
<div class="numbinput">
<el-input-number
class="w100"
:min="0"
:max="itemlimit.quantity"
:value-on-clear="0"
v-model="itemlimit.splitNum"
:controls="false"
:precision="0"
placeholder="请输入数量"
/>
</div> </div>
</div> </div>
</div> </div>
<div class="inputitem"> <div class="editinput">
<div class="inpts"> <div class="inputitem">
<span>收货人地址</span> <div class="inpts">
<div> <span>收货人</span>
<el-input v-model="item.addres" placeholder="请输入收货人地址" /> <div>
<el-input v-model="item.name" placeholder="请输入收货人" />
</div>
</div>
<div class="inpts">
<span>收货人电话</span>
<div>
<el-input v-model="item.phone" placeholder="请输入收货人电话" />
</div>
</div> </div>
</div> </div>
<div class="inpts"> <div class="inputitem">
<span>备注</span> <div class="inpts">
<div> <span>收货人地址</span>
<el-input v-model="item.rak" type="textarea" placeholder="请输入备注" /> <div>
<el-input v-model="item.addres" placeholder="请输入收货人地址" />
</div>
</div>
<div class="inpts">
<span>备注</span>
<div>
<el-input v-model="item.rak" type="textarea" placeholder="请输入备注" />
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="btsbx">
<div class="btsbx"> <el-button @click="zerodialogTableVisible = false">取消</el-button>
<el-button @click="zerodialogTableVisible=false">取消</el-button> <el-button :disabled="zeroload" type="primary" @click="hidedial">确认</el-button>
<el-button :disabled="zeroload" type="primary" @click="hidedial">确认</el-button> </div>
</div> </el-dialog>
</el-dialog>
<!-- 拆单弹窗 --> <!-- 拆单弹窗 -->
<el-dialog v-model="dialogSplitthe" title="新增拆单任务"> <el-dialog v-model="dialogSplitthe" title="新增拆单任务">
<el-button type="primary" @click="newadd">新增</el-button> <el-button type="primary" @click="newadd">新增</el-button>
@ -689,7 +691,7 @@ import { getDictionaryBiz } from '@/api/system/dict';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { exportBlob } from '@/api/common'; import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { downloadXls, getObjType, handleClearTableQuery,isNumber } from '@/utils/util'; import { downloadXls, getObjType, handleClearTableQuery, isNumber } from '@/utils/util';
import { columnList } from '@/option/distribution/distributionStockArticleSelf'; import { columnList } from '@/option/distribution/distributionStockArticleSelf';
import { deepClone, setNodeHeight, hanleTextLineFeed } from '@/utils/util.js'; import { deepClone, setNodeHeight, hanleTextLineFeed } from '@/utils/util.js';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
@ -701,9 +703,9 @@ export default {
excelForm: {}, excelForm: {},
excelBox: false, excelBox: false,
tcloading: false, tcloading: false,
rowobj:{}, rowobj: {},
zeroload:false, zeroload: false,
parcelList:[], parcelList: [],
orderobj: { orderobj: {
name: '', name: '',
phone: '', phone: '',
@ -730,7 +732,7 @@ export default {
], ],
}, },
], ],
zerodialogTableVisible:false, zerodialogTableVisible: false,
Totalnumbersplitorders: 0, Totalnumbersplitorders: 0,
dataRwo: {}, dataRwo: {},
ruleForm: { ruleForm: {
@ -896,13 +898,16 @@ export default {
computed: { computed: {
...mapGetters(['permission']), ...mapGetters(['permission']),
permissionList() { permissionList() {
console.log(this.permission,'this.permission'); console.log(this.permission, 'this.permission');
return { return {
addBtn: this.validData(this.permission.basicdataBrandCategory_add, false), addBtn: this.validData(this.permission.basicdataBrandCategory_add, false),
viewBtn: this.validData(this.permission.basicdataBrandCategory_view, false), viewBtn: this.validData(this.permission.basicdataBrandCategory_view, false),
delBtn: this.validData(this.permission.basicdataBrandCategory_delete, false), delBtn: this.validData(this.permission.basicdataBrandCategory_delete, false),
editBtn: this.validData(this.permission.basicdataBrandCategory_edit, false), editBtn: this.validData(this.permission.basicdataBrandCategory_edit, false),
distributionStockList_unpack: this.validData(this.permission.distributionStockList_unpack, false), distributionStockList_unpack: this.validData(
this.permission.distributionStockList_unpack,
false
),
}; };
}, },
ids() { ids() {
@ -1458,17 +1463,17 @@ export default {
type: 'warning', type: 'warning',
}); });
} else { } else {
this.Splittheform.PackageList=[ this.Splittheform.PackageList = [
{ {
stockArticleId: '', //ID stockArticleId: '', //ID
orderCode: '', // orderCode: '', //
mallName: '', // mallName: '', //
taskNumber: '', // taskNumber: '', //
customerName: '', // customerName: '', //
customerTelephone: '', // customerTelephone: '', //
customerAddress: '', // customerAddress: '', //
}, },
] ];
this.dialogSplitthe = true; this.dialogSplitthe = true;
} }
} }
@ -1481,40 +1486,40 @@ export default {
}); });
}, },
// //
async zeroSplittheorder(row){ async zeroSplittheorder(row) {
console.log(row); console.log(row);
this.zerodialogTableVisible=true this.zerodialogTableVisible = true;
let _data={ let _data = {
orderId:row.id orderId: row.id,
} };
let res= await $_zeroetail(_data) let res = await $_zeroetail(_data);
console.log(res,'res'); console.log(res, 'res');
const {code , data } = res.data const { code, data } = res.data;
if(code !=200){ if (code != 200) {
return return;
}
let _obj ={
...data.orderInfo,...data.waybillEntity
} }
console.log(data.orderInfo,'data.orderInfo'); let _obj = {
...data.orderInfo,
console.log(data.waybillEntity,'data.waybillEntity'); ...data.waybillEntity,
};
console.log( _obj,' _obj'); console.log(data.orderInfo, 'data.orderInfo');
let Name = data.parcelList.map(res=>res.firsts).join(',') console.log(data.waybillEntity, 'data.waybillEntity');
this.rowobj=_obj
console.log(_obj, ' _obj');
let Name = data.parcelList.map(res => res.firsts).join(',');
this.rowobj = _obj;
this.orderlist.splice(1); this.orderlist.splice(1);
this.parcelList=data.parcelList; this.parcelList = data.parcelList;
// 使 // 使
['addres', 'name', 'phone', 'rak'].forEach(prop => { ['addres', 'name', 'phone', 'rak'].forEach(prop => {
this.orderlist[0][prop] = ''; this.orderlist[0][prop] = '';
}); });
this.orderlist[0].goods = this.splitName(Name,data.parcelList); this.orderlist[0].goods = this.splitName(Name, data.parcelList);
console.log(this.orderlist[0],'this.orderlist[0]'); console.log(this.orderlist[0], 'this.orderlist[0]');
}, },
addorder() { addorder() {
// copy // copy
@ -1522,17 +1527,17 @@ export default {
obsj.goods = this.splitName(this.rowobj.goodsName, this.parcelList); obsj.goods = this.splitName(this.rowobj.goodsName, this.parcelList);
this.orderlist.push(obsj); this.orderlist.push(obsj);
}, },
splitName(goodName,data) { splitName(goodName, data) {
console.log(goodName,'goodName'); console.log(goodName, 'goodName');
var t = goodName.split(','); var t = goodName.split(',');
var arr = []; var arr = [];
for (let i = 0; i < t.length; i++) { for (let i = 0; i < t.length; i++) {
var proN = t[i]; var proN = t[i];
var o = {}; var o = {};
o.productName = proN; o.productName = proN;
o.splitNum = 0; o.splitNum = 0;
o.quantity=data[i].quantity; o.quantity = data[i].quantity;
arr[i] = o; arr[i] = o;
} }
return arr; return arr;
@ -1545,7 +1550,7 @@ export default {
this.orderlist.splice(index, 1); this.orderlist.splice(index, 1);
}, },
async hidedial() { async hidedial() {
this.zeroload=true this.zeroload = true;
try { try {
let _arr = []; let _arr = [];
let totalNum = 0; let totalNum = 0;
@ -1556,7 +1561,7 @@ export default {
let _flag = false; let _flag = false;
for (let i = 0; i < value.goods.length; i++) { for (let i = 0; i < value.goods.length; i++) {
const item = value.goods[i]; const item = value.goods[i];
console.log('item :>> ', item); console.log('item :>> ', item);
if (isNumber(item.splitNum) && item.splitNum > 0) _flag = true; if (isNumber(item.splitNum) && item.splitNum > 0) _flag = true;
totalNum += item.splitNum; totalNum += item.splitNum;
@ -1572,15 +1577,15 @@ export default {
}; };
_arr.push(obj); _arr.push(obj);
} }
console.log(this.rowobj,'this.rowobj'); console.log(this.rowobj, 'this.rowobj');
console.log('_arr :>> ', _arr); console.log('_arr :>> ', _arr);
if (_arr.length === 0) return this.$message.error('请选择需要拆单的数据'); if (_arr.length === 0) return this.$message.error('请选择需要拆单的数据');
if (totalNum > this.rowobj.handQuantity) return this.$message.error('总数大于可用数量'); if (totalNum > this.rowobj.handQuantity) return this.$message.error('总数大于可用数量');
this.dialogTableVisible = false; this.dialogTableVisible = false;
console.log(_arr); console.log(_arr);
this.zeroload=true this.zeroload = true;
const res = await $_splitOrder(_arr); const res = await $_splitOrder(_arr);
const { code, data } = res.data; const { code, data } = res.data;
@ -1590,7 +1595,7 @@ export default {
this.page.currentPage = 1; this.page.currentPage = 1;
this.onLoad(this.page); this.onLoad(this.page);
this.zerodialogTableVisible=false this.zerodialogTableVisible = false;
// splitOrder(row).then(res => { // splitOrder(row).then(res => {
// const data = res.data.data; // const data = res.data.data;
// this.page.total = data.total; // this.page.total = data.total;
@ -1603,11 +1608,10 @@ export default {
console.log('error :>> ', error); console.log('error :>> ', error);
} finally { } finally {
console.log('111 :>> ', 111); console.log('111 :>> ', 111);
this.zeroload=false this.zeroload = false;
} }
}, },
// //
changeTaskNumber() { changeTaskNumber() {
this.Totalnumbersplitorders = this.Splittheform.PackageList.reduce( this.Totalnumbersplitorders = this.Splittheform.PackageList.reduce(
@ -1647,12 +1651,11 @@ export default {
let taskNumberState = this.Splittheform.PackageList.find(item => item.taskNumber == 0); let taskNumberState = this.Splittheform.PackageList.find(item => item.taskNumber == 0);
if (taskNumberState) { if (taskNumberState) {
this.$message({ this.$message({
message: '存在拆单数量为0的任务', message: '存在拆单数量为0的任务',
type: 'warning', type: 'warning',
}); });
return; return;
} }
console.log(this.Splittheform.PackageList);
let sum = this.Splittheform.PackageList.reduce((accumulator, currentValue) => { let sum = this.Splittheform.PackageList.reduce((accumulator, currentValue) => {
if (!currentValue || currentValue.taskNumber == null) { if (!currentValue || currentValue.taskNumber == null) {
return accumulator; return accumulator;
@ -1693,9 +1696,9 @@ export default {
if (res.data.code == 200) { if (res.data.code == 200) {
this.dialogSplitthe = false; this.dialogSplitthe = false;
ElMessage({ ElMessage({
message: res.data.msg, message: res.data.msg,
type: 'success', type: 'success',
}) });
this.onLoad(this.page); this.onLoad(this.page);
} }
}) })
@ -1707,6 +1710,11 @@ export default {
}); });
}) })
.catch(() => {}); .catch(() => {});
} else {
ElMessage({
message: '信息未填写完整或填写格式不正确!',
type: 'warning',
});
} }
}); });
}, },
@ -1921,9 +1929,8 @@ export default {
this.getAllOrderInfo(); this.getAllOrderInfo();
const [res] = await Promise.all([ const [res] = await Promise.all([
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)), getList(page.currentPage, page.pageSize, Object.assign(params, this.query)),
]); ]);
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;
@ -2193,7 +2200,7 @@ export default {
} }
} }
.numbinput { .numbinput {
.el-input-number{ .el-input-number {
width: 100%; width: 100%;
} }
} }
@ -2295,8 +2302,7 @@ export default {
input { input {
font-size: 12px !important; font-size: 12px !important;
} }
.el-input{ .el-input {
width: 100%; width: 100%;
} }
textarea { textarea {

Loading…
Cancel
Save