新增检测项目子表操作,修改检测工单表格显示顺序
This commit is contained in:
parent
7881c6022b
commit
70fe5aebc9
@ -61,3 +61,15 @@ export function getRole(params) {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 获取商品 Excel
|
||||
export function getGoods(params) {
|
||||
return request({
|
||||
url: 'system/inspectionGoods/listPartnerGoods',
|
||||
method: 'get',
|
||||
params: {
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -19,6 +19,17 @@
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="提成价格">
|
||||
<el-table :data="tableData" style="width: 100%" height="250">
|
||||
<el-table-column fixed prop="title" label="商品名称">
|
||||
</el-table-column>
|
||||
<el-table-column label="提成价格">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.royaltyAmount" placeholder="输入价格"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
@ -30,11 +41,12 @@
|
||||
|
||||
<script>
|
||||
import * as DlInspectionProjectApi from '@/api/inspection/project';
|
||||
import {getRole} from "@/api/inspection/project";
|
||||
import {getGoods, getRole} from "@/api/inspection/project";
|
||||
import ElementBaseInfo from "@/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue";
|
||||
|
||||
export default {
|
||||
name: "DlInspectionProjectForm",
|
||||
components: {},
|
||||
components: {ElementBaseInfo},
|
||||
data() {
|
||||
return {
|
||||
// 弹出层标题
|
||||
@ -59,12 +71,14 @@ export default {
|
||||
]
|
||||
},
|
||||
roleList: [],
|
||||
tableData: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.getRole()
|
||||
|
||||
this.dialogVisible = true;
|
||||
this.reset();
|
||||
// 修改时,设置数据
|
||||
@ -73,10 +87,18 @@ export default {
|
||||
try {
|
||||
const res = await DlInspectionProjectApi.getDlInspectionProject(id);
|
||||
this.formData = res.data;
|
||||
if (res.data.projectRoyaltyList.length > 0){
|
||||
this.tableData = res.data.projectRoyaltyList
|
||||
console.log('tableData', this.tableData)
|
||||
}else {
|
||||
this.getGoods()
|
||||
}
|
||||
this.title = "修改检测项目";
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
}else {
|
||||
this.getGoods()
|
||||
}
|
||||
this.title = "新增检测项目";
|
||||
},
|
||||
@ -87,14 +109,38 @@ export default {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const data = this.formData;
|
||||
|
||||
// 修改的提交
|
||||
if (data.id) {
|
||||
this.tableData.map(item => {
|
||||
if (!item.royaltyAmount) {
|
||||
item.royaltyAmount = 0
|
||||
}else {
|
||||
/*将royaltyAmount的单位转为分*/
|
||||
item.royaltyAmount = item.royaltyAmount * 100
|
||||
}
|
||||
})
|
||||
data.projectRoyaltyList = this.tableData
|
||||
console.log('商品及提成', this.tableData)
|
||||
await DlInspectionProjectApi.updateDlInspectionProject(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
return;
|
||||
}
|
||||
this.tableData.map(item => {
|
||||
item.goodsId = item.id
|
||||
/*如果royaltyAmount 为空,则设置为0*/
|
||||
if (!item.royaltyAmount) {
|
||||
item.royaltyAmount = 0
|
||||
}else {
|
||||
/*将royaltyAmount的单位转为分*/
|
||||
item.royaltyAmount = item.royaltyAmount * 100
|
||||
}
|
||||
delete item.id
|
||||
})
|
||||
data.projectRoyaltyList = this.tableData
|
||||
console.log('商品及提成', this.tableData)
|
||||
// 添加的提交
|
||||
await DlInspectionProjectApi.createDlInspectionProject(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
@ -116,9 +162,13 @@ export default {
|
||||
/** 获取角色下拉框数据 */
|
||||
async getRole() {
|
||||
const res = await getRole();
|
||||
console.log("角色的集合", res.data)
|
||||
this.roleList = res.data
|
||||
},
|
||||
/** 获取角色下拉框数据 */
|
||||
async getGoods() {
|
||||
const res = await getGoods();
|
||||
this.tableData = res.data.records
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -147,7 +147,8 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
await this.$modal.confirm('是否确认删除检测项目编号为"' + id + '"的数据项?')
|
||||
const name = row.projectName;
|
||||
await this.$modal.confirm('是否确认删除检测项目名称为"' + name + '"的数据项?')
|
||||
try {
|
||||
await DlInspectionProjectApi.deleteDlInspectionProject(id);
|
||||
await this.getList();
|
||||
|
@ -110,9 +110,18 @@
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="车牌号" align="center" prop="carNum"/>
|
||||
<el-table-column label="客户来源" align="center" prop="customerSource">
|
||||
</el-table-column>
|
||||
<el-table-column label="检测结果" align="center" prop="isPass">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isPass =='0'">不合格</span>
|
||||
<span v-else-if="scope.row.isPass =='1'">合格</span>
|
||||
<span v-else>进行中</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检测类型" align="center" prop="goodsTitle"/>
|
||||
<el-table-column label="检测项目" align="center" prop="skuName"/>
|
||||
<el-table-column label="公示价格" align="center" prop="realPayMoney">
|
||||
<el-table-column label="公示应收价格" align="center" prop="realPayMoney" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.goodsPrice / 100 }}</span>
|
||||
</template>
|
||||
@ -127,8 +136,6 @@
|
||||
<el-table-column label="客户手机号" align="center" prop="buyPhone"/>
|
||||
<!-- <el-table-column label="接待员" align="center" prop="workerName"/>-->
|
||||
<el-table-column label="接待员手机号" align="center" prop="workerPhone"/>
|
||||
<el-table-column label="客户来源" align="center" prop="customerSource">
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" align="center" prop="payType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.pay_type" :value="scope.row.payType"/>
|
||||
@ -136,13 +143,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="startTime"/>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime"/>
|
||||
<el-table-column label="检测结果" align="center" prop="isPass">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isPass =='0'">不合格</span>
|
||||
<span v-else-if="scope.row.isPass =='1'">合格</span>
|
||||
<span v-else>进行中</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
Loading…
Reference in New Issue
Block a user