Merge pull request '运单批量录入特区提醒、特区标签批量导入汇总提醒' (#200) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/200
This commit is contained in:
commit
4b33dc6f21
@ -249,9 +249,6 @@ export default {
|
||||
},
|
||||
handleBatchImport() {
|
||||
this.openUploadForm = true;
|
||||
},
|
||||
batchImpDataForm() {
|
||||
|
||||
},
|
||||
cancel() {
|
||||
this.openUploadForm = false;
|
||||
@ -324,24 +321,34 @@ export default {
|
||||
this.$modal.msgError('表格中没有数据');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let len = this.tmpDataList.length;
|
||||
//loader
|
||||
let errMsgs = []
|
||||
this.loading = true;
|
||||
for (let i = 0; i < len; i++) {
|
||||
let itemData = this.tmpDataList[i];
|
||||
try {
|
||||
let res = await importEmisSpecialZone(itemData)
|
||||
let res = await importEmisSpecialZone(itemData)
|
||||
if(res.data.result == 'fail'){
|
||||
errMsgs.push(res.data.msg)
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(e)
|
||||
}
|
||||
}
|
||||
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
if(errMsgs.length > 0){
|
||||
this.$confirm(`${errMsgs.join('\n')}`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
showCancelButton: false,
|
||||
type: 'warning',
|
||||
}).then(() => {})
|
||||
}else{
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
}
|
||||
this.getList();
|
||||
|
||||
this.tmpDataList = [];
|
||||
|
||||
this.openUploadForm = false;
|
||||
|
||||
},
|
||||
handleSuccess() {
|
||||
this.openForm = false;
|
||||
|
||||
@ -55,6 +55,7 @@
|
||||
<el-tag v-if="scope.row.uploadStatus==1" type="success">下单成功</el-tag>
|
||||
<el-tag v-if="scope.row.uploadStatus==0" type="info">待下单</el-tag>
|
||||
<el-tag v-if="scope.row.uploadStatus==-1" type="danger">下单异常</el-tag>
|
||||
<el-tag v-if="scope.row.uploadStatus==-2" type="warning">特区提醒</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('异常信息')" align="center" prop="errorInfo" min-width="300" :show-overflow-tooltip="true" >
|
||||
@ -62,6 +63,7 @@
|
||||
<span v-if="scope.row.uploadStatus==-1" style="color:red">{{ scope.row.errorInfo }}</span>
|
||||
<span v-if="scope.row.uploadStatus==1">下单成功</span>
|
||||
<span v-if="scope.row.uploadStatus==0">待下单</span>
|
||||
<span v-if="scope.row.uploadStatus==-2">{{ scope.row.errorInfo }}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -159,6 +161,7 @@
|
||||
|
||||
<script>
|
||||
import { listEmisWaybill, draftSubmitOrder } from "@/api/emis/emisWaybill";
|
||||
import { matchByAddress } from "@/api/emis/emisSpecialZone";
|
||||
|
||||
import { parseTime } from "@/utils/custom";
|
||||
import {timeDiffTime,timeFormat} from '@/utils/dateUtils'
|
||||
@ -391,13 +394,15 @@ export default {
|
||||
calcDeliveryTime(startData,endDate){
|
||||
return timeDiffTime(startData,endDate)
|
||||
},
|
||||
//标红table指定行
|
||||
//标红table指定行
|
||||
tableRowClassName(row, index) {
|
||||
row.row.index = row.rowIndex;
|
||||
if (row.uploadStatus=='1') {
|
||||
return 'success-row';
|
||||
}
|
||||
else if (row.uploadStatus=='-1') {
|
||||
return 'error-row';
|
||||
} else if (row.row.uploadStatus=='-2') {
|
||||
return 'warning-row';
|
||||
}
|
||||
return '';
|
||||
@ -460,11 +465,7 @@ export default {
|
||||
let loadingInstance = this.$loading({
|
||||
text: '正在解析 ' + _index + ' 数据...'
|
||||
})
|
||||
|
||||
this.orderList = [];
|
||||
|
||||
let lastOrderSn = '';
|
||||
let orderIndex = 0;
|
||||
// 组装提交的数据
|
||||
for (let index = 0; index < results.length; index++) {
|
||||
const element = results[index]
|
||||
@ -548,6 +549,14 @@ export default {
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// 收件地址 匹配收件省份
|
||||
if(['柬埔寨','孟加拉'].includes(orderData.receiveCountry)){
|
||||
const res = await matchByAddress({address:orderData.receiveAddress})
|
||||
if(res.data && res.data.provinceName !== orderData.receiveProvince){
|
||||
orderData.errorInfo = `收件地址在"${res.data.provinceName}",请仔细核对后确认是否将其设为收件省份`;
|
||||
orderData.uploadStatus = -2; // 提醒
|
||||
}
|
||||
}
|
||||
this.tmpDataList.push(orderData);
|
||||
|
||||
}
|
||||
@ -699,9 +708,12 @@ export default {
|
||||
color: rgb(21, 174, 31) !important;
|
||||
}
|
||||
|
||||
:deep .el-table .warning-row {
|
||||
:deep .el-table .error-row {
|
||||
color: #f51f1f !important;
|
||||
}
|
||||
:deep .el-table .warning-row {
|
||||
color: #ffba00 !important;
|
||||
}
|
||||
|
||||
:deep .el-form-item__label {
|
||||
text-align: left;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user