|
|
@@ -402,7 +402,6 @@
|
|
|
dealImages: [], // 交易截图
|
|
|
commodities: [],
|
|
|
logistic_number: null, // 快递单号
|
|
|
- sku_amount: 0, // sku商品总数
|
|
|
price: null,
|
|
|
},
|
|
|
grads: [
|
|
|
@@ -620,7 +619,13 @@
|
|
|
result_explain: function () {
|
|
|
this.setLogisticInfo();
|
|
|
this.setMerchantInfo();
|
|
|
- }
|
|
|
+ },
|
|
|
+ 'workOrder.orderIssueType':function(newValue){
|
|
|
+ if (newValue === null) return;
|
|
|
+ if (newValue === '破损'){
|
|
|
+ this.fillWorkOrderCommodity();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
initData() {
|
|
|
@@ -1211,12 +1216,11 @@
|
|
|
showInterceptModel() {
|
|
|
this.workOrder.grad = 1;
|
|
|
if (checkData.length < 1) {
|
|
|
+ window.tempTip.setDuration(1500);
|
|
|
window.tempTip.show('未选中任何订单');
|
|
|
return;
|
|
|
}
|
|
|
this.workOrder.orderIssueType = null;
|
|
|
- //this.workOrder.remark.info = null;
|
|
|
- // this.workOrder.info = null;
|
|
|
this.workOrder.price = null;
|
|
|
this.workOrder.refundImages = [];
|
|
|
this.workOrder.packageImages = [];
|
|
|
@@ -1225,7 +1229,6 @@
|
|
|
this.workOrder.remark.info = '';
|
|
|
this.workOrder.commodities = [];
|
|
|
this.workOrder.logistic_number = null;
|
|
|
- this.workOrder.sku_amount = 0;
|
|
|
$('#intercept-modal').modal('show');
|
|
|
},
|
|
|
checkOrderIssue(name) { //
|
|
|
@@ -1313,7 +1316,6 @@
|
|
|
formData.append('type', '破损');
|
|
|
formData.append('logistic_number', this.workOrder.logistic_number);
|
|
|
formData.append('price', this.workOrder.price);
|
|
|
- formData.append('sku_amount', this.workOrder.sku_amount);
|
|
|
this.setFormDataImagePrefix(formData, 'packageImages', packageImages);
|
|
|
this.setFormDataImagePrefix(formData, 'commodityImages', commodityImages);
|
|
|
this.setFormDataImagePrefix(formData, 'dealImages', dealImages);
|
|
|
@@ -1322,10 +1324,10 @@
|
|
|
},
|
|
|
createDamagedWorkOrder() { //破损工单创建
|
|
|
if (!this.checkDamagedWorkOrder())return;
|
|
|
- let packageImages = this.getImages(this.workOrder.packageImages); // 外包装破损图片
|
|
|
- let commodityImages = this.getImages(this.workOrder.commodityImages); // 内物破损图片
|
|
|
- let dealImages = this.getImages(this.workOrder.dealImages); // 交易截图
|
|
|
- let message = this.checkWorkOrderImage(packageImages,commodityImages,dealImages); // 校验工单图片不能为空
|
|
|
+ let packageImages = this.getImages(this.workOrder.packageImages); // 外包装破损图片
|
|
|
+ let commodityImages = this.getImages(this.workOrder.commodityImages); // 内物破损图片
|
|
|
+ let dealImages = this.getImages(this.workOrder.dealImages); // 交易截图
|
|
|
+ let message = this.checkWorkOrderImage(packageImages,commodityImages,dealImages); // 校验工单图片不能为空
|
|
|
if (message) {
|
|
|
window.tempTip.setIndex(1999);
|
|
|
window.tempTip.show(message)
|
|
|
@@ -1338,7 +1340,7 @@
|
|
|
},
|
|
|
setFormDataCommodities(formData){
|
|
|
this.workOrder.commodities.map(commodity=>{
|
|
|
- let item = {sku:commodity.sku,amount:commodity.amount,commodity_id:commodity.commodity.id};
|
|
|
+ let item = {sku:commodity.sku,amount:commodity.amount};
|
|
|
formData.append('commodities[]',JSON.stringify(item)) ;
|
|
|
});
|
|
|
},
|
|
|
@@ -1356,8 +1358,6 @@
|
|
|
let message = null;
|
|
|
if (!this.checkPrice()){
|
|
|
message = '商品价值需大于0';
|
|
|
- } else if (!this.checkSkuAmount()){
|
|
|
- message = "sku数量和录入sku信息数量不符合";
|
|
|
}
|
|
|
if (message){
|
|
|
window.tempTip.setIndex(1999);
|
|
|
@@ -1369,9 +1369,6 @@
|
|
|
checkPrice(){
|
|
|
return parseInt(this.workOrder.price) !== 0;
|
|
|
},
|
|
|
- checkSkuAmount(){
|
|
|
- return parseInt(this.workOrder.sku_amount) === this.workOrder.commodities.length;
|
|
|
- },
|
|
|
createMistakeWorkOrder() { // 错漏发
|
|
|
let data = this.getCreateWorkOrderData();
|
|
|
this.createWorkOrder(data);
|
|
|
@@ -1420,7 +1417,6 @@
|
|
|
this.workOrder.price = [];
|
|
|
this.workOrder.logisticNumber = [];
|
|
|
this.workOrder.orderIssueType = 0;
|
|
|
- this.workOrder.sku_amount = 0;
|
|
|
},
|
|
|
getCreateWorkOrderData() {
|
|
|
return checkData.map(item => {
|
|
|
@@ -1525,57 +1521,6 @@
|
|
|
window.tempTip.show("网络错误:" + err);
|
|
|
});
|
|
|
},
|
|
|
- addCommodity(){
|
|
|
- let sku = this.$refs['commodity-sku'].value;
|
|
|
- let amount = this.$refs['commodity-amount'].value;
|
|
|
- window.tempTip.setIndex(1999);
|
|
|
- window.tempTip.setDuration(1999);
|
|
|
- if (amount<=0) {
|
|
|
- window.tempTip.show('数量登记异常');
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.hasWorkOrderCommodity(sku)){
|
|
|
- this.addWorkOrderCommodityAmount(sku,amount);
|
|
|
- return ;
|
|
|
- }
|
|
|
- this.checkSkuAndPushWorkOrderCommodity(sku,amount);
|
|
|
- },
|
|
|
- hasWorkOrderCommodity(sku){
|
|
|
- let count = this.workOrder.commodities.filter(item=>{
|
|
|
- return item.sku === sku;
|
|
|
- }).length;
|
|
|
- return count>0;
|
|
|
- },
|
|
|
- addWorkOrderCommodityAmount(sku,amount){
|
|
|
- this.workOrder.commodities.forEach(item=>{
|
|
|
- if (item.sku === sku){
|
|
|
- item.amount = parseInt(item.amount) + parseInt(amount);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- pushWorkOrderCommodities(sku,amount,commodity){
|
|
|
- this.workOrder.commodities.push({sku:sku,amount:amount,commodity:commodity});
|
|
|
- },
|
|
|
- checkSkuAndPushWorkOrderCommodity(sku,amount){
|
|
|
- let url = "{{route('commodity.getCommodityApi')}}";
|
|
|
- let order = this.orders.find(item=>{
|
|
|
- return item.orderno === checkData[0];
|
|
|
- });
|
|
|
- let data = {
|
|
|
- sku:sku,
|
|
|
- owner_name:order['customer_descr_c']
|
|
|
- };
|
|
|
- window.tempTip.setIndex(1999);
|
|
|
- window.axios.post(url,data).then(res=>{
|
|
|
- if (res.data.success){
|
|
|
- this.pushWorkOrderCommodities(sku,amount,res.data.data);
|
|
|
- return;
|
|
|
- }
|
|
|
- window.tempTip.show(res.data.message ? res.data.message : "校验sku失败");
|
|
|
- }).catch(err=>{
|
|
|
- window.tempTip.show("校验sku异常:"+err);
|
|
|
- })
|
|
|
- },
|
|
|
isDB(item) {
|
|
|
if (item.indexOf('德邦') == -1 || item.indexOf('京东') == -1) return false;
|
|
|
return true;
|
|
|
@@ -1594,6 +1539,20 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ fillWorkOrderCommodity(){
|
|
|
+ const {commodities} = this;
|
|
|
+ let orderNo = checkData[0];
|
|
|
+ let orderCommodities = commodities[orderNo];
|
|
|
+ this.workOrder.commodities = [];
|
|
|
+ orderCommodities.forEach(item=>{
|
|
|
+ this.workOrder.commodities.push({
|
|
|
+ sku:item.sku,
|
|
|
+ name:item['descr_c'],
|
|
|
+ amount:item['qtyordered'],
|
|
|
+ selected:false,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
</script>
|