Commit bd973c0c by 姜雷

用车详情可以修改

parent f7d15bd9
......@@ -91,37 +91,31 @@
<span v-else>{{selected.carPlate}}</span>
</el-form-item>
<el-form-item class="col-line-3" label="出车公里数" label-width="100px">
<el-input-number v-if="editType" v-model.trim="selected.startKilometers" :controls="false" :precision="0" :min="0" :max="9999999" placeholder="" clearable></el-input-number>
<span v-else>{{selected.startKilometers}}</span>
<el-input-number v-model.trim="selected.startKilometers" :controls="false" :precision="0" :min="0" :max="9999999" placeholder="" clearable></el-input-number>
</el-form-item>
<el-form-item class="col-line-3" label="收车公里数" label-width="100px">
<el-input-number v-if="editType" v-model.trim="selected.stopKilometers" :controls="false" :precision="0" :min="0" :max="9999999" placeholder="" clearable></el-input-number>
<span v-else>{{selected.stopKilometers}}</span>
<el-input-number v-model.trim="selected.stopKilometers" :controls="false" :precision="0" :min="0" :max="9999999" placeholder="" clearable></el-input-number>
</el-form-item>
<el-form-item class="col-line-3" label="实际公里数" label-width="100px">
<el-input-number v-if="editType" v-model.trim="selected.trueKilometers" :controls="false" :precision="0" :min="0" :max="9999999" placeholder="" clearable></el-input-number>
<span v-else>{{selected.trueKilometers}}</span>
<el-input-number v-model.trim="selected.trueKilometers" :controls="false" :precision="0" :min="0" :max="9999999" placeholder="" clearable></el-input-number>
</el-form-item>
<el-form-item label="资金来源" label-width="100px">
<el-input v-if="editType" v-model.trim="selected.priceSource" placeholder="可不填" :maxlength="20" clearable></el-input>
<span v-else>{{selected.priceSource}}</span>
<el-input v-model.trim="selected.priceSource" placeholder="可不填" :maxlength="20" clearable></el-input>
</el-form-item>
<template v-if="editType">
<el-form-item label="用车单价" label-width="100px">
<div class="item-value">
<el-input-number v-model.trim="selected.price" :controls="false" :precision="2" :min="0" :max="9999999.99" placeholder="可不填" clearable></el-input-number>
<el-input-number v-model.trim="selected.totalPrice" :controls="false" :precision="2" :min="0" :max="9999999.99" placeholder="可不填" clearable></el-input-number>
</div>
</el-form-item>
</template>
<template v-else>
<!-- <template v-else>
<el-form-item class="col-line-2" label="用车单价" label-width="100px">
<span>{{selected.price}}</span>
</el-form-item>
<el-form-item class="col-line-2" label="用车金额" label-width="100px">
<span>{{selected.totalPrice}}</span>
</el-form-item>
</template>
</template> -->
<el-form-item v-if="editType" label-width="100px">
<div class="item-value-start">
<el-radio v-model="selected.dealResult" @change="toogleDealResult" :label="2">同意</el-radio>
......@@ -138,7 +132,8 @@
<el-button type="primary" @click="dealApplyHandle">确 定</el-button>
</div>
<div v-else slot="footer" class="dialog-footer">
<el-button type="primary" @click="resetEditDialog">确 定</el-button>
<el-button @click="resetEditDialog">取 消</el-button>
<el-button type="primary" @click="updateDealHandle">确 定</el-button>
</div>
</drag-dialog>
<drag-dialog title="用车管理-打印" :visible.sync="dialogPrintVisible" :before-close="resetPrintDialog" width="70%" top="5vh">
......@@ -320,6 +315,28 @@ export default {
console.log(action);
});
},
updateDealHandle() {
const entity = {
id: this.selected.id,
startKilometers: this.selected.startKilometers,
stopKilometers: this.selected.stopKilometers,
trueKilometers: this.selected.trueKilometers,
priceSource: this.selected.priceSource,
price: this.selected.price,
totalPrice: this.selected.totalPrice,
};
dealApply(entity)
.then(res => {
console.log(res);
this.fetchList();
this.$message.success(res.msg);
this.resetEditDialog();
})
.catch(err => {
console.log(err);
this.$message.error(err.msg || '处理失败!');
});
},
showPrintDialog(data) {
let categoryName = JSON.parse(data.row.categoryName).map(
item => (item.checked ? `■ ${item.name}` : `□ ${item.name}`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment