|
|
|
@ -83,7 +83,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- </el-form>--> |
|
|
|
|
<avue-form :option="lineformdata" v-model="fileList"/> |
|
|
|
|
<avue-form :option="option" v-model="form"> |
|
|
|
|
<template #input="{row}"> |
|
|
|
|
<el-tag>序号:{{row.$index}}-数据:{{row.input}}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
</avue-form> |
|
|
|
|
<div style="position: fixed;bottom: 7%;left: 40%;width: 100%"> |
|
|
|
|
<div style="width: 100%"> |
|
|
|
|
<el-button type="primary" @click="submitForm" style="margin-right: 20%" :disabled=this.isDis>确定</el-button> |
|
|
|
@ -96,6 +100,10 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getDetail as getDetailWarehouse } from '@/api/basicdata/basicdataWarehouse'; |
|
|
|
|
import { add,update } from '@/api/basic/basicLine'; |
|
|
|
|
import {getListpage,getList} from '@/api/basic/basicLineNode' |
|
|
|
|
import { getList as carrierData } from '@/api/basicdata/basicdataCarrier'; |
|
|
|
|
export default { |
|
|
|
|
name: "basicLineform", |
|
|
|
|
props: { |
|
|
|
@ -105,11 +113,167 @@ name: "basicLineform",
|
|
|
|
|
}, |
|
|
|
|
created(){ |
|
|
|
|
console.log("lineformdata>>>>>>>>>>",this.lineformdata); |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
lineformdata: { |
|
|
|
|
tableData: [], |
|
|
|
|
nodequery:{}, |
|
|
|
|
// option: { |
|
|
|
|
// emptyBtn: false, //隐藏清空按钮 |
|
|
|
|
// submitBtn: false, //隐藏提交按钮 |
|
|
|
|
// tableData: [], |
|
|
|
|
// }, |
|
|
|
|
form: { |
|
|
|
|
linenode: [{}] |
|
|
|
|
}, |
|
|
|
|
// 分页信息 |
|
|
|
|
nodepage: { |
|
|
|
|
currentPage: 1, |
|
|
|
|
pageSize: 50, |
|
|
|
|
total: 40 |
|
|
|
|
}, |
|
|
|
|
option: { |
|
|
|
|
emptyBtn: false, //隐藏清空按钮 |
|
|
|
|
submitBtn: false, |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: '线路节点', |
|
|
|
|
prop: 'linenode', |
|
|
|
|
type: 'dynamic', |
|
|
|
|
span: 24, |
|
|
|
|
hight:20, |
|
|
|
|
children: { |
|
|
|
|
align: 'center', |
|
|
|
|
headerAlign: 'center', |
|
|
|
|
rowAdd: (done) => { |
|
|
|
|
this.$message.success('新增回调'); |
|
|
|
|
done({ |
|
|
|
|
input: '默认值' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowDel: (row, done) => { |
|
|
|
|
this.$message.success('删除回调' + JSON.stringify(row)); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
column: [{ |
|
|
|
|
label: '仓库', |
|
|
|
|
prop: "warehouseId", |
|
|
|
|
type: 'select', |
|
|
|
|
width: 200, |
|
|
|
|
dicUrl: "/api/logpm-basicdata/warehouse/dictionary", |
|
|
|
|
props: { |
|
|
|
|
label: "name", |
|
|
|
|
value: "id", |
|
|
|
|
}, |
|
|
|
|
rules: [{ required: true, message: '请选择仓库!',trigger: 'blur'}], |
|
|
|
|
change: (val) => { |
|
|
|
|
if (!!val.value){ |
|
|
|
|
getDetailWarehouse(val.value).then(res => { |
|
|
|
|
// $this.$set($this.option.column[0], 'contacts', res.data.data.linkman); |
|
|
|
|
this.form.linenode[val.index].contacts =res.data.data.linkman |
|
|
|
|
this.form.linenode[val.index].telephone =res.data.data.contactNumber |
|
|
|
|
this.form.linenode[val.index].addressNotes =res.data.remarks |
|
|
|
|
this.form.linenode[val.index].warehouseAddress =res.data.data.warehouseAddress |
|
|
|
|
this.form.linenode[val.index].warehouseName =res.data.data.name |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
},{ |
|
|
|
|
width: 200, |
|
|
|
|
label: '仓库地址', |
|
|
|
|
prop: "warehouseAddress", |
|
|
|
|
// disabled:true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
width: 200, |
|
|
|
|
label: '地址备注', |
|
|
|
|
prop: "addressNotes", |
|
|
|
|
// disabled:true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
width: 200, |
|
|
|
|
label: '联系人', |
|
|
|
|
prop: "contacts", |
|
|
|
|
// disabled:true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
width: 200, |
|
|
|
|
label: '联系电话', |
|
|
|
|
prop: "telephone", |
|
|
|
|
// disabled:true, |
|
|
|
|
},{ |
|
|
|
|
width: 200, |
|
|
|
|
label: '里程(km)', |
|
|
|
|
prop: "route", |
|
|
|
|
rules: [ { required: true, message: '请填写时效!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '格式不正确!'}], |
|
|
|
|
change: (val) => { |
|
|
|
|
if (!!val.value){ |
|
|
|
|
this.form.lineRoute = 0; |
|
|
|
|
for (let i = 0; i < this.form.linenode.length; i++) { |
|
|
|
|
this.form.lineRoute = (this.form.lineRoute*10000 + this.form.linenode[i].route*10000)/10000 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
},{ |
|
|
|
|
width: 200, |
|
|
|
|
label: '时效(h)', |
|
|
|
|
prop: "ageing", |
|
|
|
|
type: 'number', |
|
|
|
|
rules: [ { required: true, message: '请填写时效!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '格式不正确!'}], |
|
|
|
|
change: (val) => { |
|
|
|
|
if (!!val.value){ |
|
|
|
|
this.form.lineAgeing = 0; |
|
|
|
|
for (let i = 0; i < this.form.linenode.length; i++) { |
|
|
|
|
this.form.lineAgeing = (this.form.lineAgeing*10000 + this.form.linenode[i].ageing*10000)/10000 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '车线编号', |
|
|
|
|
prop: 'lineNumber', |
|
|
|
|
span: 11, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '车线名称', |
|
|
|
|
prop: 'lineName', |
|
|
|
|
span: 11, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '车线类型', |
|
|
|
|
prop: 'lineType', |
|
|
|
|
type: 'select', |
|
|
|
|
span: 11, |
|
|
|
|
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_line_type', |
|
|
|
|
props: { |
|
|
|
|
label: 'dictValue', |
|
|
|
|
value: 'dictKey', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '车线总里程', |
|
|
|
|
prop: 'lineRoute', |
|
|
|
|
span: 11, |
|
|
|
|
type: 'number', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '车线总时效', |
|
|
|
|
prop: 'lineAgeing', |
|
|
|
|
type: 'number', |
|
|
|
|
span: 11, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '备注', |
|
|
|
|
prop: 'notes', |
|
|
|
|
type: 'input', |
|
|
|
|
span: 11, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
validatorRules: { |
|
|
|
|
name: [ |
|
|
|
@ -121,13 +285,50 @@ name: "basicLineform",
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
initData(){ |
|
|
|
|
//查询子表 |
|
|
|
|
let params ={ |
|
|
|
|
masterId: this.lineformdata.id |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getList(this.nodepage.currentPage, this.nodepage.pageSize,Object.assign(params, this.nodequery)).then(res => { |
|
|
|
|
console.log("res.data.data.records>>>>>>>>>>>>>>>",res.data.data.records); |
|
|
|
|
this.form = this.lineformdata; |
|
|
|
|
this.form.linenode = res.data.data.records; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
cancellation(){ |
|
|
|
|
let str = { |
|
|
|
|
val: false |
|
|
|
|
} |
|
|
|
|
this.$emit("returnline", str); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
submitForm(){ |
|
|
|
|
console.log("this.form>>>>>>>",this.form); |
|
|
|
|
let row = this.form |
|
|
|
|
if (!!row.id){ |
|
|
|
|
update(row).then(() => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}, error => { |
|
|
|
|
loading(); |
|
|
|
|
console.log(error); |
|
|
|
|
}); |
|
|
|
|
}else { |
|
|
|
|
add(row).then(() => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}, error => { |
|
|
|
|
loading(); |
|
|
|
|
window.console.log(error); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|