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

2
src/api/basic/basicDelineMiddle.js

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

2
src/api/basic/basicDelineNode.js

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

12
src/option/basic/basicDeline.js

@ -146,6 +146,18 @@ export default {
type: "input", type: "input",
width: 115, width: 115,
align:'center', align:'center',
props: {
label: 'name',
value: 'code'
},
dicData: [{
name: '关闭',
code: '1'
}, {
name: '启用',
code: '2'
}]
}, },
{ {
label: "仓库名称", 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> <el-button type="primary" text icon="el-icon-view" @click="addEditDeline(row)"> </el-button>
</template> </template>
</avue-crud> </avue-crud>
<basicDeLineform v-if="!edit" @returnDeline ="returnDeline" :lineformdata="delineformdata" /> <basicDeLineform v-if="!edit" @returnDeline ="returnDeline" :delineformdata="delineformdata" />
</basic-container> </basic-container>
</template> </template>
@ -111,6 +111,7 @@
if (!!row){ if (!!row){
this.delineformdata = row this.delineformdata = row
this.delineformdata.delinenode = [{}] this.delineformdata.delinenode = [{}]
this.delineformdata.end = [{}]
} }
this.edit =false this.edit =false

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

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

Loading…
Cancel
Save