Browse Source

1.提货线路增加修改功能

test
0.0 2 years ago
parent
commit
a08fd035a9
  1. 4
      src/api/basic/basicDeline.js
  2. 2
      src/api/basic/basicDelineMiddle.js
  3. 2
      src/api/basic/basicDelineNode.js
  4. 12
      src/option/basic/basicDeline.js
  5. 3
      src/views/basic/deline/basicDeline.vue
  6. 112
      src/views/basic/deline/basicdeLineform.vue

4
src/api/basic/basicDeline.js

@ -34,7 +34,7 @@ export const remove = (ids) => {
export const add = (row) => {
return request({
url: '/api/logpm-basic/deline/submit',
url: '/api/logpm-basic/deline/save',
method: 'post',
data: row
})
@ -42,7 +42,7 @@ export const add = (row) => {
export const update = (row) => {
return request({
url: '/api/logpm-basic/deline/submit',
url: '/api/logpm-basic/deline/update',
method: 'post',
data: row
})

2
src/api/basic/basicDelineMiddle.js

@ -2,7 +2,7 @@ import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/logpm-basic/delinemiddle/list',
url: '/api/logpm-basic/delinemiddle/page',
method: 'get',
params: {
...params,

2
src/api/basic/basicDelineNode.js

@ -2,7 +2,7 @@ import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/logpm-basic/delinenode/list',
url: '/api/logpm-basic/delinenode/page',
method: 'get',
params: {
...params,

12
src/option/basic/basicDeline.js

@ -146,6 +146,18 @@ export default {
type: "input",
width: 115,
align:'center',
props: {
label: 'name',
value: 'code'
},
dicData: [{
name: '关闭',
code: '1'
}, {
name: '启用',
code: '2'
}]
},
{
label: "仓库名称",

3
src/views/basic/deline/basicDeline.vue

@ -39,7 +39,7 @@
<el-button type="primary" text icon="el-icon-view" @click="addEditDeline(row)"> </el-button>
</template>
</avue-crud>
<basicDeLineform v-if="!edit" @returnDeline ="returnDeline" :lineformdata="delineformdata" />
<basicDeLineform v-if="!edit" @returnDeline ="returnDeline" :delineformdata="delineformdata" />
</basic-container>
</template>
@ -111,6 +111,7 @@
if (!!row){
this.delineformdata = row
this.delineformdata.delinenode = [{}]
this.delineformdata.end = [{}]
}
this.edit =false

112
src/views/basic/deline/basicdeLineform.vue

@ -18,9 +18,10 @@
</template>
<script>
import { getDetail as getDetailDelineNode } from '@/api/basic/basicDelineNode';
import { add, getDetail, update } from '@/api/basic/basicLine';
import {getList} from '@/api/basic/basicdelinenode'
import { getDetail as getDetailDelineNode, } from '@/api/basic/basicDelineNode';
import {getList} from '@/api/basic/basicDelineNode';
import {add,update} from '@/api/basic/basicdeline';
import { getDetail as getDetailWarehouse } from '@/api/basicdata/basicdataWarehouse';
export default {
name: "basicDeLineform",
@ -30,7 +31,8 @@ name: "basicDeLineform",
},
},
created(){
if (!!this.delineformdata.id){this.initData()}
console.log(">>>>>>>>",this.delineformdata);
if (!!this.delineformdata){this.initData()}
},
data() {
return {
@ -43,6 +45,13 @@ name: "basicDeLineform",
// tableData: [],
// },
form: {
warehouseId:null,
warehouseAddress:null,
warehouseContacts:null,
warehousePhone:null,
state:'2',
ageing:0,
route:0,
delinenode: [{}],
end:[{}]
},
@ -76,7 +85,7 @@ name: "basicDeLineform",
},
column: [{
label: '提货客户',
prop: "warehouseId",
prop: "id",
type: 'select',
width: 200,
dicUrl: "/api/logpm-basic/delinenode/dictionary",
@ -88,13 +97,12 @@ name: "basicDeLineform",
change: (val) => {
if (!!val.value){
getDetailDelineNode(val.value).then(res => {
console.log("res.data.data>>>>>>>>>>",res.data.data);
// $this.$set($this.option.column[0], 'contacts', res.data.data.linkman);
this.form.delinenode[val.index].contacts =res.data.data.contacts
this.form.delinenode[val.index].telephone =res.data.data.telephone
this.form.delinenode[val.index].address =res.data.address
this.form.delinenode[val.index].warehouseAddress =res.data.data.warehouseAddress
this.form.delinenode[val.index].warehouseName =res.data.data.name
this.form.delinenode[val.index].address =res.data.data.address
this.form.delinenode[val.index].customer =res.data.data.customer
// this.form.delinenode[val.index].id =res.data.data.id
// if (val.index ==0){
// this.form.lineName =
// }
@ -129,7 +137,7 @@ name: "basicDeLineform",
width: 200,
label: '里程(km)',
prop: "route",
type: 'number',
type: 'input',
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){
@ -145,15 +153,15 @@ name: "basicDeLineform",
width: 200,
label: '时效(h)',
prop: "ageing",
type: 'number',
type: 'input',
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){
let a = 0;
for (let i = 0; i < this.form.delinenode.length; i++) {
if (!!this.form.delinenode[i]){a = (a*10000 + this.form.delinenode[i].ageing*10000)/10000}
if (!!this.form.delinenode[i].ageing){a = (a*10000 + this.form.delinenode[i].ageing*10000)/10000}
}
if (!!this.form.end[0].lineAgeing){a = (a*10000 + this.form.end[0].lineAgeing*10000)/10000}
if (!!this.form.end[0].ageing){a = (a*10000 + this.form.end[0].ageing*10000)/10000}
this.form.lineAgeing = a;
}
},
@ -191,10 +199,10 @@ name: "basicDeLineform",
if (!!val.value){
getDetailWarehouse(val.value).then(res => {
// $this.$set($this.option.column[0], 'contacts', res.data.data.linkman);
this.form.end[0][val.index].warehouseContacts =res.data.data.linkman
this.form.end[0][val.index].warehousePhone =res.data.data.contactNumber
this.form.end[0][val.index].warehouseAddress =res.data.data.warehouseAddress
this.form.end[0][val.index].warehouseName =res.data.data.name
this.form.end[0].warehouseContacts =res.data.data.linkman
this.form.end[0].warehousePhone =res.data.data.contactNumber
this.form.end[0].warehouseAddress =res.data.data.warehouseAddress
this.form.end[0].warehouseName =res.data.data.name
// if (val.index ==0){
// this.form.lineName =
// }
@ -226,7 +234,7 @@ name: "basicDeLineform",
width: 200,
label: '里程(km)',
prop: "route",
type: 'number',
type: 'input',
value:0,
rules: [ { required: true, message: '请填写里程!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '格式不正确!'}],
change: (val) => {
@ -243,49 +251,33 @@ name: "basicDeLineform",
width: 200,
label: '时效(h)',
prop: "ageing",
type: 'number',
type: 'input',
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){
let a = 0;
for (let i = 0; i < this.form.delinenode.length; i++) {
if (!!this.form.delinenode[i]){a = (a*10000 + this.form.delinenode[i].ageing*10000)/10000}
if (!!this.form.delinenode[i].ageing){a = (a*10000 + this.form.delinenode[i].ageing*10000)/10000}
}
if (!!this.form.end[0].lineAgeing){a = (a*10000 + this.form.end[0].lineAgeing*10000)/10000}
if (!!this.form.end[0].ageing){a = (a*10000 + this.form.end[0].ageing*10000)/10000}
this.form.lineAgeing = a;
}
},
},
],
click: () => {
//
}
}
},
// {
// label: '线',
// prop: 'lineType',
// type: 'select',
// span: 11,
// dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_line_type',
// props: {
// label: 'dictValue',
// value: 'dictKey',
// },
// rules: [{required: true, message: '!',trigger: 'blur'}],
// },
{
label: '线路总里程',
prop: 'lineRoute',
span: 11,
type: 'number',
type: 'input',
readonly : true
},
{
label: '线路总时效',
prop: 'lineAgeing',
type: 'number',
type: 'input',
span: 11,
readonly : true
},
@ -327,22 +319,50 @@ name: "basicDeLineform",
initData(){
//
let params ={
masterId: this.delineformdata.id
delineId: this.delineformdata.id
}
getList(this.nodepage.currentPage, this.nodepage.pageSize,Object.assign(params, this.nodequery)).then(res => {
this.form = this.delineformdata;
this.form.delinenode = res.data.data.records;
console.log("res.data.data.records>>>>>>>>>>>>>",res.data.data.records);
this.form = this.delineformdata;
this.form.end[0].delineformdata = this.delineformdata.delineformdata
this.form.end[0].warehouseContacts = this.delineformdata.warehouseContacts
this.form.end[0].warehouseId = this.delineformdata.warehouseId
this.form.end[0].warehousePhone = this.delineformdata.warehousePhone
this.form.end[0].route = this.delineformdata.route
this.form.end[0].ageing = this.delineformdata.ageing
// console.log("this.form.end>>>>>>>>>>>>>",this.form.end);
this.form.delinenode = res.data.data.records;
// for (let i = 0; i < this.form.delinenode.length; i++) {
// this.form.delinenode[i].nodeId =
// }
});
},
cancellation(){
let str = {
val: false
}
this.$emit("returnline", str);
this.$emit("returnDeline", str);
},
submitForm(){
this.$refs.myForm.validate(valid => {
if (valid) {
//DTO
this.form.ageing=this.form.end[0].ageing
this.form.route=this.form.end[0].route
this.form.warehouseAddress=this.form.end[0].warehouseAddress
this.form.warehouseContacts=this.form.end[0].warehouseContacts
this.form.warehouseId=this.form.end[0].warehouseId
this.form.warehouseName=this.form.end[0].warehouseName
this.form.warehousePhone=this.form.end[0].warehousePhone
this.form.nodeNub = this.form.delinenode.length + 1
let a = ''
for (let i = 0; i < this.form.delinenode.length; i++) {
a += (this.form.delinenode[i].customer +"->")
}
a += this.form.end[0].warehouseName
this.form.lineName = a
console.log("处理>>>>>>>>>>>>",this.form);
this.isDis = true;
let row = this.form
if (!!row.id){
@ -355,10 +375,9 @@ name: "basicDeLineform",
val: true
}
this.isDis = false;
this.$emit("returnline", str);
this.$emit("returnDeline", str);
}, error => {
this.isDis = false;
loading();
console.log(error);
});
}else {
@ -371,10 +390,9 @@ name: "basicDeLineform",
val: true
}
this.isDis = false;
this.$emit("returnline", str);
this.$emit("returnDeline", str);
}, error => {
this.isDis = false;
loading();
window.console.log(error);
});
}

Loading…
Cancel
Save