Browse Source

修改客户需求管理bug

pull/21/head
xuxiaoming 3 years ago
parent
commit
2fb0f12ef3
3 changed files with 121 additions and 147 deletions
  1. +86
    -91
      src/views/productionPlanning/customerInquiry/add.vue
  2. +20
    -52
      src/views/productionPlanning/customerInquiry/index.vue
  3. +15
    -4
      src/views/productionPlanning/customerInquiry/upload.vue

+ 86
- 91
src/views/productionPlanning/customerInquiry/add.vue View File

@ -1,54 +1,42 @@
<template> <template>
<el-dialog <el-dialog
title="添加询单"
model-value
width="1000px"
:close-on-click-modal="false"
:before-close="handleClose"
>
<el-form
ref="formRef"
v-loading="loading"
:model="formData"
:rules="rules"
label-width="140px"
>
title="添加询单" model-value width="1000px" :close-on-click-modal="false" :before-close="handleClose" >
<el-form ref="formRef" v-loading="loading" :model="formData" :rules="rules" label-width="140px" >
<el-row> <el-row>
<el-col :span="12">
<el-form-item
:label="getColumnName('CustomerOrderReviewInfo-CustomerId')" prop="CustomerId" >
<el-select v-model="formData['CustomerOrderReviewInfo-CustomerId']" placeholder="请选择" @change="customerChange">
<el-option v-for="item in customerList" :key="item['Customer-CustomerId']"
:label="item['Customer-Name1']" :value="item['Customer-CustomerId']"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
:label="getColumnName('CustomerOrderReviewInfo-ArtId')" prop="ArtId" >
<el-select v-model="formData['CustomerOrderReviewInfo-ArtId']" placeholder="请选择">
<el-option v-for="item in custartList" :key="item['AP_CustArtlst-ArtId']"
:label="item['AP_CustArtlst-ArtId']" :value="item['AP_CustArtlst-ArtId']"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
:label="getColumnName('CustomerOrderReviewInfo-CustomerId')" prop="CustomerOrderReviewInfo-CustomerId" >
<el-select v-model="formData['CustomerOrderReviewInfo-CustomerId']" placeholder="请选择" @change="customerChange">
<el-option v-for="item in customerList" :key="item['Customer-CustomerId']"
:label="item['Customer-Name1']" :value="item['Customer-CustomerId']"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
:label="getColumnName('CustomerOrderReviewInfo-ArtId')" prop="CustomerOrderReviewInfo-ArtId" >
<el-select v-model="formData['CustomerOrderReviewInfo-ArtId']" placeholder="可输入关键字赛选" filterable>
<el-option v-for="item in custartList" :key="item['AP_CustArtlst-ArtId']"
:label="item['AP_CustArtlst-ArtId']" :value="item['AP_CustArtlst-ArtId']"/>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="getColumnName('CustomerOrderReviewInfo-Qty')" prop="Qty" >
<el-input v-model="formData['CustomerOrderReviewInfo-Qty']" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="getColumnName('CustomerOrderReviewInfo-ExpectedDate')" prop="ExpectedDate" >
<el-date-picker
value-format="YYYY-MM-DD"
v-model="formData['CustomerOrderReviewInfo-ExpectedDate']"
placeholder="请选择日期"/>
</el-form-item>
</el-col>
<el-row>
<el-col :span="12">
<el-form-item :label="getColumnName('CustomerOrderReviewInfo-Qty')" prop="CustomerOrderReviewInfo-Qty" >
<el-input v-model="formData['CustomerOrderReviewInfo-Qty']" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="getColumnName('CustomerOrderReviewInfo-ExpectedDate')" prop="CustomerOrderReviewInfo-ExpectedDate" >
<el-date-picker
:editable="false"
value-format="YYYY-MM-DD"
v-model="formData['CustomerOrderReviewInfo-ExpectedDate']"
placeholder="请选择日期"/>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
@ -63,8 +51,8 @@ width="1000px"
import { getCustartlist } from "@/server/plan/workbench/customerInquiry"; import { getCustartlist } from "@/server/plan/workbench/customerInquiry";
export default { export default {
emits:[ emits:[
"setIsAdd",
"pushData"
'setIsAdd',
'pushData'
], ],
props: { props: {
customerList: { customerList: {
@ -73,44 +61,50 @@ export default {
}, },
data() { data() {
return { return {
formData: {
'CustomerOrderReviewInfo-CustomerId':'',
'CustomerOrderReviewInfo-ArtId':'',
'CustomerOrderReviewInfo-Qty':'',
'CustomerOrderReviewInfo-ExpectedDate':'',
},
rules: { rules: {
"CustomerOrderReviewInfo-CustomerId": [
{
required: true,
message: "此项不能为空",
trigger: "blur",
},
],
"CustomerOrderReviewInfo-ArtId": [
{
required: true,
message: "此项不能为空",
trigger: "blur",
},
],
"CustomerOrderReviewInfo-Qty": [
{
required: true,
message: "此项不能为空",
trigger: "blur",
},
],
"CustomerOrderReviewInfo-ExpectedDate": [
{
required: true,
message: "此项不能为空",
trigger: "blur",
},
],
'CustomerOrderReviewInfo-CustomerId': [
{
required: true,
message: '此项不能为空',
trigger: 'blur'
},
],
'CustomerOrderReviewInfo-ArtId': [
{
required: true,
message: '此项不能为空',
trigger: 'blur'
},
],
'CustomerOrderReviewInfo-Qty': [
{
required: true,
message: '此项不能为空',
trigger: 'blur'
},
],
'CustomerOrderReviewInfo-ExpectedDate': [
{
required: true,
message: '此项不能为空',
trigger: 'blur'
},
],
}, },
loading: false, loading: false,
formData: {}, //
// //
treeMenu: [], // tree treeMenu: [], // tree
custartList: [], custartList: [],
defaultProps: { defaultProps: {
children: "Children",
label: "Menu-Title",
children: 'Children',
label: 'Menu-Title',
}, },
}; };
}, },
@ -120,29 +114,30 @@ export default {
}, },
// //
getCustartlist(customerId){ getCustartlist(customerId){
getCustartlist( { "customerId": customerId }).then(({data=[]})=>{
getCustartlist( { 'customerId': customerId }).then(({data=[]})=>{
this.custartList=data; this.custartList=data;
}) })
}, },
// //
submitForm() { submitForm() {
this.$refs["formRef"].validate((valid) => {
if (valid) {
this.formData['CustomerOrderReviewInfo-ReplyDate'] = ""
this.$emit("pushData", this.formData);
} else {
console.log("error submit!!");
return false;
}
this.$refs['formRef'].validate((valid) => {
console.log('%cadd.vue line:130 valid', 'color: #007acc;', valid);
if (valid) {
this.formData['CustomerOrderReviewInfo-ReplyDate'] = ''
this.$emit('pushData', this.formData);
} else {
console.log('error submit!!');
return false;
}
}); });
}, },
// / // /
handleClose() { handleClose() {
this.$emit("setIsAdd", false);
this.$emit('setIsAdd', false);
}, },
// //
selected(name) { selected(name) {
this.formData["Menu-Icon"] = name;
this.formData['Menu-Icon'] = name;
}, },
} }


+ 20
- 52
src/views/productionPlanning/customerInquiry/index.vue View File

@ -13,7 +13,7 @@
<el-form-item> <el-form-item>
<el-button <el-button
class="add-button-style" class="add-button-style"
@click="handleUpload"
@click="importDialogVisable = true"
>批量导入 >批量导入
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -105,7 +105,7 @@
@setIsAdd="setIsAdd" @setIsAdd="setIsAdd"
@pushData="pushData" /> @pushData="pushData" />
<Upload <Upload
v-if="isUpload"
v-model="importDialogVisable"
@editCallBack="completeCallBack" /> @editCallBack="completeCallBack" />
</div> </div>
@ -114,7 +114,7 @@
import Add from "./add.vue"; import Add from "./add.vue";
import Upload from "./upload.vue"; import Upload from "./upload.vue";
import { ListMixin } from "@/mixins/newListMixin"; import { ListMixin } from "@/mixins/newListMixin";
import { getCustomerList ,getCustartlist,customerorderreviewlist,exportExcel } from "@/server/plan/workbench/customerInquiry";
import { getCustomerList ,customerorderreviewlist,exportExcel } from "@/server/plan/workbench/customerInquiry";
export default { export default {
components: { components: {
Add, Add,
@ -126,7 +126,7 @@ export default {
tableHeight:0, tableHeight:0,
loading: false, loading: false,
isAdd: false, isAdd: false,
isUpload: false,
importDialogVisable: false,
deliveryTrialDisable:false, deliveryTrialDisable:false,
isShowDialog: '', isShowDialog: '',
detailHeaders: [], detailHeaders: [],
@ -141,6 +141,7 @@ export default {
"CustomerOrderReviewInfo-ExpectedDate", "CustomerOrderReviewInfo-ExpectedDate",
"CustomerOrderReviewInfo-ReplyDate" "CustomerOrderReviewInfo-ReplyDate"
], ],
tableData:[],
customerList:[], customerList:[],
custartList:[], custartList:[],
multipleSelection: [], multipleSelection: [],
@ -150,12 +151,9 @@ export default {
methods: { methods: {
handleExport(){ 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 => { exportExcel(this.tableData).then(res => {
let link = document.createElement('a'); let link = document.createElement('a');
link.style.display = 'none'; link.style.display = 'none';
@ -165,24 +163,12 @@ export default {
link.click(); link.click();
}) })
}, },
//
handleUpload() {
this.isUpload = true
},
// //
completeCallBack(dataList) { completeCallBack(dataList) {
this.tableData = 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.showUploadDailog = false
}, },
// //
getCustomerList(){ getCustomerList(){
@ -190,15 +176,8 @@ export default {
this.customerList=data; this.customerList=data;
}) })
}, },
//
getCustartlist(){
getCustartlist().then(({data=[]})=>{
this.custartList=data;
})
},
// / // /
setIsAdd(value) { setIsAdd(value) {
console.log('%cindex.vue line:147 setIsAdd value', 'color: #007acc;', value);
this.isAdd = value; this.isAdd = value;
}, },
pushData(data){ pushData(data){
@ -241,7 +220,7 @@ export default {
this.detailHeaders = [] this.detailHeaders = []
this.detailTableData = [] this.detailTableData = []
res.data.forEach( (item,index) => { res.data.forEach( (item,index) => {
this.multipleSelection[index]["CustomerOrderReviewInfo-ReplyDate"] = item['CustomerOrderReviewInfo-ReplyDate'].replaceAll("-",".")
this.tableData[index]["CustomerOrderReviewInfo-ReplyDate"] = item['CustomerOrderReviewInfo-ReplyDate']
}) })
this.deliveryTrialDisable = false this.deliveryTrialDisable = false
} }
@ -256,7 +235,7 @@ export default {
"CustomerOrderReviewInfo-Qty": parseFloat(row['CustomerOrderReviewInfo-Qty']), "CustomerOrderReviewInfo-Qty": parseFloat(row['CustomerOrderReviewInfo-Qty']),
"CustomerOrderReviewInfo-ExpectedDate": row['CustomerOrderReviewInfo-ExpectedDate'] "CustomerOrderReviewInfo-ExpectedDate": row['CustomerOrderReviewInfo-ExpectedDate']
}] }]
// let mockData = [{
// searchParam = [{
// "CustomerOrderReviewInfo-CustomerId": "3", // "CustomerOrderReviewInfo-CustomerId": "3",
// "CustomerOrderReviewInfo-ArtId": "CAADQ00001A", // "CustomerOrderReviewInfo-ArtId": "CAADQ00001A",
// "CustomerOrderReviewInfo-Qty": 1000, // "CustomerOrderReviewInfo-Qty": 1000,
@ -267,18 +246,11 @@ export default {
if(res.code === 200 && res.data.length > 0) { if(res.code === 200 && res.data.length > 0) {
this.detailHeaders = [] this.detailHeaders = []
this.detailTableData = [] this.detailTableData = []
row["CustomerOrderReviewInfo-ReplyDate"] = res.data[0]['CustomerOrderReviewInfo-ReplyDate']
this.showDetail(res.data[0]) 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){ showDetail(data){
this.detailHeaders.push({"prop":"-","lable":""}) this.detailHeaders.push({"prop":"-","lable":""})
@ -302,20 +274,16 @@ export default {
} }
}, },
created(){ created(){
this.getCustomerList() this.getCustomerList()
this.getCustartlist()
}, },
mounted(){ mounted(){
this.$nextTick(() => {
this.tableHeight = this.calculationTableHeight(
this.$refs.tableRef,
300
);
});
}
this.$nextTick(() => {
this.tableHeight = this.calculationTableHeight(
this.$refs.tableRef,
300
);
});
}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>


+ 15
- 4
src/views/productionPlanning/customerInquiry/upload.vue View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :title="title" model-value width="50%" :close-on-click-modal="false" :before-close="cancel">
<el-dialog :title="title" width="50%" :before-close="handleClose" >
<input <input
type="file" type="file"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, xls, xlsx" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, xls, xlsx"
@ -18,7 +18,14 @@
import { uploadExcel } from "@/server/plan/workbench/customerInquiry.js"; import { uploadExcel } from "@/server/plan/workbench/customerInquiry.js";
export default { export default {
name: 'editField', name: 'editField',
props:{
showUploadDailog : {
type: Boolean,
default: () => {
return false
}
},
},
data() { data() {
return { return {
title: '导入', // title: '导入', //
@ -26,9 +33,13 @@ export default {
excel: '', excel: '',
} }
}, },
created () {
console.log('%cupload.vue line:37 this.showUploadDailog dd', 'color: #007acc;', this.showUploadDailog);
},
methods: { methods: {
cancel() { //
this.$emit('update:isShowDialog','')
handleClose(done) { //
done();
}, },
// //
previewUpload(file) { previewUpload(file) {


Loading…
Cancel
Save