Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
This commit is contained in:
commit
586d7a23e5
@ -232,6 +232,35 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-else-if="checkFieldType(item, 'table')">
|
||||
<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>
|
||||
<el-table :data="formModel[item.prop]" border style="width:80%" class="table_item">
|
||||
<el-table-column v-for="data in item.tableList" :key="data.prop" :prop="data.prop" :label="data.label">
|
||||
<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-input-number
|
||||
v-model="scope.row[data.prop]"
|
||||
:min="isNaN(data.min) ? -Infinity : data.min"
|
||||
:max="isNaN(data.max)? Infinity : data.max"
|
||||
size="mini"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div v-else>
|
||||
{{ scope.row[data.prop] }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="item.operate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-for="buttonObj in item.operateButton" :key="buttonObj.name" type="text" size="small" @click="buttonObj.clickFunc(scope.row)">{{ buttonObj.name }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</el-form>
|
||||
</template>
|
||||
@ -286,8 +315,16 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<style lang="scss">
|
||||
.el-input__inner.el-range-editor {
|
||||
width: 100%;
|
||||
}
|
||||
.table_item {
|
||||
.el-form-item__content{
|
||||
margin-left:0px !important;
|
||||
.el-input-number{
|
||||
width:100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -253,6 +253,7 @@ export default {
|
||||
isCurve: false,
|
||||
leftSectionCode: '',
|
||||
rightSectionCode: '',
|
||||
trainWindowCode: '',
|
||||
relevanceSectionList: []
|
||||
},
|
||||
oldPoint: [], // 区段未修改前 坐标
|
||||
@ -604,7 +605,6 @@ export default {
|
||||
this.updateRelevantData();
|
||||
},
|
||||
methods: {
|
||||
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
@ -747,6 +747,7 @@ export default {
|
||||
rightStopPointOffset: 0,
|
||||
leftStopPointOffset: 0,
|
||||
destinationCode: '',
|
||||
trainWindowCode: '',
|
||||
destinationCodePoint: { x: 0, y: 0 },
|
||||
isCurve: false,
|
||||
relevanceSectionList: []
|
||||
@ -952,6 +953,7 @@ export default {
|
||||
isSegmentation: false,
|
||||
segmentationPosition: { x: 0, y: 0 },
|
||||
relSwitchCode: '',
|
||||
trainWindowCode: '',
|
||||
logicSectionNameSort: selected.logicSectionNameSort,
|
||||
logicSectionNum: selected.logicSectionNum,
|
||||
logicSectionShow: selected.logicSectionShow,
|
||||
@ -1052,6 +1054,7 @@ export default {
|
||||
kmRangeRight: '',
|
||||
kmRangeLeft: '',
|
||||
region: '',
|
||||
trainWindowCode: '',
|
||||
relevanceSectionList: []
|
||||
};
|
||||
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true }));
|
||||
|
@ -59,7 +59,6 @@ export default {
|
||||
},
|
||||
width: 0,
|
||||
height: 0,
|
||||
sectionCode: '',
|
||||
isReversal: false
|
||||
},
|
||||
rules: {
|
||||
@ -77,17 +76,14 @@ export default {
|
||||
],
|
||||
height: [
|
||||
{ required: true, message: this.$t('rules.trainWindowHeight'), trigger: 'blur' }
|
||||
],
|
||||
sectionCode: [
|
||||
{ required: true, message: this.$t('rules.trainWindowSectionCode'), trigger: 'change' }
|
||||
]
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'switchList',
|
||||
'trainWindowList'
|
||||
]),
|
||||
filterSectionList() {
|
||||
@ -120,7 +116,6 @@ export default {
|
||||
map: {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ prop: 'sectionCode', label: this.$t('map.trainWindowSectionCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.filterSectionList },
|
||||
{ prop: 'isReversal', label: '车头翻转', type: 'checkbox' }
|
||||
]
|
||||
}
|
||||
@ -205,7 +200,6 @@ export default {
|
||||
model.point.x = model.point.x + offsetx;
|
||||
model.point.y = model.point.y + offsety;
|
||||
}
|
||||
model.sectionCode = section.code;
|
||||
model.height = height;
|
||||
model.width = width;
|
||||
}
|
||||
@ -237,9 +231,9 @@ export default {
|
||||
// 一键创建车次窗
|
||||
createTrainWindow() {
|
||||
const models = [];
|
||||
const switchSectionList = [];
|
||||
// const PhysicalSectionList = [];
|
||||
this.addList = [];
|
||||
const collection = this.sectionList;
|
||||
|
||||
const remove = []; // 清空所有车次窗
|
||||
if (this.trainWindowList && this.trainWindowList.length) {
|
||||
this.trainWindowList.forEach(elem => {
|
||||
@ -252,26 +246,46 @@ export default {
|
||||
this.$emit('updateMapModel', remove);
|
||||
}
|
||||
|
||||
if (collection && collection.length) {
|
||||
collection.forEach(elem => {
|
||||
if (elem.type !== '04' && !elem.isSwitchSection && (
|
||||
elem.logicSectionNum.length == 0 || elem.logicSectionNum.length == 1 && elem.logicSectionNum[0] == 0)) {
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.type !== '04' && !elem.isSwitchSection && (elem.logicSectionNum.length == 0 || elem.logicSectionNum.length == 1 && elem.logicSectionNum[0] == 0)) {
|
||||
const triangle = new JTriangle(elem.points[0], elem.points[elem.points.length - 1]);
|
||||
const param = this.createModel({
|
||||
triangle: triangle,
|
||||
section: elem
|
||||
});
|
||||
models.push(param);
|
||||
const section = deepAssign(elem, { trainWindowCode: param.code });
|
||||
// if (section.type == '02') {
|
||||
// if (!switchSectionList.find(ele => { return ele.code == section.parentCode; })) {
|
||||
// const sectionParent = deepAssign({}, this.$store.getters['map/getDeviceByCode'](section.parentCode));
|
||||
// sectionParent['trainWindowCode'] = section.trainWindowCode;
|
||||
// switchSectionList.push(sectionParent);
|
||||
// }
|
||||
// }
|
||||
switchSectionList.push(section);
|
||||
this.addList.push(param);
|
||||
} else if (elem.type === '04' && elem.isSwitchSection) {
|
||||
} else if (elem.type === '04') {
|
||||
const param = this.createModel({
|
||||
section: elem
|
||||
});
|
||||
models.push(param);
|
||||
const section = deepAssign(elem, { trainWindowCode: param.code });
|
||||
switchSectionList.push(section);
|
||||
this.addList.push(param);
|
||||
}
|
||||
});
|
||||
}
|
||||
switchSectionList.forEach(elem => {
|
||||
if (elem.type === '04') {
|
||||
elem.relevanceSectionList.forEach(item => {
|
||||
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item));
|
||||
section['trainWindowCode'] = elem.trainWindowCode;
|
||||
models.push(section);
|
||||
});
|
||||
}
|
||||
models.push(elem);
|
||||
});
|
||||
|
||||
this.$emit('updateMapModel', models);
|
||||
},
|
||||
|
@ -90,7 +90,7 @@ export default {
|
||||
title: this.$t('orderAuthor.belongsToMap'),
|
||||
prop: 'mapName',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.mapName },
|
||||
columnValue: (row) => { return row.mapName; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
@ -119,10 +119,22 @@ export default {
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('orderAuthor.select'),
|
||||
type: 'primary',
|
||||
handleClick: this.handleAdd
|
||||
name: this.$t('global.append'),
|
||||
handleClick: this.handlePut,
|
||||
type: '',
|
||||
showControl: (row) => { return !row.isPut; }
|
||||
},
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handlePop,
|
||||
type: 'warning',
|
||||
showControl: (row) => { return row.isPut; }
|
||||
}
|
||||
// {
|
||||
// name: this.$t('orderAuthor.select'),
|
||||
// type: 'primary',
|
||||
// handleClick: this.handleAdd
|
||||
// }
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -163,9 +175,20 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
handleAdd(index, row) {
|
||||
this.$emit('selectGoods', row);
|
||||
this.doClose();
|
||||
// handleAdd(index, row) {
|
||||
// this.$emit('selectGoods', row);
|
||||
// // this.doClose();
|
||||
// },
|
||||
|
||||
handlePut(index, row) {
|
||||
row.isPut = true;
|
||||
this.$emit('addGoods', index, row);
|
||||
// this.queryList.reload();
|
||||
},
|
||||
handlePop(index, row) {
|
||||
row.isPut = false;
|
||||
this.$emit('deleteGoods', index, row);
|
||||
// this.queryList.reload();
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
|
@ -19,7 +19,8 @@
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<add-goods ref="addGoods" @selectGoods="selectGoods" />
|
||||
<add-goods ref="addGoods" @addGoods="addGoods" @deleteGoods="deleteGoods" />
|
||||
<!-- @selectGoods="selectGoods" -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -51,6 +52,9 @@ export default {
|
||||
WhetherTypeList: [],
|
||||
OrgzList: [],
|
||||
PermissionTypeList: [],
|
||||
isShowTable:false,
|
||||
errorTip:'请输入商品数量',
|
||||
errorIntTip:'数量必须为整数',
|
||||
formModel: {
|
||||
organizationId: '',
|
||||
goodsId: '',
|
||||
@ -66,7 +70,8 @@ export default {
|
||||
payWays: '01',
|
||||
payStatus: '02',
|
||||
startTime: '',
|
||||
sellerId: ''
|
||||
sellerId: '',
|
||||
detailCreateVOList:[]
|
||||
},
|
||||
DatePicker: {
|
||||
shortcuts: [{
|
||||
@ -150,12 +155,41 @@ export default {
|
||||
labelWidth: this.$i18n.locale == 'en' ? '200px' : '145px',
|
||||
items: [
|
||||
{ prop: 'organizationId', label: this.$t('orderAuthor.organizationOrEnterprise'), type: 'select', required: false, disabled: this.isDisabled, options: this.OrganizationList, allowCreate: true, onChange: this.onChange },
|
||||
{ prop: 'goodsName', label: this.$t('orderAuthor.commodityName'), type: 'text', required: false, disabled: true, rightWidth: true, buttontip: this.$t('orderAuthor.selectGoods'), buttonClick: this.buttonClick },
|
||||
{ prop: 'price', label: this.$t('orderAuthor.itemPricing'), type: 'number', required: false, disabled: true, min: 0, message: this.$t('orderAuthor.yuan') },
|
||||
|
||||
// { prop: 'goodsName', label: this.$t('orderAuthor.commodityName'), type: 'text', required: false, disabled: true, rightWidth: true, buttontip: this.$t('orderAuthor.selectGoods'), buttonClick: this.buttonClick },
|
||||
{ prop:'detailCreateVOList',
|
||||
buttontip: this.$t('orderAuthor.selectGoods'),
|
||||
buttonClick: this.buttonClick,
|
||||
type:'table',
|
||||
tableList:[
|
||||
{prop:'goodsName', label:'商品名称' },
|
||||
{prop:'goodsAmount', label:'商品数量', isEdit:true, min:0,
|
||||
rules:{
|
||||
goodsAmount:[
|
||||
{
|
||||
validator:this.validateChoose,
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
validator:this.validateChoose,
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{prop:'goodsPrice', label:'商品单价'}
|
||||
],
|
||||
operate:'操作',
|
||||
operateButton:[
|
||||
{name:'删除', clickFunc:this.removeGoods}
|
||||
]
|
||||
},
|
||||
// { prop: 'price', label: this.$t('orderAuthor.itemPricing'), type: 'number', required: false, disabled: true, min: 0, message: this.$t('orderAuthor.yuan') },
|
||||
|
||||
{ prop: 'orderType', label: this.$t('orderAuthor.orderType'), type: 'select', required: false, disabled: this.isDisabled, options: this.OrderTypeList },
|
||||
{ prop: 'sellerId', label: this.$t('orderAuthor.salesman'), type: 'select', required: false, show: this.isShowSeller, disabled: this.isDisabled, options: this.SellerList },
|
||||
{ prop: 'contractNo', label: this.$t('orderAuthor.contractNumber'), type: 'text', required: false, show: this.isShowContractNo },
|
||||
{ prop: 'amount', label: this.totalTitle, type: 'number', required: false, show: true, min: 0 },
|
||||
// { prop: 'amount', label: this.totalTitle, type: 'number', required: false, show: true, min: 0 },
|
||||
{ prop: 'forever', label: this.$t('orderAuthor.permanenceOrNot'), type: 'radio', required: false, options: this.$ConstSelect.Whether, disabled: this.foreverIsDisabled },
|
||||
{ prop: 'startTime', label: this.$t('orderAuthor.startDate'), type: 'datetime', required: false, show: this.isShowStartDate, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss', picker: this.DatePicker },
|
||||
{ prop: 'monthAmount', label: this.monthsTitle, type: 'number', required: false, show: this.isShowMonths, min: 0, message: this.$t('orderAuthor.month') },
|
||||
@ -265,10 +299,31 @@ export default {
|
||||
buttonClick() {
|
||||
this.$refs.addGoods.doShow();
|
||||
},
|
||||
selectGoods(data) {
|
||||
this.formModel.goodsId = data.id;
|
||||
this.formModel.goodsName = data.name;
|
||||
this.formModel.price = data.price;
|
||||
validateChoose(rule, value, callback) {
|
||||
if (value || value === 0) {
|
||||
if (Number.isInteger(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error(this.errorIntTip));
|
||||
}
|
||||
} else {
|
||||
callback(new Error(this.errorTip));
|
||||
}
|
||||
},
|
||||
addGoods(index, row) {
|
||||
const data = {
|
||||
'goodsId':row.id,
|
||||
'goodsName':row.name,
|
||||
'goodsAmount':0,
|
||||
'goodsPrice':row.price
|
||||
};
|
||||
this.formModel.detailCreateVOList.push(data);
|
||||
},
|
||||
removeGoods(data) {
|
||||
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== data.goodsId);
|
||||
},
|
||||
deleteGoods(index, row) {
|
||||
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== row.id);
|
||||
},
|
||||
initLoadPage() {
|
||||
// 加载字典数据
|
||||
@ -314,7 +369,7 @@ export default {
|
||||
|
||||
this.$Dictionary.payStatus().then(list => {
|
||||
this.$convertList(list, this.PayStatusTypeList, elem => {
|
||||
return elem.code !== '03'; // 过滤取消状态
|
||||
return elem.code !== '03' && elem.code !== '04'; // 过滤取消和无需支付状态
|
||||
});
|
||||
});
|
||||
|
||||
@ -417,17 +472,12 @@ export default {
|
||||
|
||||
// 构造基础数据
|
||||
const model = {
|
||||
organizationId: orgzId,
|
||||
goodsId: this.formModel.goodsId,
|
||||
organizationId: orgzId, // ok
|
||||
orderType: this.formModel.orderType,
|
||||
amount: this.formModel.amount,
|
||||
// permissionType: this.formModel.permissionType,
|
||||
forever: this.formModel.forever,
|
||||
bizType: this.formModel.bizType,
|
||||
price: this.formModel.price
|
||||
// monthAmount: this.formModel.monthAmount,
|
||||
// startTime: this.formModel.startTime,
|
||||
// payWays: this.formModel.payWays,
|
||||
detailCreateVOList:[]
|
||||
};
|
||||
|
||||
// 根据界面是否显示,序列对应的数据到model中
|
||||
@ -441,26 +491,41 @@ export default {
|
||||
|
||||
if (this.isShowPayType) { model.payWays = this.formModel.payWays; }
|
||||
|
||||
if (this.isShowPayStatus) { model.payStatus = this.formModel.payStatus; }
|
||||
if (this.isShowPayStatus) { model.payStatus = this.formModel.payStatus; } else { model.payStatus = '04'; }
|
||||
|
||||
if (this.isShowSeller) { model.sellerId = this.formModel.sellerId; }
|
||||
|
||||
// 如果是续费类型,则需要将权限ID一并返回回去
|
||||
if (this.isReNew) { model.permissionId = this.$route.params.orderId; }
|
||||
|
||||
return model;
|
||||
let count = 0;
|
||||
this.formModel.detailCreateVOList.forEach(data=>{
|
||||
if (data.goodsAmount > 0) {
|
||||
count++;
|
||||
model.detailCreateVOList.push({'goodsId':data.goodsId, 'goodsAmount':data.goodsAmount});
|
||||
}
|
||||
});
|
||||
|
||||
if (count <= 0) {
|
||||
this.$messageBox('至少有一个商品的数量大于0');
|
||||
return false;
|
||||
} else {
|
||||
return model;
|
||||
}
|
||||
},
|
||||
create() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
this.loading = true;
|
||||
createOrder(this.buildModel()).then(response => {
|
||||
this.turnback();
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.creatingSuccessful'));
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.creatingFailed'));
|
||||
});
|
||||
if (this.buildModel()) {
|
||||
this.loading = true;
|
||||
createOrder(this.buildModel()).then(response => {
|
||||
this.turnback();
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.creatingSuccessful'));
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.creatingFailed'));
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
update() {
|
||||
|
Loading…
Reference in New Issue
Block a user