厂务订单里改个工单接口
This commit is contained in:
@@ -2,44 +2,20 @@
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
@selection-change="selectChange"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:max-height="tableH" @selection-change="selectChange">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList" @successSubmit="successSubmit" />
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -68,7 +44,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '水/气表名',
|
||||
label: '能源表名',
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 110
|
||||
},
|
||||
@@ -142,25 +118,25 @@ export default {
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
? {
|
||||
type: 'meterReading',
|
||||
btnName: '抄表'
|
||||
}
|
||||
type: 'meterReading',
|
||||
btnName: '抄表'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v)=>v),
|
||||
].filter((v) => v),
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
@@ -209,10 +185,10 @@ export default {
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyQuantityManualExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => {})
|
||||
return energyQuantityManualExport({ ...this.queryParams });
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => { })
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
@@ -281,13 +257,13 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row.id)
|
||||
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function() {
|
||||
return energyQuantityManualDelete({id: row.id});
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function () {
|
||||
return energyQuantityManualDelete({ id: row.id });
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,10 +16,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
<el-option v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -28,9 +25,9 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计价方式" prop="pricingMethod">
|
||||
<el-select v-model="form.pricingMethod" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="时间段" :value= '0' ></el-option>
|
||||
<el-option label="使用量" :value= '1' ></el-option>
|
||||
<el-option label="固定价位" :value= '2' ></el-option>
|
||||
<el-option label="时间段" :value='0'></el-option>
|
||||
<el-option label="使用量" :value='1'></el-option>
|
||||
<el-option label="固定价位" :value='2'></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -38,56 +35,33 @@
|
||||
<el-row>
|
||||
<el-col :span="12" v-show="form.pricingMethod === 2">
|
||||
<el-form-item label="单价(元)" prop="pricingMethod">
|
||||
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" style="width: 100%;"></el-input-number>
|
||||
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999"
|
||||
style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-show="form.pricingMethod === 1">
|
||||
<el-form-item label="计量维度" prop="dim">
|
||||
<el-select v-model="form.dim" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="月" :value= '4' ></el-option>
|
||||
<el-option label="年" :value= '5' ></el-option>
|
||||
<el-option label="月" :value='4'></el-option>
|
||||
<el-option label="年" :value='5'></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-show="form.pricingMethod === 0">
|
||||
<el-col :span="24" v-show="form.pricingMethod === 0">
|
||||
<el-form-item label="时间段" prop="pricingMethod">
|
||||
<base-table
|
||||
:key='timeKye'
|
||||
:table-props="tableProps1"
|
||||
:table-data="tableData1"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitButtonClick="emitButtonClick1"
|
||||
@emitFun="inputChange1"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick1"
|
||||
/>
|
||||
<base-table :key='timeKye' :table-props="tableProps1" :table-data="tableData1"
|
||||
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick1" @emitFun="inputChange1">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick1" />
|
||||
</base-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-show="form.pricingMethod === 1">
|
||||
<el-form-item label="使用量" prop="pricingMethod">
|
||||
<base-table
|
||||
:key='usedKye'
|
||||
:table-props="tableProps2"
|
||||
:table-data="tableData2"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitButtonClick="emitButtonClick2"
|
||||
@emitFun="inputChange2"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick2"
|
||||
/>
|
||||
<base-table :key='usedKye' :table-props="tableProps2" :table-data="tableData2"
|
||||
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick2" @emitFun="inputChange2">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick2" />
|
||||
</base-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -182,15 +156,15 @@ export default {
|
||||
if (id) {
|
||||
this.isEdit = true
|
||||
this.form.id = id
|
||||
getEnergyType( id ).then((res) => {
|
||||
getEnergyType(id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.form.name = res.data.name
|
||||
this.form.code = res.data.code
|
||||
this.form.unit = res.data.unit
|
||||
this.form.pricingMethod = res.data.pricingMethod
|
||||
this.form.leaderName = res.data.leaderName
|
||||
this.form.push = res.data.push ? true : false
|
||||
switch(this.form.pricingMethod) {
|
||||
this.form.push = res.data.push ? true : false
|
||||
switch (this.form.pricingMethod) {
|
||||
case 0:
|
||||
this.tableData1 = res.data.segPriceList || []
|
||||
break;
|
||||
@@ -198,6 +172,7 @@ export default {
|
||||
this.tableData2 = res.data.usedPriceList || []
|
||||
break;
|
||||
default:
|
||||
this.form.singlePrice = res.data.singlePrice || 0
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -234,7 +209,7 @@ export default {
|
||||
emitButtonClick1() {
|
||||
let n = this.tableData1.length
|
||||
let obj = {}
|
||||
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
|
||||
obj.startTime = n === 0 ? '' : this.tableData1[n - 1].endTime
|
||||
obj.endTime = ''
|
||||
obj.price = 0
|
||||
this.tableData1.push(obj)
|
||||
@@ -242,7 +217,7 @@ export default {
|
||||
emitButtonClick2() {
|
||||
let n = this.tableData2.length
|
||||
let obj = {}
|
||||
obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed
|
||||
obj.startUsed = n === 0 ? 0 : this.tableData2[n - 1].endUsed
|
||||
obj.endUsed = 0
|
||||
obj.price = 0
|
||||
this.tableData2.push(obj)
|
||||
@@ -259,7 +234,7 @@ export default {
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
switch(this.form.pricingMethod) {
|
||||
switch (this.form.pricingMethod) {
|
||||
case 0:// 时间段
|
||||
if (this.tableData1.length === 0) {
|
||||
this.$modal.msgError('时间段表格数据不能为空')
|
||||
@@ -289,7 +264,7 @@ export default {
|
||||
default:// 固定单价
|
||||
if (!this.form.singlePrice) {
|
||||
this.$modal.msgError('单价有误请检查,请检查')
|
||||
return false
|
||||
return false
|
||||
}
|
||||
}
|
||||
console.log(this.form)
|
||||
@@ -302,11 +277,11 @@ export default {
|
||||
unit: this.form.unit,
|
||||
pricingMethod: this.form.pricingMethod,
|
||||
description: this.form.description,
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim : '',
|
||||
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
|
||||
push:this.form.push ? 1 : 0
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1 : [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2 : [],
|
||||
push: this.form.push ? 1 : 0
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
@@ -320,11 +295,11 @@ export default {
|
||||
unit: this.form.unit,
|
||||
pricingMethod: this.form.pricingMethod,
|
||||
description: this.form.description,
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim : '',
|
||||
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
|
||||
push:this.form.push ? 1 : 0
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1 : [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2 : [],
|
||||
push: this.form.push ? 1 : 0
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
|
||||
Reference in New Issue
Block a user