合并代码
This commit is contained in:
commit
2c6f19b270
@ -148,3 +148,10 @@ export function postCreatePackage(data) {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 获取订单对应的商品列表
|
||||||
|
export function getGoodsListByOrderId(id) {
|
||||||
|
return request({
|
||||||
|
url: `/api/order/${id}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
<div :key="item.prop" style="margin-left:150px;margin-bottom:20px">
|
<div :key="item.prop" style="margin-left:150px;margin-bottom:20px">
|
||||||
<el-button v-if="item.buttontip" size="mini" style="margin-bottom:10px" @click="item.buttonClick">{{ item.buttontip }}
|
<el-button v-if="item.buttontip" size="mini" style="margin-bottom:10px" @click="item.buttonClick">{{ item.buttontip }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-table :data="formModel[item.prop]" border style="width:80%" class="table_item">
|
<el-table :data="formModel[item.prop]" border :style="item.style" class="table_item">
|
||||||
<el-table-column v-for="data in item.tableList" :key="data.prop" :prop="data.prop" :label="data.label">
|
<el-table-column v-for="data in item.tableList" :key="data.prop" :prop="data.prop" :label="data.label">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-form-item v-if="data.isEdit" :prop="item.prop+'.' + scope.$index + '.'+data.prop" :required="false" :rules="data.rules[data.prop]">
|
<el-form-item v-if="data.isEdit" :prop="item.prop+'.' + scope.$index + '.'+data.prop" :required="false" :rules="data.rules[data.prop]">
|
||||||
|
@ -560,6 +560,7 @@ export default {
|
|||||||
startingPoint: 'Starting point:',
|
startingPoint: 'Starting point:',
|
||||||
endingPoint: 'Ending point:',
|
endingPoint: 'Ending point:',
|
||||||
frontSectionMode:'Extend Mode',
|
frontSectionMode:'Extend Mode',
|
||||||
|
lockFirst:'Lock First',
|
||||||
continueProtect: 'Continue protect',
|
continueProtect: 'Continue protect',
|
||||||
continueProtectList: 'Continue protect list'
|
continueProtectList: 'Continue protect list'
|
||||||
};
|
};
|
||||||
|
@ -114,5 +114,7 @@ export default {
|
|||||||
back: 'back',
|
back: 'back',
|
||||||
next: 'next',
|
next: 'next',
|
||||||
transferAttribution: 'Transfer attribution',
|
transferAttribution: 'Transfer attribution',
|
||||||
distributionAttribution: 'Distribution attribution'
|
distributionAttribution: 'Distribution attribution',
|
||||||
|
goodsAmount:'Goods Amount',
|
||||||
|
operate:'operate'
|
||||||
};
|
};
|
||||||
|
@ -554,6 +554,7 @@ export default {
|
|||||||
startingPoint: '起点:',
|
startingPoint: '起点:',
|
||||||
endingPoint: '终点:',
|
endingPoint: '终点:',
|
||||||
frontSectionMode:'延伸方式',
|
frontSectionMode:'延伸方式',
|
||||||
|
lockFirst:'是否先锁闭',
|
||||||
continueProtect: '延续保护',
|
continueProtect: '延续保护',
|
||||||
continueProtectList: '延续保护列表'
|
continueProtectList: '延续保护列表'
|
||||||
};
|
};
|
||||||
|
@ -113,5 +113,7 @@ export default {
|
|||||||
back: '返回',
|
back: '返回',
|
||||||
next: '下一步',
|
next: '下一步',
|
||||||
transferAttribution: '转赠归属',
|
transferAttribution: '转赠归属',
|
||||||
distributionAttribution: '分发归属'
|
distributionAttribution: '分发归属',
|
||||||
|
goodsAmount:'商品个数',
|
||||||
|
operate:'操作'
|
||||||
};
|
};
|
||||||
|
@ -9,11 +9,12 @@ export function getUID(type, list) {
|
|||||||
let name = '';
|
let name = '';
|
||||||
if (type == 'T') {
|
if (type == 'T') {
|
||||||
name = list.length ? Number(list[list.length - 1].code.replace('T', '')) + 1 : list.length + 1;
|
name = list.length ? Number(list[list.length - 1].code.replace('T', '')) + 1 : list.length + 1;
|
||||||
} else if (type == 'W') {
|
|
||||||
name = list.length ? Number(list[list.length - 1].code.replace('W', '')) + 1 : list.length + 1;
|
|
||||||
} else {
|
} else {
|
||||||
name = Math.floor((Math.random() * 100000) + 1);
|
name = Math.floor((Math.random() * 100000) + 1);
|
||||||
}
|
}
|
||||||
|
// else if (type == 'W') {
|
||||||
|
// name = list.length ? Number(list[list.length - 1].code.replace('W', '')) + 1 : list.length + 1;
|
||||||
|
// }
|
||||||
function checkUid() {
|
function checkUid() {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (let index = 0; index < list.length; index++) {
|
for (let index = 0; index < list.length; index++) {
|
||||||
|
@ -14,6 +14,7 @@ import runPlan from './modules/runplan';
|
|||||||
import socket from './modules/socket';
|
import socket from './modules/socket';
|
||||||
import scriptRecord from './modules/scriptRecord';
|
import scriptRecord from './modules/scriptRecord';
|
||||||
import ibp from './modules/ibp';
|
import ibp from './modules/ibp';
|
||||||
|
import order from './modules/order';
|
||||||
|
|
||||||
import getters from './getters';
|
import getters from './getters';
|
||||||
|
|
||||||
@ -34,7 +35,8 @@ const store = new Vuex.Store({
|
|||||||
runPlan,
|
runPlan,
|
||||||
socket,
|
socket,
|
||||||
scriptRecord,
|
scriptRecord,
|
||||||
ibp
|
ibp,
|
||||||
|
order
|
||||||
},
|
},
|
||||||
getters
|
getters
|
||||||
});
|
});
|
||||||
|
28
src/store/modules/order.js
Normal file
28
src/store/modules/order.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* 实训状态数据
|
||||||
|
*/
|
||||||
|
const order = {
|
||||||
|
namespaced: true,
|
||||||
|
state: {
|
||||||
|
orderList: [] // 选中的商品列表,
|
||||||
|
},
|
||||||
|
getters: {
|
||||||
|
orderList: (state)=>{
|
||||||
|
return state.orderList;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
setOrderList: (state, orderList) => {
|
||||||
|
state.orderList = orderList;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
/**
|
||||||
|
* 设置选中的商品列表
|
||||||
|
*/
|
||||||
|
setOrderList: ({ commit }, orderList) => {
|
||||||
|
commit('setOrderList', orderList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
export default order;
|
@ -2,13 +2,13 @@ import { getSessionStorage } from '@/utils/auth';
|
|||||||
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
|
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
|
||||||
import { ProjectCode } from '@/scripts/ConstDic';
|
import { ProjectCode } from '@/scripts/ConstDic';
|
||||||
|
|
||||||
export async function getMapListByProject() {
|
export async function getMapListByProject(drawWay) {
|
||||||
const project = getSessionStorage('project');
|
const project = getSessionStorage('project');
|
||||||
let mapList = [];
|
let mapList = [];
|
||||||
if (project.endsWith('xty')) {
|
if (project.endsWith('xty')) {
|
||||||
mapList = await getMapListByProjectCode(ProjectCode[project]);
|
mapList = await getMapListByProjectCode(ProjectCode[project]);
|
||||||
} else {
|
} else {
|
||||||
mapList = await listPublishMap();
|
mapList = await listPublishMap({'drawWay':drawWay});
|
||||||
}
|
}
|
||||||
return mapList;
|
return mapList;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,8 @@ export default {
|
|||||||
this.lineCodeList = response.data;
|
this.lineCodeList = response.data;
|
||||||
});
|
});
|
||||||
|
|
||||||
getMapListByProject().then(response => {
|
const drawWay = 0;
|
||||||
|
getMapListByProject(drawWay).then(response => {
|
||||||
this.publishMapList = response.data;
|
this.publishMapList = response.data;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
||||||
|
@ -134,7 +134,9 @@ export default {
|
|||||||
this.lineCodeList = response.data;
|
this.lineCodeList = response.data;
|
||||||
});
|
});
|
||||||
|
|
||||||
getMapListByProject().then(response => {
|
// 新地图
|
||||||
|
const drawWay = 1;
|
||||||
|
getMapListByProject(drawWay).then(response => {
|
||||||
this.publishMapList = response.data;
|
this.publishMapList = response.data;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
||||||
|
@ -22,6 +22,13 @@
|
|||||||
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
|
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- 是否先锁闭 -->
|
||||||
|
<el-form-item :label="$t('map.lockFirst') + ':'" prop="lockFirst">
|
||||||
|
<el-radio-group v-model="addModel.lockFirst">
|
||||||
|
<el-radio :label="true">{{ $t('map.are') }}</el-radio>
|
||||||
|
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item :label="$t('map.delayUnlockingTime') + ':'" prop="delayReleaseTime">
|
<el-form-item :label="$t('map.delayUnlockingTime') + ':'" prop="delayReleaseTime">
|
||||||
<el-input-number v-model="addModel.delayReleaseTime" :min="0" />
|
<el-input-number v-model="addModel.delayReleaseTime" :min="0" />
|
||||||
<span>s</span>
|
<span>s</span>
|
||||||
@ -315,6 +322,7 @@ export default {
|
|||||||
stationCode: '', // 所属站台
|
stationCode: '', // 所属站台
|
||||||
arc: false, // 是否自动追踪/联锁自动触发
|
arc: false, // 是否自动追踪/联锁自动触发
|
||||||
flt: false, // 是否车队/联锁自动进路
|
flt: false, // 是否车队/联锁自动进路
|
||||||
|
lockFirst:false, // 是否先锁闭——办理过程直接先锁闭区段
|
||||||
delayReleaseTime: '', // 延时解锁时间
|
delayReleaseTime: '', // 延时解锁时间
|
||||||
turnBack: false, // 是否折返进路
|
turnBack: false, // 是否折返进路
|
||||||
startSignalCode: '', // 始端信号机
|
startSignalCode: '', // 始端信号机
|
||||||
|
@ -14,18 +14,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second">
|
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second">
|
||||||
<div style="height: calc(100% - 46px)">
|
<div style="height: calc(100% - 46px);">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form ref="oprt" :model="createModel" label-width="130px" size="mini" :rules="createRules">
|
<el-form ref="oprt" :model="createModel" label-width="130px" size="mini" :rules="createRules" style="position: relative;">
|
||||||
<el-form-item :label="$t('map.createModel')">
|
<el-form-item :label="$t('map.createModel')">
|
||||||
<el-radio-group v-model="createModel.type">
|
<el-radio-group v-model="createModel.type">
|
||||||
<el-radio
|
<el-radio v-for="item in typeOptions" :key="item.value" :label="item.value" border size="mini">{{ item.label }}</el-radio>
|
||||||
v-for="item in typeOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.value"
|
|
||||||
border
|
|
||||||
size="mini"
|
|
||||||
>{{ item.label }}</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div v-if="createModel.type == '01'" class="coordinate">
|
<div v-if="createModel.type == '01'" class="coordinate">
|
||||||
@ -46,12 +40,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="createModel.type == '03'" :label="$t('map.leftAssociatedSection')" prop="leftSectionCode">
|
<el-form-item v-if="createModel.type == '03'" :label="$t('map.leftAssociatedSection')" prop="leftSectionCode">
|
||||||
<el-select v-model="createModel.leftSectionCode" filterable>
|
<el-select v-model="createModel.leftSectionCode" filterable>
|
||||||
<el-option
|
<el-option v-for="item in PhysicalSectionList" :key="item.code" :label="item.name" :value="item.code" />
|
||||||
v-for="item in PhysicalSectionList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button
|
<el-button
|
||||||
:type="field == 'getSectionStart' ? 'danger' : 'primary'"
|
:type="field == 'getSectionStart' ? 'danger' : 'primary'"
|
||||||
@ -62,14 +51,9 @@
|
|||||||
<el-form-item v-if="createModel.type == '03'" label="距离长度:" prop="length">
|
<el-form-item v-if="createModel.type == '03'" label="距离长度:" prop="length">
|
||||||
<el-input-number v-model="createModel.length" />
|
<el-input-number v-model="createModel.length" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="createModel.type == '02'" :label="$t('map.leftAssociatedSection')" prop="leftSectionCode">
|
<el-form-item v-if="createModel.type == '02' || createModel.type == '04'" label="起始区段:" prop="leftSectionCode">
|
||||||
<el-select v-model="createModel.leftSectionCode" filterable>
|
<el-select v-model="createModel.leftSectionCode" filterable>
|
||||||
<el-option
|
<el-option v-for="item in PhysicalSectionList" :key="item.code" :label="item.name" :value="item.code" />
|
||||||
v-for="item in PhysicalSectionList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button
|
<el-button
|
||||||
:type="field == 'getSectionStart' ? 'danger' : 'primary'"
|
:type="field == 'getSectionStart' ? 'danger' : 'primary'"
|
||||||
@ -92,6 +76,32 @@
|
|||||||
@click="hover('getSectionEnd')"
|
@click="hover('getSectionEnd')"
|
||||||
>{{ $t('map.activate') }}</el-button>
|
>{{ $t('map.activate') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-button
|
||||||
|
v-if="createModel.type == '04'"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
circle
|
||||||
|
size="small"
|
||||||
|
style="position: absolute; right: 50px; top: 85px; z-index: 10;"
|
||||||
|
class="point-button"
|
||||||
|
@click="addModelList"
|
||||||
|
/>
|
||||||
|
<el-table v-if="createModel.type == '04'" :data="createModel.modelList" style="width: 80%; margin: 0 auto;">
|
||||||
|
<el-table-column label="区段名称" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.sectionName" size="mini" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="显示长度">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input-number v-model="scope.row.length" size="mini" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" @click="handleDelete(scope.$index, scope.row)">{{ $t('map.deleteObj') }}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
@ -311,7 +321,8 @@ export default {
|
|||||||
startPoint: { x: 0, y: 0 },
|
startPoint: { x: 0, y: 0 },
|
||||||
length: 0,
|
length: 0,
|
||||||
leftSectionCode: '',
|
leftSectionCode: '',
|
||||||
rightSectionCode: ''
|
rightSectionCode: '',
|
||||||
|
modelList: []
|
||||||
},
|
},
|
||||||
createRules: {
|
createRules: {
|
||||||
'startPoint.x': [
|
'startPoint.x': [
|
||||||
@ -324,17 +335,20 @@ export default {
|
|||||||
{ required: true, message: '请填写距离值', trigger: 'blur' }
|
{ required: true, message: '请填写距离值', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
typeOptions: [{
|
typeOptions: [
|
||||||
value: '01',
|
{
|
||||||
label: this.$t('map.coordinateMode')
|
value: '01',
|
||||||
},
|
label: this.$t('map.coordinateMode')
|
||||||
{
|
}, {
|
||||||
value: '03',
|
value: '03',
|
||||||
label: this.$t('map.frontSectionMode')
|
label: this.$t('map.frontSectionMode')
|
||||||
}, {
|
}, {
|
||||||
value: '02',
|
value: '02',
|
||||||
label: this.$t('map.sectionAssociationMode')
|
label: this.$t('map.sectionAssociationMode')
|
||||||
}
|
}, {
|
||||||
|
value: '04',
|
||||||
|
label: '批量创建'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
oldLeftSectionCode: '',
|
oldLeftSectionCode: '',
|
||||||
oldRightSectionCode: ''
|
oldRightSectionCode: ''
|
||||||
@ -417,7 +431,8 @@ export default {
|
|||||||
{ prop: 'segmentationPosition.x', firstLevel: 'segmentationPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
|
{ prop: 'segmentationPosition.x', firstLevel: 'segmentationPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
|
||||||
{ prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
|
{ prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
|
||||||
] },
|
] },
|
||||||
{ prop: 'isCurve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSwitchSectionType }
|
{ prop: 'isCurve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSwitchSectionType },
|
||||||
|
{ prop: 'relevanceSectionList', label: '关联道岔区段:', type: 'multiSelect', optionLabel: 'name&&code', optionValue: 'code', options: this.switchSectionList, isHidden: this.isSwitchSectionType }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
map: {
|
map: {
|
||||||
@ -516,6 +531,13 @@ export default {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
|
switchSectionList() {
|
||||||
|
let list = [];
|
||||||
|
if (this.sectionList && this.sectionList.length) {
|
||||||
|
list = this.sectionList.filter(elem => { return elem.type === '03'; });
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
},
|
||||||
ReverseSectionList() {
|
ReverseSectionList() {
|
||||||
let list = [];
|
let list = [];
|
||||||
if (this.sectionList && this.sectionList.length) {
|
if (this.sectionList && this.sectionList.length) {
|
||||||
@ -719,14 +741,21 @@ export default {
|
|||||||
this.editModel.points.splice(index, 1);
|
this.editModel.points.splice(index, 1);
|
||||||
this.logicSectionNums.splice(index, 1);
|
this.logicSectionNums.splice(index, 1);
|
||||||
},
|
},
|
||||||
// 创建区段
|
addModelList() {
|
||||||
create() {
|
const param = {
|
||||||
const uid = getUID('T', this.sectionList);
|
sectionName: 'T',
|
||||||
const uname = 'T' + (Number(this.sectionList.length) + 1);
|
length: ''
|
||||||
const model = {
|
};
|
||||||
|
this.createModel.modelList.push(param);
|
||||||
|
},
|
||||||
|
handleDelete(index, row) { // 删除创建表格元素
|
||||||
|
this.createModel.modelList.splice(index, 1);
|
||||||
|
},
|
||||||
|
createModelParam(uid, name) {
|
||||||
|
return {
|
||||||
_type: 'Section',
|
_type: 'Section',
|
||||||
code: uid,
|
code: uid,
|
||||||
name: uname,
|
name: name,
|
||||||
type: '01',
|
type: '01',
|
||||||
axleShow: false,
|
axleShow: false,
|
||||||
isStandTrack: false,
|
isStandTrack: false,
|
||||||
@ -742,8 +771,8 @@ export default {
|
|||||||
isSegmentation: false,
|
isSegmentation: false,
|
||||||
segmentationPosition: { x: 0, y: 0 },
|
segmentationPosition: { x: 0, y: 0 },
|
||||||
relSwitchCode: '',
|
relSwitchCode: '',
|
||||||
rightSectionCode:'',
|
rightSectionCode: '',
|
||||||
leftSectionCode:'',
|
leftSectionCode: '',
|
||||||
kmRangeRight: '',
|
kmRangeRight: '',
|
||||||
kmRangeLeft: '',
|
kmRangeLeft: '',
|
||||||
region: '',
|
region: '',
|
||||||
@ -764,67 +793,112 @@ export default {
|
|||||||
trainWindowCode: '',
|
trainWindowCode: '',
|
||||||
destinationCodePoint: { x: 0, y: 0 },
|
destinationCodePoint: { x: 0, y: 0 },
|
||||||
isCurve: false,
|
isCurve: false,
|
||||||
relevanceSectionList: []
|
relevanceSectionList: [],
|
||||||
|
points: []
|
||||||
};
|
};
|
||||||
if (this.createModel.type == '01') {
|
},
|
||||||
model.points = [
|
// 创建区段
|
||||||
{ x: this.createModel.startPoint.x, y: this.createModel.startPoint.y },
|
create() {
|
||||||
{ x: this.createModel.startPoint.x + this.createModel.length, y: this.createModel.startPoint.y }
|
if (this.createModel.type == '04') {
|
||||||
];
|
|
||||||
this.$emit('updateMapModel', model);
|
|
||||||
} else if (this.createModel.type == '02') {
|
|
||||||
if (!(this.createModel.leftSectionCode && this.createModel.rightSectionCode)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
|
|
||||||
const endModel = this.$store.getters['map/getDeviceByCode'](this.createModel.rightSectionCode);
|
|
||||||
|
|
||||||
const start_x = startModel.points[startModel.points.length - 1].x;
|
|
||||||
const end_x = endModel.points[0].x;
|
|
||||||
const start_y = startModel.points[startModel.points.length - 1].y;
|
|
||||||
const end_y = endModel.points[0].y;
|
|
||||||
if (this.createModel.leftSectionCode == this.createModel.rightSectionCode) {
|
|
||||||
this.$messageBox('左关联区段不能和右关联区段相同');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (start_x == end_x && start_y == end_y) {
|
|
||||||
this.$messageBox('左关联区段终点不能和右关联区段起点相同');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
model.points = [
|
|
||||||
{ x: start_x, y: start_y },
|
|
||||||
{ x: end_x, y: end_y }
|
|
||||||
];
|
|
||||||
const models = [];
|
const models = [];
|
||||||
const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
|
let flag = true;
|
||||||
const rightSection = this.getSectionByCode(this.createModel.rightSectionCode);
|
let leftPointX = 0; let rightPointX = 0;
|
||||||
model.leftSectionCode = this.createModel.leftSectionCode;
|
const startModel = this.getSectionByCode(this.createModel.leftSectionCode);
|
||||||
leftSection.rightSectionCode = model.code;
|
this.createModel.modelList.forEach((item, index) => {
|
||||||
rightSection.leftSectionCode = model.code;
|
if (item.length && item.sectionName) {
|
||||||
model.rightSectionCode = this.createModel.rightSectionCode;
|
let param = {};
|
||||||
models.push(model);
|
const uid = getUID('T', [...this.sectionList, ...models]);
|
||||||
models.push(leftSection);
|
rightPointX += item.length;
|
||||||
models.push(rightSection);
|
if (index != 0) {
|
||||||
this.$emit('updateMapModel', models);
|
leftPointX += this.createModel.modelList[index - 1].length;
|
||||||
} else if (this.createModel.type == '03') {
|
}
|
||||||
if (this.createModel.leftSectionCode) {
|
param = this.createModelParam(uid, item.sectionName);
|
||||||
|
param.points = [
|
||||||
|
{ x: startModel.points[startModel.points.length - 1].x + leftPointX, y: startModel.points[startModel.points.length - 1].y },
|
||||||
|
{ x: startModel.points[startModel.points.length - 1].x + rightPointX, y: startModel.points[startModel.points.length - 1].y }
|
||||||
|
];
|
||||||
|
if (index == 0) {
|
||||||
|
param.leftSectionCode = this.createModel.leftSectionCode;
|
||||||
|
startModel.rightSectionCode = param.code;
|
||||||
|
} else {
|
||||||
|
param.leftSectionCode = models[index - 1].code;
|
||||||
|
models[index - 1].rightSectionCode = param.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
models.push(param);
|
||||||
|
} else {
|
||||||
|
flag = false;
|
||||||
|
this.$message('表格内容必须填写,请检查后再重新创建!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (flag) {
|
||||||
|
models.push(startModel);
|
||||||
|
this.$emit('updateMapModel', models);
|
||||||
|
this.createModel.modelList = [];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const uid = getUID('T', this.sectionList);
|
||||||
|
const uname = 'T' + (Number(this.sectionList.length) + 1);
|
||||||
|
const model = this.createModelParam(uid, uname);
|
||||||
|
if (this.createModel.type == '01') {
|
||||||
|
model.points = [
|
||||||
|
{ x: this.createModel.startPoint.x, y: this.createModel.startPoint.y },
|
||||||
|
{ x: this.createModel.startPoint.x + this.createModel.length, y: this.createModel.startPoint.y }
|
||||||
|
];
|
||||||
|
this.$emit('updateMapModel', model);
|
||||||
|
} else if (this.createModel.type == '02') {
|
||||||
|
if (!(this.createModel.leftSectionCode && this.createModel.rightSectionCode)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
|
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
|
||||||
|
const endModel = this.$store.getters['map/getDeviceByCode'](this.createModel.rightSectionCode);
|
||||||
|
|
||||||
const start_x = startModel.points[startModel.points.length - 1].x;
|
const start_x = startModel.points[startModel.points.length - 1].x;
|
||||||
|
const end_x = endModel.points[0].x;
|
||||||
const start_y = startModel.points[startModel.points.length - 1].y;
|
const start_y = startModel.points[startModel.points.length - 1].y;
|
||||||
|
const end_y = endModel.points[0].y;
|
||||||
|
if (this.createModel.leftSectionCode == this.createModel.rightSectionCode) {
|
||||||
|
this.$messageBox('左关联区段不能和右关联区段相同');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (start_x == end_x && start_y == end_y) {
|
||||||
|
this.$messageBox('左关联区段终点不能和右关联区段起点相同');
|
||||||
|
return;
|
||||||
|
}
|
||||||
model.points = [
|
model.points = [
|
||||||
{ x: start_x, y: start_y },
|
{ x: start_x, y: start_y },
|
||||||
{ x: start_x + this.createModel.length, y: start_y }
|
{ x: end_x, y: end_y }
|
||||||
];
|
];
|
||||||
const models = [];
|
const models = [];
|
||||||
model.leftSectionCode = this.createModel.leftSectionCode;
|
|
||||||
const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
|
const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
|
||||||
|
const rightSection = this.getSectionByCode(this.createModel.rightSectionCode);
|
||||||
|
model.leftSectionCode = this.createModel.leftSectionCode;
|
||||||
leftSection.rightSectionCode = model.code;
|
leftSection.rightSectionCode = model.code;
|
||||||
|
rightSection.leftSectionCode = model.code;
|
||||||
|
model.rightSectionCode = this.createModel.rightSectionCode;
|
||||||
models.push(model);
|
models.push(model);
|
||||||
models.push(leftSection);
|
models.push(leftSection);
|
||||||
|
models.push(rightSection);
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
|
} else if (this.createModel.type == '03') {
|
||||||
|
if (this.createModel.leftSectionCode) {
|
||||||
|
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
|
||||||
|
const start_x = startModel.points[startModel.points.length - 1].x;
|
||||||
|
const start_y = startModel.points[startModel.points.length - 1].y;
|
||||||
|
model.points = [
|
||||||
|
{ x: start_x, y: start_y },
|
||||||
|
{ x: start_x + this.createModel.length, y: start_y }
|
||||||
|
];
|
||||||
|
const models = [];
|
||||||
|
model.leftSectionCode = this.createModel.leftSectionCode;
|
||||||
|
const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
|
||||||
|
leftSection.rightSectionCode = model.code;
|
||||||
|
models.push(model);
|
||||||
|
models.push(leftSection);
|
||||||
|
this.$emit('updateMapModel', models);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 修改区段属性
|
// 修改区段属性
|
||||||
edit() {
|
edit() {
|
||||||
@ -1161,9 +1235,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.el-radio{
|
|
||||||
margin-right:0px;
|
|
||||||
}
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@ -1215,5 +1286,14 @@ export default {
|
|||||||
padding: 18px 0;
|
padding: 18px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/deep/ {
|
||||||
|
.el-radio.is-bordered+.el-radio.is-bordered{
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
.el-radio.is-bordered {
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -479,53 +479,55 @@ export default {
|
|||||||
const models = [];
|
const models = [];
|
||||||
const switchList = [...this.switchList, ...list];
|
const switchList = [...this.switchList, ...list];
|
||||||
if (list && list.length && sectionLists && sectionLists.length) {
|
if (list && list.length && sectionLists && sectionLists.length) {
|
||||||
const sectionList = [];
|
const sectionList = []; const addSectionList = []; const switchSectionList = [];
|
||||||
const addSectionList = [];
|
|
||||||
list.forEach(elem => {
|
list.forEach(elem => {
|
||||||
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
|
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
|
||||||
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
|
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
|
||||||
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
|
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
|
||||||
const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
|
const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
|
||||||
if (!parentSectionModel) { // 找不到父元素删除
|
if (!parentSectionModel) { // 找不到父元素删除
|
||||||
let uid;
|
if (switchSectionList.indexOf(elem.code) == -1) {
|
||||||
if (!elem['uid']) {
|
let uid;
|
||||||
uid = getUID('T', [...this.sectionList, ...addSectionList]);
|
if (!elem['uid']) {
|
||||||
elem['uid'] = uid;
|
uid = getUID('T', [...this.sectionList, ...addSectionList]);
|
||||||
|
elem['uid'] = uid;
|
||||||
|
}
|
||||||
|
addSectionList.push({ code: elem.uid });
|
||||||
|
sectiona.parentCode = elem['uid'];
|
||||||
|
sectionb.parentCode = elem['uid'];
|
||||||
|
sectionc.parentCode = elem['uid'];
|
||||||
|
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode];
|
||||||
|
sectionList.push(elem);
|
||||||
|
switchList.forEach(ele => {
|
||||||
|
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
||||||
|
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
|
||||||
|
const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
|
||||||
|
if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
|
||||||
|
ele['uid'] = uid;
|
||||||
|
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
||||||
|
sectiona1.parentCode = uid;
|
||||||
|
sectionb1.parentCode = uid;
|
||||||
|
sectionc1.parentCode = uid;
|
||||||
|
switchSectionList.push(ele.code);
|
||||||
|
sectionList.forEach((item, index) => {
|
||||||
|
if (item.code == ele.code) {
|
||||||
|
sectionList.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// if (sectiona1.points[sectiona1.points.length - 1].x == sectiona.points[0].x && sectiona1.points[sectiona1.points.length - 1].y == sectiona.points[0].y) {
|
||||||
|
// elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
||||||
|
// sectiona1.parentCode = uid;
|
||||||
|
// sectionb1.parentCode = uid;
|
||||||
|
// sectionc1.parentCode = uid;
|
||||||
|
// sectionList.forEach((item, index) => {
|
||||||
|
// if (item.code == elem.code) {
|
||||||
|
// sectionList.splice(index, 1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
addSectionList.push({ code: elem.uid });
|
|
||||||
sectiona.parentCode = elem['uid'];
|
|
||||||
sectionb.parentCode = elem['uid'];
|
|
||||||
sectionc.parentCode = elem['uid'];
|
|
||||||
elem['relevanceSectionList'] = elem['relevanceSectionList'] || [elem.sectionACode, elem.sectionBCode, elem.sectionCCode];
|
|
||||||
sectionList.push(elem);
|
|
||||||
switchList.forEach(ele => {
|
|
||||||
const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
|
|
||||||
const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
|
|
||||||
const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
|
|
||||||
if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
|
|
||||||
ele['uid'] = uid;
|
|
||||||
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
|
||||||
sectiona1.parentCode = uid;
|
|
||||||
sectionb1.parentCode = uid;
|
|
||||||
sectionc1.parentCode = uid;
|
|
||||||
sectionList.forEach((item, index) => {
|
|
||||||
if (item.code == elem.code) {
|
|
||||||
sectionList.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (sectiona1.points[sectiona1.points.length - 1].x == sectiona.points[0].x && sectiona1.points[sectiona1.points.length - 1].y == sectiona.points[0].y) {
|
|
||||||
elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
|
|
||||||
sectiona1.parentCode = uid;
|
|
||||||
sectionb1.parentCode = uid;
|
|
||||||
sectionc1.parentCode = uid;
|
|
||||||
sectionList.forEach((item, index) => {
|
|
||||||
if (item.code == elem.code) {
|
|
||||||
sectionList.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
parentSectionModel.relevanceSectionList.push(elem.sectionACode);
|
parentSectionModel.relevanceSectionList.push(elem.sectionACode);
|
||||||
parentSectionModel.relevanceSectionList.push(elem.sectionBCode);
|
parentSectionModel.relevanceSectionList.push(elem.sectionBCode);
|
||||||
|
@ -122,19 +122,38 @@ export default {
|
|||||||
name: this.$t('global.append'),
|
name: this.$t('global.append'),
|
||||||
handleClick: this.handlePut,
|
handleClick: this.handlePut,
|
||||||
type: '',
|
type: '',
|
||||||
showControl: (row) => { return !row.isPut; }
|
showControl: (row) => {
|
||||||
|
const orderList = this.$store.state.order.orderList;
|
||||||
|
if (orderList.length > 0) {
|
||||||
|
const order = orderList.find(item=>{ return item.goodsId == row.id; });
|
||||||
|
if (order) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return !row.isPut;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: this.$t('global.delete'),
|
name: this.$t('global.delete'),
|
||||||
handleClick: this.handlePop,
|
handleClick: this.handlePop,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
showControl: (row) => { return row.isPut; }
|
showControl: (row) => {
|
||||||
|
const orderList = this.$store.state.order.orderList;
|
||||||
|
if (orderList.length > 0) {
|
||||||
|
const order = orderList.find(item=>{ return item.goodsId == row.id; });
|
||||||
|
if (order) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return row.isPut;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// name: this.$t('orderAuthor.select'),
|
|
||||||
// type: 'primary',
|
|
||||||
// handleClick: this.handleAdd
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -1,89 +1,61 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-dialogDrag :title="this.$t('orderAuthor.orderDetails')" :visible.sync="show" width="500px" :before-do-close="doClose" :close-on-click-modal="false">
|
<el-dialog v-dialogDrag :title="this.$t('orderAuthor.orderDetails')" :visible.sync="show" width="1000px" :before-do-close="doClose" :close-on-click-modal="false">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" style="height: 400px">
|
<el-table
|
||||||
<data-form ref="dataform" :form="form" :form-model="formModel" class="data-box" />
|
ref="table2"
|
||||||
</el-scrollbar>
|
highlight-current-row
|
||||||
<div slot="footer" class="dialog-footer">
|
stripe
|
||||||
<el-button type="primary" @click="doClose">{{ $t('global.close') }}</el-button>
|
border
|
||||||
</div>
|
:data="orderList"
|
||||||
|
size="medium"
|
||||||
|
>
|
||||||
|
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.commodityName')" prop="goodsName" />
|
||||||
|
<el-table-column :key="forever" :label="this.$t('orderAuthor.permanenceOrNot')" prop="forever">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ $ConstSelect.translate(scope.row.forever, 'Whether') }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.goodsAmount')" prop="goodsAmount" />
|
||||||
|
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.itemPricing')" prop="price" />
|
||||||
|
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.startDate')" prop="startTime" />
|
||||||
|
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.purchaseMonths')" prop="monthAmount">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.forever?'/':scope.row.monthAmount }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getGoodsListByOrderId } from '@/api/management/goods';
|
||||||
export default {
|
export default {
|
||||||
name: 'RouteDetail',
|
name: 'RouteDetail',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
show: false,
|
||||||
formModel: {
|
orderId:'',
|
||||||
organizationName: '',
|
orderList:[]
|
||||||
userName: '',
|
|
||||||
goodsName: '',
|
|
||||||
amount: '',
|
|
||||||
forever: '',
|
|
||||||
startTime: '',
|
|
||||||
monthAmount: '',
|
|
||||||
totalPrice: '',
|
|
||||||
payWays: '',
|
|
||||||
createTime: '',
|
|
||||||
orderType: '',
|
|
||||||
contractNo: '',
|
|
||||||
bizType: '',
|
|
||||||
payStatusZh: '',
|
|
||||||
sellerName: ''
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
form() {
|
|
||||||
const form = {
|
|
||||||
labelWidth: '120px',
|
|
||||||
items: [
|
|
||||||
{ prop: 'organizationName', label: `${this.$t('orderAuthor.organizationOrEnterprise')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'userName', label: `${this.$t('orderAuthor.userName')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'goodsName', label: `${this.$t('orderAuthor.commodityName')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'amount', label: `${this.$t('orderAuthor.permissionNumber')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'forever', label: `${this.$t('orderAuthor.permanenceOrNot')}:`, type: 'radio', disabled: true, required: false, options: this.$ConstSelect.Whether },
|
|
||||||
{ prop: 'startTime', label: `${this.$t('orderAuthor.startDate')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'monthAmount', label: `${this.$t('orderAuthor.purchaseMonths')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'totalPrice', label: `${this.$t('orderAuthor.totalPrice')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'payWays', label: `${this.$t('orderAuthor.paymentMethod')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'createTime', label: `${this.$t('orderAuthor.creationDate')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'orderType', label: `${this.$t('orderAuthor.orderType')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'contractNo', label: `${this.$t('orderAuthor.contractNumber')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'bizType', label: `${this.$t('orderAuthor.businessType')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'payStatusZh', label: `${this.$t('orderAuthor.paymentStatus')}:`, type: 'text', disabled: true },
|
|
||||||
{ prop: 'sellerName', label: `${this.$t('orderAuthor.salesman')}:`, type: 'text', disabled: true }
|
|
||||||
]
|
|
||||||
|
|
||||||
};
|
|
||||||
return form;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
doShow(data) {
|
doShow(data) {
|
||||||
|
this.orderId = data.id;
|
||||||
|
this.reloadTable();
|
||||||
this.show = true;
|
this.show = true;
|
||||||
this.formModel = {
|
|
||||||
organizationName: data.organizationName,
|
|
||||||
userName: data.userName,
|
|
||||||
goodsName: data.goodsName,
|
|
||||||
amount: data.amount,
|
|
||||||
forever: data.forever,
|
|
||||||
startTime: data.startTime,
|
|
||||||
monthAmount: data.monthAmount,
|
|
||||||
totalPrice: data.totalPrice,
|
|
||||||
payWays: data.payWays,
|
|
||||||
createTime: data.createTime,
|
|
||||||
orderType: data.orderType,
|
|
||||||
contractNo: data.contractNo,
|
|
||||||
bizType: data.bizType,
|
|
||||||
payStatusZh: data.payStatusZh,
|
|
||||||
sellerName: data.sellerName
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
|
},
|
||||||
|
reloadTable() {
|
||||||
|
if (this.orderId) {
|
||||||
|
this.initData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initData() {
|
||||||
|
getGoodsListByOrderId(this.orderId).then(res=>{
|
||||||
|
this.orderList = res.data;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -57,14 +57,10 @@ export default {
|
|||||||
errorIntTip:'数量必须为整数',
|
errorIntTip:'数量必须为整数',
|
||||||
formModel: {
|
formModel: {
|
||||||
organizationId: '',
|
organizationId: '',
|
||||||
goodsId: '',
|
|
||||||
goodsName: '',
|
|
||||||
orderType: '02',
|
orderType: '02',
|
||||||
contractNo: '',
|
contractNo: '',
|
||||||
forever: false,
|
forever: false,
|
||||||
totalPrice: 0,
|
totalPrice: 0,
|
||||||
price: 0,
|
|
||||||
amount: 0,
|
|
||||||
monthAmount: 0,
|
monthAmount: 0,
|
||||||
bizType: '01',
|
bizType: '01',
|
||||||
payWays: '01',
|
payWays: '01',
|
||||||
@ -161,9 +157,10 @@ export default {
|
|||||||
buttontip: this.$t('orderAuthor.selectGoods'),
|
buttontip: this.$t('orderAuthor.selectGoods'),
|
||||||
buttonClick: this.buttonClick,
|
buttonClick: this.buttonClick,
|
||||||
type:'table',
|
type:'table',
|
||||||
|
style:'width:80%',
|
||||||
tableList:[
|
tableList:[
|
||||||
{prop:'goodsName', label:'商品名称' },
|
{prop:'goodsName', label:this.$t('orderAuthor.commodityName') },
|
||||||
{prop:'goodsAmount', label:'商品数量', isEdit:true, min:0,
|
{prop:'goodsAmount', label:this.$t('orderAuthor.goodsAmount'), isEdit:true, min:0,
|
||||||
rules:{
|
rules:{
|
||||||
goodsAmount:[
|
goodsAmount:[
|
||||||
{
|
{
|
||||||
@ -177,11 +174,11 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{prop:'goodsPrice', label:'商品单价'}
|
{prop:'goodsPrice', label:this.$t('orderAuthor.itemPricing')}
|
||||||
],
|
],
|
||||||
operate:'操作',
|
operate:this.$t('orderAuthor.operate'),
|
||||||
operateButton:[
|
operateButton:[
|
||||||
{name:'删除', clickFunc:this.removeGoods}
|
{name:this.$t('global.delete'), clickFunc:this.removeGoods}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// { prop: 'price', label: this.$t('orderAuthor.itemPricing'), type: 'number', required: false, disabled: true, min: 0, message: this.$t('orderAuthor.yuan') },
|
// { prop: 'price', label: this.$t('orderAuthor.itemPricing'), type: 'number', required: false, disabled: true, min: 0, message: this.$t('orderAuthor.yuan') },
|
||||||
@ -295,6 +292,9 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.initLoadPage();
|
this.initLoadPage();
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.$store.dispatch('order/setOrderList', []);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick() {
|
buttonClick() {
|
||||||
this.$refs.addGoods.doShow();
|
this.$refs.addGoods.doShow();
|
||||||
@ -318,12 +318,15 @@ export default {
|
|||||||
'goodsPrice':row.price
|
'goodsPrice':row.price
|
||||||
};
|
};
|
||||||
this.formModel.detailCreateVOList.push(data);
|
this.formModel.detailCreateVOList.push(data);
|
||||||
|
this.$store.dispatch('order/setOrderList', this.formModel.detailCreateVOList);
|
||||||
},
|
},
|
||||||
removeGoods(data) {
|
removeGoods(data) {
|
||||||
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== data.goodsId);
|
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== data.goodsId);
|
||||||
|
this.$store.dispatch('order/setOrderList', this.formModel.detailCreateVOList);
|
||||||
},
|
},
|
||||||
deleteGoods(index, row) {
|
deleteGoods(index, row) {
|
||||||
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== row.id);
|
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== row.id);
|
||||||
|
this.$store.dispatch('order/setOrderList', this.formModel.detailCreateVOList);
|
||||||
},
|
},
|
||||||
initLoadPage() {
|
initLoadPage() {
|
||||||
// 加载字典数据
|
// 加载字典数据
|
||||||
@ -519,6 +522,7 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
createOrder(this.buildModel()).then(response => {
|
createOrder(this.buildModel()).then(response => {
|
||||||
this.turnback();
|
this.turnback();
|
||||||
|
this.$store.dispatch('order/setOrderList', []);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.$message.success(this.$t('tip.creatingSuccessful'));
|
this.$message.success(this.$t('tip.creatingSuccessful'));
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -542,6 +546,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
turnback() {
|
turnback() {
|
||||||
|
this.$store.dispatch('order/setOrderList', []);
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,10 +74,6 @@ export default {
|
|||||||
title: this.$t('orderAuthor.userMobile'),
|
title: this.$t('orderAuthor.userMobile'),
|
||||||
prop: 'userMobile'
|
prop: 'userMobile'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: this.$t('orderAuthor.commodityName'),
|
|
||||||
prop: 'goodsName'
|
|
||||||
},
|
|
||||||
// {
|
// {
|
||||||
// title: this.$t('orderAuthor.permissionType'),
|
// title: this.$t('orderAuthor.permissionType'),
|
||||||
// prop: 'permissionType',
|
// prop: 'permissionType',
|
||||||
@ -85,10 +81,10 @@ export default {
|
|||||||
// columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
|
// columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
|
||||||
// tagType: (row) => { return ''; }
|
// tagType: (row) => { return ''; }
|
||||||
// },
|
// },
|
||||||
{
|
// {
|
||||||
title: this.$t('orderAuthor.permissionNumber'),
|
// title: this.$t('orderAuthor.permissionNumber'),
|
||||||
prop: 'amount'
|
// prop: 'amount'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: this.$t('orderAuthor.permanenceOrNot'),
|
title: this.$t('orderAuthor.permanenceOrNot'),
|
||||||
prop: 'forever',
|
prop: 'forever',
|
||||||
@ -106,7 +102,12 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('orderAuthor.purchaseMonths'),
|
title: this.$t('orderAuthor.purchaseMonths'),
|
||||||
prop: 'monthAmount'
|
prop: 'monthAmount',
|
||||||
|
type: 'tag',
|
||||||
|
columnValue: (row) => {
|
||||||
|
return row.forever ? '/' : row.monthAmount;
|
||||||
|
},
|
||||||
|
tagType: (row) => { return ''; }
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: this.$t('orderAuthor.totalPrice'),
|
// title: this.$t('orderAuthor.totalPrice'),
|
||||||
@ -246,10 +247,6 @@ export default {
|
|||||||
this.$router.push({ path: `${UrlConfig.orderauthor.orderDraft}/add/0` });
|
this.$router.push({ path: `${UrlConfig.orderauthor.orderDraft}/add/0` });
|
||||||
},
|
},
|
||||||
handleDetail(index, data) {
|
handleDetail(index, data) {
|
||||||
data.payWays = this.$convertField(data.payWays, this.PayTypeList, ['value', 'label']);
|
|
||||||
data.orderType = this.$convertField(data.orderType, this.OrderTypeList, ['value', 'label']);
|
|
||||||
data.bizType = this.$convertField(data.bizType, this.BizTypeList, ['value', 'label']);
|
|
||||||
data.payStatusZh = this.$convertField(data.payStatus, this.PayStatusList, ['value', 'label']);
|
|
||||||
this.$refs.detail.doShow(data);
|
this.$refs.detail.doShow(data);
|
||||||
},
|
},
|
||||||
handleCanDistribute(index, data) {
|
handleCanDistribute(index, data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user