Browse Source

建立中间表

test
0.0 2 years ago
parent
commit
b22b8d8403
  1. 50
      src/api/basic/basicDelineMiddle.js
  2. 1
      src/option/basic/basicDelineNode.js
  3. 8
      src/views/basic/deline/basicDeline.vue
  4. 203
      src/views/basic/deline/basicdeLineform.vue
  5. 12
      src/views/basic/line/basicLineform.vue

50
src/api/basic/basicDelineMiddle.js

@ -0,0 +1,50 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/logpm-basic/delinemiddle/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/api/logpm-basic/delinemiddle/detail',
method: 'get',
params: {
id
}
})
}
export const remove = (ids) => {
return request({
url: '/api/logpm-basic/delinemiddle/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return request({
url: '/api/logpm-basic/delinemiddle/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return request({
url: '/api/logpm-basic/delinemiddle/submit',
method: 'post',
data: row
})
}

1
src/option/basic/basicDelineNode.js

@ -148,6 +148,7 @@ export default {
type: "input",
labelWidth:'150',
align:'center',
rules: [{pattern: /^1[34578]\d{9}$/, message: '号码格式不正确!'}],
span:11,
},
{

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

@ -1,6 +1,7 @@
<template>
<basic-container>
<avue-crud :option="option"
<avue-crud v-if="edit"
:option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
@ -38,7 +39,7 @@
<el-button type="primary" text icon="el-icon-view" @click="addEditDeline(row)"> </el-button>
</template>
</avue-crud>
<basicLineform v-if="!edit" @returnDeline ="returnDeline" :lineformdata="delineformdata" />
<basicDeLineform v-if="!edit" @returnDeline ="returnDeline" :lineformdata="delineformdata" />
</basic-container>
</template>
@ -52,8 +53,9 @@
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import basicDeLineform from '/src/views/basic/deline/basicdeLineform.vue'
export default {
components: { basicDeLineform },
data() {
return {
form: {},

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

@ -1,7 +1,7 @@
<template>
<el-form>
<div style="background-color: #ffffff;height: 845px;padding: 2% 4%;">
<avue-form :option="option" ref="myForm" v-model="form">
<avue-form :option="option" ref="myForm" v-model="form">
<template #input="{row}">
<el-tag>序号:{{row.$index}}-数据:{{row.input}}</el-tag>
</template>
@ -18,9 +18,10 @@
</template>
<script>
import { getDetail as getDetailWarehouse } from '@/api/basicdata/basicdataWarehouse';
import { getDetail as getDetailDelineNode } from '@/api/basic/basicDelineNode';
import { add, getDetail, update } from '@/api/basic/basicLine';
import {getListpage,getList} from '@/api/basic/basicdelinenode'
import {getList} from '@/api/basic/basicdelinenode'
import { getDetail as getDetailWarehouse } from '@/api/basicdata/basicdataWarehouse';
export default {
name: "basicDeLineform",
props: {
@ -42,7 +43,8 @@ name: "basicDeLineform",
// tableData: [],
// },
form: {
delinenode: [{}]
delinenode: [{}],
end:[{}]
},
//
nodepage: {
@ -59,7 +61,6 @@ name: "basicDeLineform",
prop: 'delinenode',
type: 'dynamic',
span: 24,
hight:20,
children: {
align: 'center',
headerAlign: 'center',
@ -78,68 +79,66 @@ name: "basicDeLineform",
prop: "warehouseId",
type: 'select',
width: 200,
dicUrl: "/api/logpm-basicdata/warehouse/dictionary",
dicUrl: "/api/logpm-basic/delinenode/dictionary",
props: {
label: "name",
label: "customer",
value: "id",
},
rules: [{ required: true, message: '请选择仓库!',trigger: 'blur'}],
rules: [{ required: true, message: '请选择客户!',trigger: 'blur'}],
change: (val) => {
if (!!val.value){
getDetailWarehouse(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.form.delinenode[val.index].contacts =res.data.data.linkman
this.form.delinenode[val.index].telephone =res.data.data.contactNumber
this.form.delinenode[val.index].addressNotes =res.data.remarks
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
// if (val.index ==0){
// this.form.lineName =
// }
this.form.lineName = this.form.delinenode[0].warehouseName;
for (let i = 1; i < this.form.delinenode.length; i++) {
this.form.lineName += ("->"+this.form.delinenode[i].warehouseName)
}
// this.form.lineName = this.form.delinenode[0].warehouseName;
// for (let i = 1; i < this.form.delinenode.length; i++) {
// this.form.lineName += ("->"+this.form.delinenode[i].warehouseName)
// }
});
}
},
},{
width: 200,
label: '仓库地址',
prop: "warehouseAddress",
label: '提货地址',
prop: "address",
// disabled:true,
readonly : "true"
readonly : true
},
{
width: 200,
label: '地址备注',
prop: "addressNotes",
// disabled:true,
},
{
width: 200,
label: '联系人',
prop: "contacts",
readonly : "true"
readonly : true
// disabled:true,
},
{
width: 200,
label: '联系电话',
prop: "telephone",
readonly : "true"
readonly : true
// disabled:true,
},{
width: 200,
label: '里程(km)',
prop: "route",
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.lineRoute = 0;
let a = 0;
for (let i = 0; i < this.form.delinenode.length; i++) {
this.form.lineRoute = (this.form.lineRoute*10000 + this.form.delinenode[i].route*10000)/10000
if (!!this.form.delinenode[i].route){a = (a*10000 + this.form.delinenode[i].route*10000)/10000}
}
if (!!this.form.end[0].route){a = (a*10000 + this.form.end[0].route*10000)/10000}
this.form.lineRoute = a;
}
},
},{
@ -150,10 +149,12 @@ name: "basicDeLineform",
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;
let a = 0;
for (let i = 0; i < this.form.delinenode.length; i++) {
this.form.lineAgeing = (this.form.lineAgeing*10000 + this.form.delinenode[i].ageing*10000)/10000
if (!!this.form.delinenode[i]){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}
this.form.lineAgeing = a;
}
},
},
@ -162,41 +163,131 @@ name: "basicDeLineform",
}
},
{
label: '车线编号',
prop: 'lineNumber',
span: 11,
},
{
label: '车线名称',
prop: 'lineName',
span: 11,
readonly : "true"
},
{
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: 'end',
type: 'dynamic',
span: 24,
children: {
index: false,
align: 'center',
column:[
{
label: '',
width: 60,
type: 'button',
},
{
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.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
// if (val.index ==0){
// this.form.lineName =
// }
// this.form.lineName = this.form.linenode[0].warehouseName;
// for (let i = 1; i < this.form.linenode.length; i++) {
// this.form.lineName += ("->"+this.form.linenode[i].warehouseName)
// }
});
}
},
},{
width: 200,
label: '仓库地址',
prop: "warehouseAddress",
readonly : true
},{
width: 200,
label: '联系人',
prop: "warehouseContacts",
readonly : true
},
{
width: 200,
label: '联系电话',
prop: "warehousePhone",
readonly : true
},
{
width: 200,
label: '里程(km)',
prop: "route",
type: 'number',
value:0,
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].route){ a =(a*10000 + this.form.delinenode[i].route*10000)/10000}
}
if (!!this.form.end[0].route){a = (a*10000 + this.form.end[0].route*10000)/10000}
this.form.lineRoute = a;
}
},
},{
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){
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.end[0].lineAgeing){a = (a*10000 + this.form.end[0].lineAgeing*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: '车线总里程',
label: '线总里程',
prop: 'lineRoute',
span: 11,
type: 'number',
readonly : "true"
readonly : true
},
{
label: '车线总时效',
label: '线总时效',
prop: 'lineAgeing',
type: 'number',
span: 11,
readonly : "true"
readonly : true
},
{
label: '备注',

12
src/views/basic/line/basicLineform.vue

@ -110,7 +110,7 @@ name: "basicLineform",
label: '仓库地址',
prop: "warehouseAddress",
// disabled:true,
readonly : "true"
readonly : true
},
{
width: 200,
@ -122,14 +122,14 @@ name: "basicLineform",
width: 200,
label: '联系人',
prop: "contacts",
readonly : "true"
readonly : true
// disabled:true,
},
{
width: 200,
label: '联系电话',
prop: "telephone",
readonly : "true"
readonly : true
// disabled:true,
},{
width: 200,
@ -172,7 +172,7 @@ name: "basicLineform",
label: '车线名称',
prop: 'lineName',
span: 11,
readonly : "true"
readonly : true
},
{
label: '车线类型',
@ -191,14 +191,14 @@ name: "basicLineform",
prop: 'lineRoute',
span: 11,
type: 'number',
readonly : "true"
readonly : true
},
{
label: '车线总时效',
prop: 'lineAgeing',
type: 'number',
span: 11,
readonly : "true"
readonly : true
},
{
label: '备注',

Loading…
Cancel
Save