Browse Source

m100单据维护

branch_ccpg_220107
yu.wu 3 years ago
parent
commit
a07aee58e0
  1. 9
      vue/src/views/pg-fis/basedate/m100BIll/detail.vue
  2. 380
      vue/src/views/pg-fis/basedate/m100BIll/index.vue

9
vue/src/views/pg-fis/basedate/m100BIll/detail.vue

@ -219,6 +219,11 @@ export default {
/** 列表字段 */ /** 列表字段 */
getDefaultField() { getDefaultField() {
var tempsTabs = []; var tempsTabs = [];
tempsTabs.push({
label: "总成编号",
prop: "erpAssemblyCode",
width: 160,
});
tempsTabs.push({ tempsTabs.push({
label: "总成名称", label: "总成名称",
prop: "erpAssemblyName", prop: "erpAssemblyName",
@ -264,8 +269,10 @@ export default {
getList() { getList() {
this.listLoading = true; this.listLoading = true;
console.log("详表条件:" + JSON.stringify(this.customerInfo.parentId)); console.log("详表条件:" + JSON.stringify(this.customerInfo.parentId));
//alert("" + JSON.stringify(this.customerInfo.parentId));
let vehicleAssemblyId = { vehicleAssemblyId: this.customerInfo.parentId };
this.$axios this.$axios
.gets("/api/newjit/bill-m100/"+ this.customerInfo.parentId) .gets("/api/newjit/assembly-cfg-vehicle/list", vehicleAssemblyId)
.then((response) => { .then((response) => {
this.list = response; this.list = response;
setTimeout(() => { setTimeout(() => {

380
vue/src/views/pg-fis/basedate/m100BIll/index.vue

@ -272,12 +272,20 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="KNR:" prop="knr" required > <el-form-item label="KNR:" prop="knr" required >
<el-input <el-select
style="width: 350px" style="width: 350px"
v-model="form.knr" v-model="form.knr"
:disabled="isEdit"
placeholder="请选择添加M100信息对应的KNR号" placeholder="请选择添加M100信息对应的KNR号"
/> filterable
:disabled="false"
@change="getVModel"
>
<el-option
v-for="item in KNRlist"
:key="item.knr"
:label="item.knr"
:value="item.knr"/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -288,7 +296,8 @@
<el-select <el-select
style="width: 350px" style="width: 350px"
v-model="form.vehicleModelCode" v-model="form.vehicleModelCode"
:disabled="isEdit" :disabled="false"
@change="vMchange"
> >
<el-option <el-option
v-for="item in vehicleModelList" v-for="item in vehicleModelList"
@ -303,7 +312,7 @@
<el-input <el-input
style="width: 350px" style="width: 350px"
v-model="form.vin" v-model="form.vin"
:disabled="isEdit" :disabled="false"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -315,7 +324,7 @@
<el-input <el-input
style="width: 350px" style="width: 350px"
v-model="form.hostSN" v-model="form.hostSN"
:disabled="isEdit" :disabled="false"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -327,7 +336,7 @@
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择时间" placeholder="选择时间"
:disabled="isEdit" :disabled="false"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -344,7 +353,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-table <el-table
ref="ERPDetialTable" ref="LeftDetialTable"
v-loading="listLoading" v-loading="listLoading"
element-loading-text="拼命加载中..." element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading" element-loading-spinner="el-icon-loading"
@ -358,7 +367,8 @@
border border
highlight-current-row highlight-current-row
style="width: 95%;margin:10px" style="width: 95%;margin:10px"
@row-click="handleRowClick" @row-click="handleLeftRowClick"
@selection-change="handleLeftSelectionChange"
> >
<!-- <el-table-column type="selection" width="44px"></el-table-column> --> <!-- <el-table-column type="selection" width="44px"></el-table-column> -->
<el-table-column prop="erpAssemblyCode" label="ERP总成编号" width="150px" > <el-table-column prop="erpAssemblyCode" label="ERP总成编号" width="150px" >
@ -446,7 +456,6 @@
border border
highlight-current-row highlight-current-row
style="width: 95%;margin:10px" style="width: 95%;margin:10px"
@row-click="handleRowClick"
> >
<!-- <el-table-column type="selection" width="44px"></el-table-column> --> <!-- <el-table-column type="selection" width="44px"></el-table-column> -->
<el-table-column prop="partCode" label="客户零件代码" width="150px" > <el-table-column prop="partCode" label="客户零件代码" width="150px" >
@ -652,20 +661,52 @@ export default {
BillType: 2, BillType: 2,
//UserId: "00000000-0000-0000-0000-000000000000", //UserId: "00000000-0000-0000-0000-000000000000",
}, },
form:{ form:
knr:"", {
vehicleModelCode:"",
vin:"",
hostSN:"",
onlineTimeVale:"",
leftdetails:[], leftdetails:[],
rightdetails:[], rightdetails:[],
}, },
saveform:{
m100Bill:
{
knr:undefined,
vehicleModelCode:undefined,
vin:undefined,
hostSN:undefined,
onlineTime:undefined,
billStatus:2,
billM100Parts:[],
},
erpAssemblyList:
[
// {
// erpAssemblyCode:undefined,
// erpAssemblyName:undefined,
// vehicleModel:undefined,
// //isCover: true,
// details: undefined,
// // {
// // partCode: undefined,
// // partNum: 1,
// // description: undefined,
// // isKey: false
// // }
// },
]
// #region
/*
*/
// #endregion
},
rightAlldetails:[],
page: 1, page: 1,
// //
showSearch: true, showSearch: true,
bomUnit, bomUnit,
multipleSelection: [], multipleSelection: [],
multipLeLeftSelection:[],
drawer: false, drawer: false,
dialogFormVisible: false, dialogFormVisible: false,
formTitle: "", formTitle: "",
@ -673,14 +714,16 @@ export default {
formLoading: false, formLoading: false,
tableHeight: document.documentElement.clientHeight - 335, tableHeight: document.documentElement.clientHeight - 335,
detailTableHeight:250, detailTableHeight:250,
details:[], // //details:[], //
PLList:[],//线 PLList:[],//线
PLChildList:[],//线 PLChildList:[],//线
vehicleModelQuery:{ vehicleModelQuery:{
dicTypeName:"派格车型", dicTypeName:"派格车型",
}, },
vehicleModelList:[],//list vehicleModelList:[],//list
productTypeList:[{id:1,name:'门板'},{id:2,name:'柱护板'}] productTypeList:[{id:1,name:'门板'},{id:2,name:'柱护板'}],
gettime:"",
KNRlist:null,
}; };
}, },
mounted() { mounted() {
@ -694,6 +737,7 @@ export default {
}); });
}, },
created() { created() {
//this.getKNRList();
this.getList(); this.getList();
this.getProductLine(); this.getProductLine();
}, },
@ -750,7 +794,8 @@ export default {
// //
handleDrawerOpen(param) { handleDrawerOpen(param) {
this.drawer = true; this.drawer = true;
var parentId = param.id; //id //console.log(param)
var parentId = param.assemblyID; //id
this.customerInfos = [ this.customerInfos = [
{ {
ParentId: parentId, ParentId: parentId,
@ -760,17 +805,73 @@ export default {
handleDrawerClose(done) { handleDrawerClose(done) {
done(); done();
}, },
getCurrentTime() {
//
var _this = this;
let yy = new Date().getFullYear();
let mm = new Date().getMonth()+1;
let dd = new Date().getDate();
let hh = new Date().getHours()<10 ? '0'+new Date().getHours() : new Date().getHours();;
let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
_this.gettime = yy+'-'+mm+'-'+dd+' '+hh+':'+mf+':'+ss;
},
save() { save() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
console.log("保存参数:" + JSON.stringify(this.form)); this.saveform.m100Bill.hostSN = this.form.hostSN;
console.log(this.form); this.saveform.m100Bill.knr = this.form.knr;
this.saveform.m100Bill.vin = this.form.vin;
this.saveform.m100Bill.onlineTime = this.form.onlineTime;
this.saveform.m100Bill.vehicleModelCode = this.form.vehicleModelCode;
this.getCurrentTime();
this.saveform.m100Bill.description = "无";
this.saveform.m100Bill.receiveTime = this.gettime;
//rightdetailsrightAlldetails
this.form.rightdetails.forEach(element => {
var tlist = this.rightAlldetails.filter(u => u.erpAssemblyCode === element.erpAssemblyCode && u.partCode === element.partCode
&& u.partName === element.partName && u.partNum === element.partNum);
if(tlist.length === 0)
{
this.rightAlldetails.push(element);
}
});
//this.saveform.erpAssemblyList.details = {};
//console.log("");
//console.log(this.form.leftdetails);
//console.log("");
//console.log(this.form.rightdetails);
//console.log("");
//console.log(this.rightAlldetails);
/**左右关联拼接最终erpAssemblyList格式 */
this.form.leftdetails.forEach((element,i) => {
var templist = this.rightAlldetails.filter(u => u.erpAssemblyCode === element.erpAssemblyCode);
let obj = {};
obj.erpAssemblyCode = element.erpAssemblyCode;
obj.erpAssemblyName = element.erpAssemblyName;
obj.vehicleModel = element.vehicleModel;
obj.details = [];
templist.forEach(detail => {
if(detail.partCode !== "" && detail.partCode !== undefined)
{
obj.details.push(detail);
}
});
this.saveform.erpAssemblyList.push(obj);
});
//console.log(this.saveform);
console.log("保存参数:" + JSON.stringify(this.saveform));
this.formLoading = true; this.formLoading = true;
if (this.isEdit) { if (this.isEdit) {
// //
this.$axios this.$axios
.puts("/api/newjit/new-m100" + this.form.id, this.form) .puts("/api/newjit/new-m100/" + this.multipleSelection[0].id,this.saveform)
.then((response) => { .then((response) => {
console.log(response);
this.formLoading = false; this.formLoading = false;
this.$notify({ this.$notify({
title: "成功", title: "成功",
@ -783,12 +884,26 @@ export default {
}) })
.catch(() => { .catch(() => {
this.formLoading = false; this.formLoading = false;
console.log("error");
this.saveform = {
m100Bill:
{
knr:undefined,
vehicleModelCode:undefined,
vin:undefined,
hostSN:undefined,
onlineTime:undefined,
billStatus:2,
billM100Parts:[],
},
erpAssemblyList:[],
};
}); });
} else { } else {
//insert //insert
console.log(JSON.stringify(this.form)); console.log(JSON.stringify(this.saveform));
this.$axios this.$axios
.posts("/api/newjit/assembly-cfg-erp", this.form) .posts("/api/newjit/new-m100", this.saveform)
.then((response) => { .then((response) => {
this.formLoading = false; this.formLoading = false;
this.$notify({ this.$notify({
@ -802,6 +917,19 @@ export default {
}) })
.catch(() => { .catch(() => {
this.formLoading = false; this.formLoading = false;
this.saveform = {
m100Bill:
{
knr:undefined,
vehicleModelCode:undefined,
vin:undefined,
hostSN:undefined,
onlineTime:undefined,
billStatus:2,
billM100Parts:[],
},
erpAssemblyList:[],
};
}); });
} }
} }
@ -809,6 +937,7 @@ export default {
}, },
/** 新增 */ /** 新增 */
handleCreate() { handleCreate() {
this.getKNRList();
if (this.$refs["form"] !== undefined) { if (this.$refs["form"] !== undefined) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["form"].resetFields(); this.$refs["form"].resetFields();
@ -817,15 +946,44 @@ export default {
this.formTitle = "新增"; this.formTitle = "新增";
this.isEdit = false; this.isEdit = false;
this.form = {}; this.form = {};
this.details = []; this.rightAlldetails = [];
this.saveform = {
m100Bill:
{
knr:undefined,
vehicleModelCode:undefined,
vin:undefined,
hostSN:undefined,
onlineTime:undefined,
billStatus:2,
billM100Parts:[],
},
erpAssemblyList:[],
};
//this.details = [];
this.getvehicleModel(); this.getvehicleModel();
this.dialogFormVisible = true; this.dialogFormVisible = true;
}, },
/** 修改 */ /** 修改 */
handleUpdate(row) { handleUpdate(row) {
this.getKNRList();
this.formTitle = "修改"; this.formTitle = "修改";
this.isEdit = true; this.isEdit = true;
this.details = []; this.rightAlldetails = [];
this.saveform = {
m100Bill:
{
knr:undefined,
vehicleModelCode:undefined,
vin:undefined,
hostSN:undefined,
onlineTime:undefined,
billStatus:2,
billM100Parts:[],
},
erpAssemblyList:[],
};
//this.details = [];
this.getvehicleModel(); this.getvehicleModel();
if (this.multipleSelection.length != 1) { if (this.multipleSelection.length != 1) {
this.$message({ this.$message({
@ -853,14 +1011,14 @@ export default {
// // // //
// }, // },
// }); // });
this.$confirm("是否删除" + this.multipleSelection[0].erpAssemblyCode + "?", "提示", { this.$confirm("是否删除底盘号" + this.multipleSelection[0].vin + "的数据?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
this.$axios this.$axios
.deletes("/api/newjit/assembly-cfg-erp/", this.multipleSelection[0].id) .deletes("/api/newjit/new-m100/"+ this.multipleSelection[0].id)
.then((response) => { .then((response) => {
const index = this.list.indexOf(this.multipleSelection[0]); const index = this.list.indexOf(this.multipleSelection[0]);
this.$notify({ this.$notify({
@ -884,9 +1042,22 @@ export default {
this.$axios this.$axios
.gets("/api/newjit/new-m100/" + id) .gets("/api/newjit/new-m100/" + id)
.then((response) => { .then((response) => {
//console.log(response);
this.form = response.item.m100Bill; this.form = response.item.m100Bill;
//this.details = response.item.details; this.form.rightdetails = [];
//console.log(this.details); this.form.leftdetails = response.item.erpAssemblyList;
response.item.erpAssemblyList.forEach((element,i) => {
element.details.forEach(item => {
item.erpAssemblyCode = element.erpAssemblyCode;
this.rightAlldetails.push(item);
if( i === 0 )
{
this.form.rightdetails.push(item);
}
});
//console.log(this.rightAlldetails);
//console.log(this.form.rightdetails);
});
}); });
}, },
/** 导出功能 */ /** 导出功能 */
@ -975,6 +1146,7 @@ export default {
} }
}, },
/**左增加 */
handleAddLeftDetails() { handleAddLeftDetails() {
this.$forceUpdate(); this.$forceUpdate();
if (this.form.leftdetails === undefined) { if (this.form.leftdetails === undefined) {
@ -984,33 +1156,64 @@ export default {
let obj = {}; let obj = {};
obj.erpAssemblyCode = ""; obj.erpAssemblyCode = "";
obj.erpAssemblyName = ""; obj.erpAssemblyName = "";
obj.vehicleModel = this.form.vehicleModel; obj.vehicleModel = this.form.vehicleModelCode;
console.log(this.form.leftdetails); //console.log(this.form.leftdetails);
this.form.leftdetails.push(obj); this.form.leftdetails.push(obj);
//console.log(688); //console.log(688);
}, },
/**右增加 */
handleAddRightDetails() { handleAddRightDetails() {
this.$forceUpdate(); this.$forceUpdate();
if (this.form.rightdetails === undefined) {
this.form.rightdetails = [];
//console.log(679);
}
let obj = {}; let obj = {};
obj.customerPartCode = ""; //
obj.customerpartName = ""; //console.log(this.multipLeLeftSelection);
obj.partQty= ""; if(this.multipLeLeftSelection.length !== 1)
{
this.$message({
message: "必须选择单行总成",
type: "warning",
});
return;
}
else
{
// if (this.form.rightdetails === undefined) {
// this.form.rightdetails = [];
// this.form.rightdetails.erpAssemblyCode = this.multipLeLeftSelection[0].erpAssemblyCode;
// //console.log(679);
// }
}
obj.erpAssemblyCode = this.multipLeLeftSelection[0].erpAssemblyCode;
obj.partCode = "";
obj.description = "";
obj.partNum= 1;
console.log(this.form.rightdetails); //console.log(this.form.rightdetails);
this.form.rightdetails.push(obj); this.form.rightdetails.push(obj);
//console.log(688); //console.log(688);
}, },
handleLeftDeleteDetails(index){ /**左侧删除 */
handleLeftDeleteDetails(index,row){
this.form.leftdetails.splice(index, 1); this.form.leftdetails.splice(index, 1);
this.rightAlldetails = this. rightAlldetails.filter(u => u.erpAssemblyCode !== row.erpAssemblyCode);
//console.log(693); //console.log(693);
}, },
handleRightDeleteDetails(index){ /**右侧删除 */
handleRightDeleteDetails(index,row){
this.form.rightdetails.splice(index, 1); this.form.rightdetails.splice(index, 1);
this.rightAlldetails.forEach((element,i) => {
if(element === row)
{
//console.log("");
this.rightAlldetails.splice(i, 1);
//console.log(this.rightAlldetails);
return;
}
});
// .filter(u => u.erpAssemblyCode !== row.erpAssemblyCode && u.partCode !== row.partCode
// && u.partName !== row.partName && u.partNum !== row.partNum);
//console.log(693); //console.log(693);
}, },
@ -1034,15 +1237,11 @@ export default {
getList() { getList() {
this.listLoading = true; this.listLoading = true;
this.listQuery.SkipCount = (this.page - 1) * 10; this.listQuery.SkipCount = (this.page - 1) * 10;
console.log(1030)
if(this.listQuery.OnlineTimeValue!== undefined) if(this.listQuery.OnlineTimeValue!== undefined)
{ {
console.log(1033)
console.log(this.listQuery.OnlineTimeValue)
this.listQuery.OnlineTimeBegin = this.listQuery.OnlineTimeValue[0]; this.listQuery.OnlineTimeBegin = this.listQuery.OnlineTimeValue[0];
this.listQuery.OnlineTimeEnd = this.listQuery.OnlineTimeValue[1]; this.listQuery.OnlineTimeEnd = this.listQuery.OnlineTimeValue[1];
} }
console.log(this.listQuery.OnlineTimeValue)
if(this.listQuery.ReceiveTimeValue!== undefined) if(this.listQuery.ReceiveTimeValue!== undefined)
{ {
this.listQuery.ReceiveTimeBegin = this.listQuery.ReceiveTimeValue[0]; this.listQuery.ReceiveTimeBegin = this.listQuery.ReceiveTimeValue[0];
@ -1063,34 +1262,27 @@ export default {
}); });
}, },
getKNRList() {
getDetialList(partCode) { var lq = {};
this.listLoading = true; var tlist = [];
console.log("详表条件:" + JSON.stringify(this.customerInfo.parentId));
this.$axios this.$axios
.gets("/api/newjit/assembly-cfg-erp/" + this.customerInfo.parentId) .gets("/api/newjit/bill-r100/list", lq)
.then((response) => { .then((response) => {
console.log(partCode) this.KNRlist = response.items;
if(partCode !== "" && partCode !== undefined) //console.log(this.KNRlist);
{
//console.log(partCode)
this.list = response.item.details.filter(u => u.partCode === partCode);
}
else
{
this.list = response.item.details;
}
//alert(JSON.stringify(response.Items))
//this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
}) })
.catch(() => { .catch(() => {
this.listLoading = false; console.log("error");
}); });
}, },
getVModel()
{
this.form.vehicleModelCode = this.KNRlist.filter(u => u.knr === this.form.knr)[0].vehicleModelCode;
},
vMchange()
{
this.$forceUpdate();
},
valueselectChange(){}, valueselectChange(){},
handleImportSAP(){}, handleImportSAP(){},
@ -1111,6 +1303,15 @@ export default {
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
//console.log(this.multipleSelection);
},
handleLeftSelectionChange(val)
{
// console.log("");
// console.log(val);
// this.multipLeLeftSelection = [];
// this.multipLeLeftSelection.push(val);
// console.log(this.multipLeLeftSelection);
}, },
/** 通过回调控制style */ /** 通过回调控制style */
cellStyle({ row, column, rowIndex, columnIndex }) { cellStyle({ row, column, rowIndex, columnIndex }) {
@ -1128,10 +1329,53 @@ export default {
return { textAlign: "left", background: "#FAFAFA" }; return { textAlign: "left", background: "#FAFAFA" };
} }
}, },
/**主表点击*/
handleRowClick(row, column, event) { handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row); this.$refs.multipleTable.toggleRowSelection(row);
}, },
/**左点击*/
handleLeftRowClick(row, column, event) {
this.$forceUpdate();
//console.log("");
this.$refs.LeftDetialTable.clearSelection();
this.$refs.LeftDetialTable.toggleRowSelection(row);
this.multipLeLeftSelection = [];
this.multipLeLeftSelection.push(row);
if(this.form.rightdetails === undefined)
{
this.form.rightdetails = []
}
if(this.form.rightdetails.length > 0)
{
var templist = this.rightAlldetails.filter(u => u.erpAssemblyCode === this.form.rightdetails[0].erpAssemblyCode);
this.form.rightdetails.forEach(element => {
var temp = templist.filter(u => u.erpAssemblyCode === element.erpAssemblyCode && u.partCode === element.partCode
&& u.partName === element.partName && u.partNum === element.partNum);
if(temp.length >= 1)
{
//console.log("");
//console.log(templist);
//console.log(element);
}
else
{
//console.log("");
//console.log(element);
this.rightAlldetails.push(element);
}
});
}
else
{
var templist = [];
}
//.log("");
//console.log(this.rightAlldetails);
this.form.rightdetails = this.rightAlldetails.filter(u => u.erpAssemblyCode === this.multipLeLeftSelection[0].erpAssemblyCode);
//console.log("");
//console.log(this.form.rightdetails);
},
//线 //线
getProductLine() getProductLine()
{ {

Loading…
Cancel
Save