|
|
@ -13,7 +13,7 @@ |
|
|
|
<el-form-item> |
|
|
|
<el-button |
|
|
|
class="add-button-style" |
|
|
|
@click="handleUpload" |
|
|
|
@click="importDialogVisable = true" |
|
|
|
>批量导入 |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
@ -49,25 +49,25 @@ |
|
|
|
type="selection" |
|
|
|
width="55"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="item in headers" |
|
|
|
:key="item" |
|
|
|
:label="getColumnName(item)" |
|
|
|
:prop="item" |
|
|
|
:show-overflow-tooltip="true" > |
|
|
|
<template #default="scope"> |
|
|
|
<span v-if="item === 'CustomerOrderReviewInfo-CustomerId'">{{ |
|
|
|
mappingText(customerList, scope.row["CustomerOrderReviewInfo-CustomerId"], 'Customer-CustomerId', 'Customer-Name1') |
|
|
|
}}</span> |
|
|
|
<template v-else-if="item === 'CustomerOrderReviewInfo-ReplyDate' && scope.row['CustomerOrderReviewInfo-ReplyDate']" > |
|
|
|
<span v-if="compareDate(scope.row['CustomerOrderReviewInfo-ExpectedDate'], scope.row['CustomerOrderReviewInfo-ReplyDate'])" |
|
|
|
style="color:#2D9B8E" >{{ scope.row[item] }}</span> |
|
|
|
<span v-else style="color:#FC524B">{{ scope.row[item] }}</span> |
|
|
|
</template> |
|
|
|
<el-table-column |
|
|
|
v-for="item in headers" |
|
|
|
:key="item" |
|
|
|
:label="getColumnName(item)" |
|
|
|
:prop="item" |
|
|
|
:show-overflow-tooltip="true" > |
|
|
|
<template #default="scope"> |
|
|
|
<span v-if="item === 'CustomerOrderReviewInfo-CustomerId'">{{ |
|
|
|
mappingText(customerList, scope.row["CustomerOrderReviewInfo-CustomerId"], 'Customer-CustomerId', 'Customer-Name1') |
|
|
|
}}</span> |
|
|
|
<template v-else-if="item === 'CustomerOrderReviewInfo-ReplyDate' && scope.row['CustomerOrderReviewInfo-ReplyDate']" > |
|
|
|
<span v-if="compareDate(scope.row['CustomerOrderReviewInfo-ExpectedDate'], scope.row['CustomerOrderReviewInfo-ReplyDate'])" |
|
|
|
style="color:#2D9B8E" >{{ scope.row[item] }}</span> |
|
|
|
<span v-else style="color:#FC524B">{{ scope.row[item] }}</span> |
|
|
|
</template> |
|
|
|
|
|
|
|
<span v-else>{{ scope.row[item] }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<span v-else>{{ scope.row[item] }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
align="center" |
|
|
@ -105,7 +105,7 @@ |
|
|
|
@setIsAdd="setIsAdd" |
|
|
|
@pushData="pushData" /> |
|
|
|
<Upload |
|
|
|
v-if="isUpload" |
|
|
|
v-model="importDialogVisable" |
|
|
|
@editCallBack="completeCallBack" /> |
|
|
|
|
|
|
|
</div> |
|
|
@ -114,7 +114,7 @@ |
|
|
|
import Add from "./add.vue"; |
|
|
|
import Upload from "./upload.vue"; |
|
|
|
import { ListMixin } from "@/mixins/newListMixin"; |
|
|
|
import { getCustomerList ,getCustartlist,customerorderreviewlist,exportExcel } from "@/server/productionPlanning/customerInquiry"; |
|
|
|
import { getCustomerList ,customerorderreviewlist,exportExcel } from "@/server/productionPlanning/customerInquiry"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
Add, |
|
|
@ -126,7 +126,7 @@ export default { |
|
|
|
tableHeight:0, |
|
|
|
loading: false, |
|
|
|
isAdd: false, |
|
|
|
isUpload: false, |
|
|
|
importDialogVisable: false, |
|
|
|
deliveryTrialDisable:false, |
|
|
|
isShowDialog: '', |
|
|
|
detailHeaders: [], |
|
|
@ -141,6 +141,7 @@ export default { |
|
|
|
"CustomerOrderReviewInfo-ExpectedDate", |
|
|
|
"CustomerOrderReviewInfo-ReplyDate" |
|
|
|
], |
|
|
|
tableData:[], |
|
|
|
customerList:[], |
|
|
|
custartList:[], |
|
|
|
multipleSelection: [], |
|
|
@ -150,12 +151,9 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
handleExport(){ |
|
|
|
// let queryData = this.tableData.map(item => { |
|
|
|
// item['CustomerOrderReviewInfo-ExpectedDate'] = this.dealDate(item['CustomerOrderReviewInfo-ExpectedDate']) |
|
|
|
// item['CustomerOrderReviewInfo-ReplyDate'] = this.dealDate(item['CustomerOrderReviewInfo-ReplyDate']) |
|
|
|
// return item |
|
|
|
// }) |
|
|
|
// console.log('%cindex.vue line:156 queryData', 'color: #007acc;', queryData); |
|
|
|
this.tableData.forEach(item => { |
|
|
|
item['CustomerOrderReviewInfo-Qty'] = parseFloat(item['CustomerOrderReviewInfo-Qty']) |
|
|
|
}) |
|
|
|
exportExcel(this.tableData).then(res => { |
|
|
|
let link = document.createElement('a'); |
|
|
|
link.style.display = 'none'; |
|
|
@ -165,24 +163,11 @@ export default { |
|
|
|
link.click(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 上传 |
|
|
|
handleUpload() { |
|
|
|
this.isUpload = true |
|
|
|
}, |
|
|
|
// 上传回调 |
|
|
|
completeCallBack(dataList) { |
|
|
|
this.tableData = dataList |
|
|
|
// dataList.forEach(item => { |
|
|
|
// let date = new Date(item['CustomerOrderReviewInfo-ExpectedDate']); |
|
|
|
// this.tableData.push({ |
|
|
|
// "CustomerOrderReviewInfo-ArtId" : item['CustomerOrderReviewInfo-ArtId'], |
|
|
|
// "CustomerOrderReviewInfo-CustomerId" : item['CustomerOrderReviewInfo-CustomerId'], |
|
|
|
// "CustomerOrderReviewInfo-ExpectedDate" : date.getFullYear() + '.' + (date.getMonth() + 1) + '.' + date.getDate(), |
|
|
|
// "CustomerOrderReviewInfo-Qty" : item['CustomerOrderReviewInfo-Qty'] |
|
|
|
|
|
|
|
// }) |
|
|
|
// }) |
|
|
|
this.isUpload = false |
|
|
|
this.importDialogVisable = false |
|
|
|
}, |
|
|
|
// 工厂列表 |
|
|
|
getCustomerList(){ |
|
|
@ -190,15 +175,8 @@ export default { |
|
|
|
this.customerList=data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 工厂列表 |
|
|
|
getCustartlist(){ |
|
|
|
getCustartlist().then(({data=[]})=>{ |
|
|
|
this.custartList=data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 是否显示编辑/新增界面 |
|
|
|
setIsAdd(value) { |
|
|
|
console.log('%cindex.vue line:147 setIsAdd value', 'color: #007acc;', value); |
|
|
|
this.isAdd = value; |
|
|
|
}, |
|
|
|
pushData(data){ |
|
|
@ -206,15 +184,18 @@ export default { |
|
|
|
this.tableData.push(data) |
|
|
|
}, |
|
|
|
compareDate(expectedDate,replyDate){ |
|
|
|
if(!replyDate) { |
|
|
|
return |
|
|
|
|
|
|
|
if(!expectedDate) { |
|
|
|
return true |
|
|
|
} |
|
|
|
let expectedDateArr = expectedDate.split("-") |
|
|
|
let expectedDateTime = new Date(expectedDateArr[0], expectedDateArr[1], expectedDateArr[2]) |
|
|
|
|
|
|
|
if(!replyDate) { |
|
|
|
return false |
|
|
|
} |
|
|
|
let replyDateArr = replyDate.split("-") |
|
|
|
let replyDateTime = new Date(replyDateArr[0], replyDateArr[1], replyDateArr[2]) |
|
|
|
if (expectedDateTime.getTime() >= replyDateTime.getTime()) { |
|
|
|
if (expectedDateTime.getTime() > replyDateTime.getTime()) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
@ -232,7 +213,7 @@ export default { |
|
|
|
"CustomerOrderReviewInfo-CustomerId": row['CustomerOrderReviewInfo-CustomerId'], |
|
|
|
"CustomerOrderReviewInfo-ArtId": row['CustomerOrderReviewInfo-ArtId'], |
|
|
|
"CustomerOrderReviewInfo-Qty": parseFloat(row['CustomerOrderReviewInfo-Qty']), |
|
|
|
"CustomerOrderReviewInfo-ExpectedDate": row['CustomerOrderReviewInfo-ExpectedDate'] |
|
|
|
"CustomerOrderReviewInfo-ExpectedDate": row['CustomerOrderReviewInfo-ExpectedDate']==""?null:row['CustomerOrderReviewInfo-ExpectedDate'] |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.deliveryTrialDisable = true |
|
|
@ -241,10 +222,12 @@ export default { |
|
|
|
this.detailHeaders = [] |
|
|
|
this.detailTableData = [] |
|
|
|
res.data.forEach( (item,index) => { |
|
|
|
this.multipleSelection[index]["CustomerOrderReviewInfo-ReplyDate"] = item['CustomerOrderReviewInfo-ReplyDate'].replaceAll("-",".") |
|
|
|
this.multipleSelection[index]["CustomerOrderReviewInfo-ReplyDate"] = item['CustomerOrderReviewInfo-ReplyDate'] |
|
|
|
}) |
|
|
|
this.deliveryTrialDisable = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.deliveryTrialDisable = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
@ -254,9 +237,9 @@ export default { |
|
|
|
"CustomerOrderReviewInfo-CustomerId": row['CustomerOrderReviewInfo-CustomerId'], |
|
|
|
"CustomerOrderReviewInfo-ArtId": row['CustomerOrderReviewInfo-ArtId'], |
|
|
|
"CustomerOrderReviewInfo-Qty": parseFloat(row['CustomerOrderReviewInfo-Qty']), |
|
|
|
"CustomerOrderReviewInfo-ExpectedDate": row['CustomerOrderReviewInfo-ExpectedDate'] |
|
|
|
"CustomerOrderReviewInfo-ExpectedDate": row['CustomerOrderReviewInfo-ExpectedDate']==""?null:row['CustomerOrderReviewInfo-ExpectedDate'] |
|
|
|
}] |
|
|
|
// let mockData = [{ |
|
|
|
// searchParam = [{ |
|
|
|
// "CustomerOrderReviewInfo-CustomerId": "3", |
|
|
|
// "CustomerOrderReviewInfo-ArtId": "CAADQ00001A", |
|
|
|
// "CustomerOrderReviewInfo-Qty": 1000, |
|
|
@ -267,18 +250,11 @@ export default { |
|
|
|
if(res.code === 200 && res.data.length > 0) { |
|
|
|
this.detailHeaders = [] |
|
|
|
this.detailTableData = [] |
|
|
|
|
|
|
|
row["CustomerOrderReviewInfo-ReplyDate"] = res.data[0]['CustomerOrderReviewInfo-ReplyDate'] |
|
|
|
this.showDetail(res.data[0]) |
|
|
|
row["CustomerOrderReviewInfo-ReplyDate"] = res.data[0]['CustomerOrderReviewInfo-ReplyDate'].replaceAll("-",".") |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 处理日期并补0 |
|
|
|
// dealDate(dateString){ |
|
|
|
// let dateArr = dateString.split(".") |
|
|
|
// return dateArr[0] +"-"+ (Array(2).join(0) + dateArr[1]).slice(-2)+"-"+ (Array(2).join(0) + dateArr[2]).slice(-2) |
|
|
|
// }, |
|
|
|
// 显示详情 |
|
|
|
showDetail(data){ |
|
|
|
this.detailHeaders.push({"prop":"-","lable":""}) |
|
|
@ -302,20 +278,16 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
|
|
|
|
this.getCustomerList() |
|
|
|
this.getCustartlist() |
|
|
|
}, |
|
|
|
mounted(){ |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.tableHeight = this.calculationTableHeight( |
|
|
|
this.$refs.tableRef, |
|
|
|
300 |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
this.tableHeight = this.calculationTableHeight( |
|
|
|
this.$refs.tableRef, |
|
|
|
300 |
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|