优化维修页面配件收费问题
This commit is contained in:
parent
ab24cae703
commit
44fc4eaa98
|
|
@ -91,6 +91,7 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="domain.partType == 1"
|
||||
:prop="'premiumList.' + index + '.partCost'"
|
||||
label="配件单价(元):"
|
||||
:rules="{
|
||||
|
|
@ -535,6 +536,12 @@ export default {
|
|||
'this.dynamicValidateForm.premiumList1111)',
|
||||
this.dynamicValidateForm.premiumList,
|
||||
)
|
||||
|
||||
this.dynamicValidateForm.premiumList.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
maId: this.rowObj.maId,
|
||||
|
|
@ -570,6 +577,11 @@ export default {
|
|||
submitTwo() {
|
||||
this.$refs['dynamicValidateFormTwo'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
// 数量管理传递参数
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,25 @@
|
|||
<template>
|
||||
<el-dialog v-dialogDrag v-loading.fullscreen.lock="fullscreenLoading" :before-close="cancel" :title="dialogTitle"
|
||||
:visible.sync="dialogShowFlag" append-to-body width="600px">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
:before-close="cancel"
|
||||
:title="dialogTitle"
|
||||
:visible.sync="dialogShowFlag"
|
||||
append-to-body
|
||||
width="600px"
|
||||
>
|
||||
<div class="form_box_one">
|
||||
<el-form ref="dynamicValidateForm" :model="dynamicValidateForm" class="demo-dynamic" label-width="100px">
|
||||
<div v-for="(domain, index) in dynamicValidateForm.premiumList" :key="domain.key" class="bor_box">
|
||||
<el-form
|
||||
ref="dynamicValidateForm"
|
||||
:model="dynamicValidateForm"
|
||||
class="demo-dynamic"
|
||||
label-width="100px"
|
||||
>
|
||||
<div
|
||||
v-for="(domain, index) in dynamicValidateForm.premiumList"
|
||||
:key="domain.key"
|
||||
class="bor_box"
|
||||
>
|
||||
<p class="form_box_title">编码管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
|
|
@ -13,25 +29,59 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item :prop="'premiumList.' + index + '.partName'" label="配件名称:">
|
||||
<el-input v-model="domain.partName" placeholder="请输入" size="small" maxlength="50"
|
||||
style="width: 350px"></el-input>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partName'"
|
||||
label="配件名称:"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partName"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="50"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.partType'" label="是否收费:" required
|
||||
:rules="{ required: true, message: '请选择是否收费', trigger: 'blur', }">
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partType'"
|
||||
label="是否收费:"
|
||||
required
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择是否收费',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group
|
||||
style="width: 350px"
|
||||
v-model="domain.partType"
|
||||
>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="index == 0" :prop="'premiumList.' + index + '.supplierId'" label="选择厂家:" :rules="{
|
||||
<el-form-item
|
||||
v-if="index == 0"
|
||||
:prop="'premiumList.' + index + '.supplierId'"
|
||||
label="选择厂家:"
|
||||
:rules="{
|
||||
message: '请选择厂家',
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-select v-model="domain.supplierId" placeholder="请选择" size="small" filterable style="width: 350px">
|
||||
<el-option v-for="dict in supplierSelectList" :key="dict.supplierId" :label="dict.supplier"
|
||||
:value="dict.supplierId" />
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
v-model="domain.supplierId"
|
||||
placeholder="请选择"
|
||||
size="small"
|
||||
filterable
|
||||
style="width: 350px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierSelectList"
|
||||
:key="dict.supplierId"
|
||||
:label="dict.supplier"
|
||||
:value="dict.supplierId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
|
|
@ -44,33 +94,77 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
> -->
|
||||
<el-form-item :prop="'premiumList.' + index + '.partPrice'" label="配件单价(元):" label-width="120px">
|
||||
<el-input v-model="domain.partPrice" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 330px"></el-input>
|
||||
<el-form-item
|
||||
v-if="domain.partType == 1"
|
||||
:prop="'premiumList.' + index + '.partPrice'"
|
||||
label="配件单价(元):"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 330px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.partNum'" label="配件数量:" :rules="{
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partNum'"
|
||||
label="配件数量:"
|
||||
:rules="{
|
||||
required: false,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-input v-model="domain.partNum" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 350px"></el-input>
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairContent'" label="维修内容:">
|
||||
<el-input v-model="domain.repairContent" maxlength="100" placeholder="请输入" show-word-limit size="small"
|
||||
style="width: 350px" type="textarea"></el-input>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.repairContent'"
|
||||
label="维修内容:"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.repairContent"
|
||||
maxlength="100"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code !== null && rowObj.code !== ''">
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
v-if="rowObj.code !== null && rowObj.code !== ''"
|
||||
>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submit">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_box_two">
|
||||
<el-form ref="dynamicValidateFormTwo" :model="dynamicValidateFormTwo" class="demo-dynamic" label-width="100px">
|
||||
<div v-for="(domain, index) in dynamicValidateFormTwo.premiumListTwo" :key="domain.key" class="bor_box">
|
||||
<el-form
|
||||
ref="dynamicValidateFormTwo"
|
||||
:model="dynamicValidateFormTwo"
|
||||
class="demo-dynamic"
|
||||
label-width="100px"
|
||||
>
|
||||
<div
|
||||
v-for="(
|
||||
domain, index
|
||||
) in dynamicValidateFormTwo.premiumListTwo"
|
||||
:key="domain.key"
|
||||
class="bor_box"
|
||||
>
|
||||
<p class="form_box_title">数量管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
|
|
@ -80,32 +174,72 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.repairNum'" label="维修数量:" :rules="{
|
||||
<el-form-item
|
||||
:prop="'premiumListTwo.' + index + '.repairNum'"
|
||||
label="维修数量:"
|
||||
:rules="{
|
||||
required: true,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-input v-model="domain.repairNum" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 350px"></el-input>
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.repairNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="配件名称:">
|
||||
<el-input v-model="domain.partName" placeholder="请输入" size="small" maxlength="50"
|
||||
style="width: 350px"></el-input>
|
||||
<el-input
|
||||
v-model="domain.partName"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="50"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否收费:" required :rules="{ required: true, message: '请选择是否收费', trigger: 'blur', }">
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-form-item
|
||||
label="是否收费:"
|
||||
required
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择是否收费',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group
|
||||
style="width: 350px"
|
||||
v-model="domain.partType"
|
||||
>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="index == 0" :prop="'premiumListTwo.' + index + '.supplierId'" label="选择厂家:" :rules="{
|
||||
<el-form-item
|
||||
v-if="index == 0"
|
||||
:prop="'premiumListTwo.' + index + '.supplierId'"
|
||||
label="选择厂家:"
|
||||
:rules="{
|
||||
message: '请选择厂家',
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-select v-model="domain.supplierId" placeholder="请选择" size="small" filterable style="width: 350px">
|
||||
<el-option v-for="dict in supplierSelectList" :key="dict.supplierId" :label="dict.supplier"
|
||||
:value="dict.supplierId" />
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
v-model="domain.supplierId"
|
||||
placeholder="请选择"
|
||||
size="small"
|
||||
filterable
|
||||
style="width: 350px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierSelectList"
|
||||
:key="dict.supplierId"
|
||||
:label="dict.supplier"
|
||||
:value="dict.supplierId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
|
|
@ -118,22 +252,45 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
> -->
|
||||
<el-form-item label="配件单价(元):" label-width="120px">
|
||||
<el-input v-model="domain.partPrice" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 330px"></el-input>
|
||||
<el-form-item
|
||||
label="配件单价(元):"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 330px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="配件数量:" :rules="{
|
||||
<el-form-item
|
||||
label="配件数量:"
|
||||
:rules="{
|
||||
required: false,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-input v-model="domain.partNum" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 350px"></el-input>
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="维修内容:">
|
||||
<el-input v-model="domain.repairContent" maxlength="100" placeholder="请输入" show-word-limit size="small"
|
||||
style="width: 350px" type="textarea"></el-input>
|
||||
<el-input
|
||||
v-model="domain.repairContent"
|
||||
maxlength="100"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
|
|
@ -151,7 +308,11 @@
|
|||
</div> -->
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code == null || rowObj.code == ''">
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
v-if="rowObj.code == null || rowObj.code == ''"
|
||||
>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitTwo">保存</el-button>
|
||||
</div>
|
||||
|
|
@ -160,55 +321,56 @@
|
|||
</template>
|
||||
<script>
|
||||
import {
|
||||
submitRepairApplyApi, getUserSelectApi,
|
||||
getRepairMaTypeListApi, listPartType, getSupplierSelectApi
|
||||
} from "@/api/repairTest/repair";
|
||||
submitRepairApplyApi,
|
||||
getUserSelectApi,
|
||||
getRepairMaTypeListApi,
|
||||
listPartType,
|
||||
getSupplierSelectApi,
|
||||
} from '@/api/repairTest/repair'
|
||||
// import { listPartType, } from "@/api/store/tools";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {
|
||||
getInfo,
|
||||
} from "@/api/login";;
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { getInfo } from '@/api/login'
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
props: {
|
||||
// 弹窗是否显示
|
||||
isShowFlag: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
// 对应操作数据键值
|
||||
priKey: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
default: '',
|
||||
},
|
||||
//弹窗标题
|
||||
dialogTitle: {
|
||||
type: String,
|
||||
default: ""
|
||||
default: '',
|
||||
},
|
||||
//弹窗标题
|
||||
rowObj: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isShowFlag(val) {
|
||||
if (val) {
|
||||
this.init();
|
||||
}
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
dialogShowFlag: {
|
||||
get() {
|
||||
return this.isShowFlag;
|
||||
return this.isShowFlag
|
||||
},
|
||||
set(v) {
|
||||
this.$emit("update:isShowFlag", v);
|
||||
}
|
||||
}
|
||||
this.$emit('update:isShowFlag', v)
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -217,40 +379,40 @@ export default {
|
|||
dynamicValidateForm: {
|
||||
premiumList: [
|
||||
{
|
||||
selected: "Y",
|
||||
selected: 'Y',
|
||||
premium: undefined,
|
||||
rate: undefined,
|
||||
feeRate: undefined,
|
||||
fee: undefined,
|
||||
baofei1_unit: "",
|
||||
shangyoufeiyonge_unit: "",
|
||||
baofei1_unit: '',
|
||||
shangyoufeiyonge_unit: '',
|
||||
downRate: undefined,
|
||||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: ""
|
||||
}
|
||||
xiayoufeiyonge_unit: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
dynamicValidateFormTwo: {
|
||||
premiumListTwo: [
|
||||
{
|
||||
selected: "Y",
|
||||
selected: 'Y',
|
||||
premium: undefined,
|
||||
rate: undefined,
|
||||
feeRate: undefined,
|
||||
fee: undefined,
|
||||
baofei1_unit: "",
|
||||
shangyoufeiyonge_unit: "",
|
||||
baofei1_unit: '',
|
||||
shangyoufeiyonge_unit: '',
|
||||
downRate: undefined,
|
||||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: ""
|
||||
}
|
||||
xiayoufeiyonge_unit: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
userSelectList: [],
|
||||
companyId: '',
|
||||
taskId: ""
|
||||
};
|
||||
taskId: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('taskId', (taskId) => {
|
||||
|
|
@ -261,69 +423,70 @@ export default {
|
|||
methods: {
|
||||
//正则校验配件费用
|
||||
meneyIntegerValidator(rule, value, callback) {
|
||||
const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
||||
const reg =
|
||||
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
if (value === '' || reg.test(value)) {
|
||||
callback();
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('请输入大于0的数'));
|
||||
callback(new Error('请输入大于0的数'))
|
||||
}
|
||||
},
|
||||
//正则校验配件数量--维修数量
|
||||
numberIntegerValidator(rule, value, callback) {
|
||||
const reg = /^\+?[1-9][0-9]*$/;
|
||||
const reg = /^\+?[1-9][0-9]*$/
|
||||
if (reg.test(value) && value <= this.rowObj.repairNum) {
|
||||
callback();
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('请输入大于0的并且小于维修总量的正整数'));
|
||||
callback(new Error('请输入大于0的并且小于维修总量的正整数'))
|
||||
}
|
||||
},
|
||||
getTree() {
|
||||
listPartType().then(response => {
|
||||
this.deptList = this.handleTree(response.data, "paId");
|
||||
});
|
||||
listPartType().then((response) => {
|
||||
this.deptList = this.handleTree(response.data, 'paId')
|
||||
})
|
||||
},
|
||||
/** 转换部门数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
id: node.paId,
|
||||
label: node.paName,
|
||||
children: node.children
|
||||
};
|
||||
children: node.children,
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
let params = {
|
||||
taskId: this.taskId
|
||||
taskId: this.taskId,
|
||||
}
|
||||
this.loading = true;
|
||||
getRepairMaTypeListApi(params).then(res => {
|
||||
this.loading = true
|
||||
getRepairMaTypeListApi(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.repairList = res.rows;
|
||||
this.total = res.total;
|
||||
this.loading = false;
|
||||
this.repairList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
init() {
|
||||
if (this.rowObj.code !== null && this.rowObj.code !== '') {
|
||||
this.dynamicValidateForm.premiumList = [];
|
||||
this.dynamicValidateFormTwo.premiumListTwo = [];
|
||||
this.addDomainOne();
|
||||
this.dynamicValidateForm.premiumList = []
|
||||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainOne()
|
||||
} else {
|
||||
this.dynamicValidateForm.premiumList = [];
|
||||
this.dynamicValidateFormTwo.premiumListTwo = [];
|
||||
this.addDomainTwo();
|
||||
this.dynamicValidateForm.premiumList = []
|
||||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainTwo()
|
||||
}
|
||||
getSupplierSelectApi().then(res => {
|
||||
getSupplierSelectApi().then((res) => {
|
||||
this.supplierSelectList = res.data
|
||||
})
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.dialogShowFlag = false;
|
||||
this.dialogShowFlag = false
|
||||
// this.$refs["form"].resetFields();
|
||||
// this.dynamicValidateForm.premiumList = [];
|
||||
},
|
||||
|
|
@ -335,7 +498,7 @@ export default {
|
|||
// 维修内容 repairContent
|
||||
// 维修数量 repairNum
|
||||
this.dynamicValidateForm.premiumList.push({
|
||||
selected: "N",
|
||||
selected: 'N',
|
||||
partName: '',
|
||||
repairer: '',
|
||||
partType: '',
|
||||
|
|
@ -345,12 +508,12 @@ export default {
|
|||
supplierId: '',
|
||||
partPrice: '',
|
||||
repairNum: 1,
|
||||
key: Date.now()
|
||||
});
|
||||
key: Date.now(),
|
||||
})
|
||||
},
|
||||
addDomainTwo() {
|
||||
this.dynamicValidateFormTwo.premiumListTwo.push({
|
||||
selected: "N",
|
||||
selected: 'N',
|
||||
partName: '',
|
||||
repairer: '',
|
||||
partType: '',
|
||||
|
|
@ -358,18 +521,27 @@ export default {
|
|||
partCost: '',
|
||||
repairContent: '',
|
||||
repairNum: '',
|
||||
key: Date.now()
|
||||
});
|
||||
key: Date.now(),
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs["dynamicValidateForm"].validate(valid => {
|
||||
this.$refs['dynamicValidateForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dynamicValidateForm.premiumList.forEach(item => {
|
||||
item.partCost = item.partPrice;
|
||||
this.dynamicValidateForm.premiumList.forEach((item) => {
|
||||
item.partCost = item.partPrice
|
||||
})
|
||||
// this.dynamicValidateForm.premiumList[0].partCost = this.dynamicValidateForm.premiumList[0].partPrice;
|
||||
// 编码管理传递参数
|
||||
console.log('this.dynamicValidateForm.premiumList1111)', this.dynamicValidateForm.premiumList);
|
||||
|
||||
this.dynamicValidateForm.premiumList.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
console.log(
|
||||
'this.dynamicValidateForm.premiumList1111)',
|
||||
this.dynamicValidateForm.premiumList,
|
||||
)
|
||||
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
@ -379,10 +551,13 @@ export default {
|
|||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(this.dynamicValidateForm.premiumList)
|
||||
partStrList: JSON.stringify(
|
||||
this.dynamicValidateForm.premiumList,
|
||||
),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params).then(res => {
|
||||
submitRepairApplyApi(params)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getList()
|
||||
this.fullscreenLoading = false
|
||||
|
|
@ -390,23 +565,35 @@ export default {
|
|||
this.$message.success('操作成功!')
|
||||
this.$emit('domainChange', res.code)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
submitTwo() {
|
||||
this.$refs["dynamicValidateFormTwo"].validate(valid => {
|
||||
this.$refs['dynamicValidateFormTwo'].validate((valid) => {
|
||||
if (valid) {
|
||||
// this.dynamicValidateFormTwo.premiumListTwo[0].partCost = this.dynamicValidateFormTwo.premiumListTwo[0].partPrice;
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach(item => {
|
||||
item.partCost = item.partPrice;
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach(
|
||||
(item) => {
|
||||
item.partCost = item.partPrice
|
||||
},
|
||||
)
|
||||
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
|
||||
console.log('this.dynamicValidateFormTwo.premiumListTwo2222', this.dynamicValidateFormTwo.premiumListTwo);
|
||||
console.log(
|
||||
'this.dynamicValidateFormTwo.premiumListTwo2222',
|
||||
this.dynamicValidateFormTwo.premiumListTwo,
|
||||
)
|
||||
// 数量管理传递参数
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
@ -416,10 +603,13 @@ export default {
|
|||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(this.dynamicValidateFormTwo.premiumListTwo)
|
||||
partStrList: JSON.stringify(
|
||||
this.dynamicValidateFormTwo.premiumListTwo,
|
||||
),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params).then(res => {
|
||||
submitRepairApplyApi(params)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getList()
|
||||
this.fullscreenLoading = false
|
||||
|
|
@ -427,16 +617,17 @@ export default {
|
|||
this.$message.success('操作成功!')
|
||||
this.$emit('domainChange', res.code)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.form_box_one {
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="domain.partType == 1"
|
||||
:prop="'premiumList.' + index + '.partCost'"
|
||||
label="配件单价(元):"
|
||||
:rules="{
|
||||
|
|
@ -251,6 +252,7 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="domain.partTyp == 1"
|
||||
:prop="'premiumListTwo.' + index + '.partCost'"
|
||||
label="配件单价(元):"
|
||||
:rules="{
|
||||
|
|
@ -535,6 +537,12 @@ export default {
|
|||
'this.dynamicValidateForm.premiumList1111)',
|
||||
this.dynamicValidateForm.premiumList,
|
||||
)
|
||||
|
||||
this.dynamicValidateForm.premiumList.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
maId: this.rowObj.maId,
|
||||
|
|
@ -570,6 +578,11 @@ export default {
|
|||
submitTwo() {
|
||||
this.$refs['dynamicValidateFormTwo'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
// 数量管理传递参数
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,25 @@
|
|||
<template>
|
||||
<el-dialog v-dialogDrag v-loading.fullscreen.lock="fullscreenLoading" :before-close="cancel" :title="dialogTitle"
|
||||
:visible.sync="dialogShowFlag" append-to-body width="600px">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
:before-close="cancel"
|
||||
:title="dialogTitle"
|
||||
:visible.sync="dialogShowFlag"
|
||||
append-to-body
|
||||
width="600px"
|
||||
>
|
||||
<div class="form_box_one">
|
||||
<el-form ref="dynamicValidateForm" :model="dynamicValidateForm" class="demo-dynamic" label-width="100px">
|
||||
<div v-for="(domain, index) in dynamicValidateForm.premiumList" :key="domain.key" class="bor_box">
|
||||
<el-form
|
||||
ref="dynamicValidateForm"
|
||||
:model="dynamicValidateForm"
|
||||
class="demo-dynamic"
|
||||
label-width="100px"
|
||||
>
|
||||
<div
|
||||
v-for="(domain, index) in dynamicValidateForm.premiumList"
|
||||
:key="domain.key"
|
||||
class="bor_box"
|
||||
>
|
||||
<p class="form_box_title">编码管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
|
|
@ -13,25 +29,60 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item :prop="'premiumList.' + index + '.partName'" label="配件名称:">
|
||||
<el-input v-model="domain.partName" placeholder="请输入" size="small" maxlength="50"
|
||||
style="width: 350px"></el-input>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partName'"
|
||||
label="配件名称:"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partName"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="50"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.partType'" label="是否收费:" required
|
||||
:rules="{ required: true, message: '请选择是否收费', trigger: 'blur', }">
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-form-item
|
||||
v-if="domain.partType == 1"
|
||||
:prop="'premiumList.' + index + '.partType'"
|
||||
label="是否收费:"
|
||||
required
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择是否收费',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group
|
||||
style="width: 350px"
|
||||
v-model="domain.partType"
|
||||
>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="index == 0" :prop="'premiumList.' + index + '.supplierId'" label="选择厂家:" :rules="{
|
||||
<el-form-item
|
||||
v-if="index == 0"
|
||||
:prop="'premiumList.' + index + '.supplierId'"
|
||||
label="选择厂家:"
|
||||
:rules="{
|
||||
message: '请选择厂家',
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-select v-model="domain.supplierId" placeholder="请选择" size="small" filterable style="width: 350px">
|
||||
<el-option v-for="dict in supplierSelectList" :key="dict.supplierId" :label="dict.supplier"
|
||||
:value="dict.supplierId" />
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
v-model="domain.supplierId"
|
||||
placeholder="请选择"
|
||||
size="small"
|
||||
filterable
|
||||
style="width: 350px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierSelectList"
|
||||
:key="dict.supplierId"
|
||||
:label="dict.supplier"
|
||||
:value="dict.supplierId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
|
|
@ -44,33 +95,76 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
> -->
|
||||
<el-form-item :prop="'premiumList.' + index + '.partPrice'" label="配件单价(元):" label-width="120px">
|
||||
<el-input v-model="domain.partPrice" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 330px"></el-input>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partPrice'"
|
||||
label="配件单价(元):"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 330px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.partNum'" label="配件数量:" :rules="{
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.partNum'"
|
||||
label="配件数量:"
|
||||
:rules="{
|
||||
required: false,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-input v-model="domain.partNum" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 350px"></el-input>
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :prop="'premiumList.' + index + '.repairContent'" label="维修内容:">
|
||||
<el-input v-model="domain.repairContent" maxlength="100" placeholder="请输入" show-word-limit size="small"
|
||||
style="width: 350px" type="textarea"></el-input>
|
||||
<el-form-item
|
||||
:prop="'premiumList.' + index + '.repairContent'"
|
||||
label="维修内容:"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.repairContent"
|
||||
maxlength="100"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code !== null && rowObj.code !== ''">
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
v-if="rowObj.code !== null && rowObj.code !== ''"
|
||||
>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submit">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_box_two">
|
||||
<el-form ref="dynamicValidateFormTwo" :model="dynamicValidateFormTwo" class="demo-dynamic" label-width="100px">
|
||||
<div v-for="(domain, index) in dynamicValidateFormTwo.premiumListTwo" :key="domain.key" class="bor_box">
|
||||
<el-form
|
||||
ref="dynamicValidateFormTwo"
|
||||
:model="dynamicValidateFormTwo"
|
||||
class="demo-dynamic"
|
||||
label-width="100px"
|
||||
>
|
||||
<div
|
||||
v-for="(
|
||||
domain, index
|
||||
) in dynamicValidateFormTwo.premiumListTwo"
|
||||
:key="domain.key"
|
||||
class="bor_box"
|
||||
>
|
||||
<p class="form_box_title">数量管理设备</p>
|
||||
<div class="form_box_line"></div>
|
||||
<div class="form_box_item">
|
||||
|
|
@ -80,32 +174,72 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
label="选择配件:" -->
|
||||
<el-form-item :prop="'premiumListTwo.' + index + '.repairNum'" label="维修数量:" :rules="{
|
||||
<el-form-item
|
||||
:prop="'premiumListTwo.' + index + '.repairNum'"
|
||||
label="维修数量:"
|
||||
:rules="{
|
||||
required: true,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-input v-model="domain.repairNum" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 350px"></el-input>
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.repairNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="配件名称:">
|
||||
<el-input v-model="domain.partName" placeholder="请输入" size="small" maxlength="50"
|
||||
style="width: 350px"></el-input>
|
||||
<el-input
|
||||
v-model="domain.partName"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="50"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否收费:" required :rules="{ required: true, message: '请选择是否收费', trigger: 'blur', }">
|
||||
<el-radio-group style="width: 350px" v-model="domain.partType">
|
||||
<el-form-item
|
||||
label="是否收费:"
|
||||
required
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择是否收费',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-radio-group
|
||||
style="width: 350px"
|
||||
v-model="domain.partType"
|
||||
>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="index == 0" :prop="'premiumListTwo.' + index + '.supplierId'" label="选择厂家:" :rules="{
|
||||
<el-form-item
|
||||
v-if="index == 0"
|
||||
:prop="'premiumListTwo.' + index + '.supplierId'"
|
||||
label="选择厂家:"
|
||||
:rules="{
|
||||
message: '请选择厂家',
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-select v-model="domain.supplierId" placeholder="请选择" size="small" filterable style="width: 350px">
|
||||
<el-option v-for="dict in supplierSelectList" :key="dict.supplierId" :label="dict.supplier"
|
||||
:value="dict.supplierId" />
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
v-model="domain.supplierId"
|
||||
placeholder="请选择"
|
||||
size="small"
|
||||
filterable
|
||||
style="width: 350px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in supplierSelectList"
|
||||
:key="dict.supplierId"
|
||||
:label="dict.supplier"
|
||||
:value="dict.supplierId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
|
|
@ -118,22 +252,46 @@
|
|||
trigger: 'blur',
|
||||
}"
|
||||
> -->
|
||||
<el-form-item label="配件单价(元):" label-width="120px">
|
||||
<el-input v-model="domain.partPrice" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 330px"></el-input>
|
||||
<el-form-item
|
||||
label="配件单价(元):"
|
||||
label-width="120px"
|
||||
v-if="domain.partType == 1"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partPrice"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 330px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="配件数量:" :rules="{
|
||||
<el-form-item
|
||||
label="配件数量:"
|
||||
:rules="{
|
||||
required: false,
|
||||
validator: numberIntegerValidator,
|
||||
trigger: 'blur',
|
||||
}">
|
||||
<el-input v-model="domain.partNum" placeholder="请输入" size="small" maxlength="10"
|
||||
style="width: 350px"></el-input>
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
v-model="domain.partNum"
|
||||
placeholder="请输入"
|
||||
size="small"
|
||||
maxlength="10"
|
||||
style="width: 350px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="维修内容:">
|
||||
<el-input v-model="domain.repairContent" maxlength="100" placeholder="请输入" show-word-limit size="small"
|
||||
style="width: 350px" type="textarea"></el-input>
|
||||
<el-input
|
||||
v-model="domain.repairContent"
|
||||
maxlength="100"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
type="textarea"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
|
|
@ -151,7 +309,11 @@
|
|||
</div> -->
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="rowObj.code == null || rowObj.code == ''">
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
v-if="rowObj.code == null || rowObj.code == ''"
|
||||
>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitTwo">保存</el-button>
|
||||
</div>
|
||||
|
|
@ -160,55 +322,56 @@
|
|||
</template>
|
||||
<script>
|
||||
import {
|
||||
submitRepairApplyApi, getUserSelectApi,
|
||||
getRepairMaTypeListApi, listPartType, getSupplierSelectApi
|
||||
} from "@/api/repairTest/repair";
|
||||
submitRepairApplyApi,
|
||||
getUserSelectApi,
|
||||
getRepairMaTypeListApi,
|
||||
listPartType,
|
||||
getSupplierSelectApi,
|
||||
} from '@/api/repairTest/repair'
|
||||
// import { listPartType, } from "@/api/store/tools";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {
|
||||
getInfo,
|
||||
} from "@/api/login";;
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { getInfo } from '@/api/login'
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
props: {
|
||||
// 弹窗是否显示
|
||||
isShowFlag: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
// 对应操作数据键值
|
||||
priKey: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
default: '',
|
||||
},
|
||||
//弹窗标题
|
||||
dialogTitle: {
|
||||
type: String,
|
||||
default: ""
|
||||
default: '',
|
||||
},
|
||||
//弹窗标题
|
||||
rowObj: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isShowFlag(val) {
|
||||
if (val) {
|
||||
this.init();
|
||||
}
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
dialogShowFlag: {
|
||||
get() {
|
||||
return this.isShowFlag;
|
||||
return this.isShowFlag
|
||||
},
|
||||
set(v) {
|
||||
this.$emit("update:isShowFlag", v);
|
||||
}
|
||||
}
|
||||
this.$emit('update:isShowFlag', v)
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -217,40 +380,40 @@ export default {
|
|||
dynamicValidateForm: {
|
||||
premiumList: [
|
||||
{
|
||||
selected: "Y",
|
||||
selected: 'Y',
|
||||
premium: undefined,
|
||||
rate: undefined,
|
||||
feeRate: undefined,
|
||||
fee: undefined,
|
||||
baofei1_unit: "",
|
||||
shangyoufeiyonge_unit: "",
|
||||
baofei1_unit: '',
|
||||
shangyoufeiyonge_unit: '',
|
||||
downRate: undefined,
|
||||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: ""
|
||||
}
|
||||
xiayoufeiyonge_unit: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
dynamicValidateFormTwo: {
|
||||
premiumListTwo: [
|
||||
{
|
||||
selected: "Y",
|
||||
selected: 'Y',
|
||||
premium: undefined,
|
||||
rate: undefined,
|
||||
feeRate: undefined,
|
||||
fee: undefined,
|
||||
baofei1_unit: "",
|
||||
shangyoufeiyonge_unit: "",
|
||||
baofei1_unit: '',
|
||||
shangyoufeiyonge_unit: '',
|
||||
downRate: undefined,
|
||||
downFee: undefined,
|
||||
xiayoufeiyonge_unit: ""
|
||||
}
|
||||
xiayoufeiyonge_unit: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
userSelectList: [],
|
||||
companyId: '',
|
||||
taskId: ""
|
||||
};
|
||||
taskId: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('taskId', (taskId) => {
|
||||
|
|
@ -261,69 +424,70 @@ export default {
|
|||
methods: {
|
||||
//正则校验配件费用
|
||||
meneyIntegerValidator(rule, value, callback) {
|
||||
const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
||||
const reg =
|
||||
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
if (value === '' || reg.test(value)) {
|
||||
callback();
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('请输入大于0的数'));
|
||||
callback(new Error('请输入大于0的数'))
|
||||
}
|
||||
},
|
||||
//正则校验配件数量--维修数量
|
||||
numberIntegerValidator(rule, value, callback) {
|
||||
const reg = /^\+?[1-9][0-9]*$/;
|
||||
const reg = /^\+?[1-9][0-9]*$/
|
||||
if (reg.test(value) && value <= this.rowObj.repairNum) {
|
||||
callback();
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('请输入大于0的并且小于维修总量的正整数'));
|
||||
callback(new Error('请输入大于0的并且小于维修总量的正整数'))
|
||||
}
|
||||
},
|
||||
getTree() {
|
||||
listPartType().then(response => {
|
||||
this.deptList = this.handleTree(response.data, "paId");
|
||||
});
|
||||
listPartType().then((response) => {
|
||||
this.deptList = this.handleTree(response.data, 'paId')
|
||||
})
|
||||
},
|
||||
/** 转换部门数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
id: node.paId,
|
||||
label: node.paName,
|
||||
children: node.children
|
||||
};
|
||||
children: node.children,
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
let params = {
|
||||
taskId: this.taskId
|
||||
taskId: this.taskId,
|
||||
}
|
||||
this.loading = true;
|
||||
getRepairMaTypeListApi(params).then(res => {
|
||||
this.loading = true
|
||||
getRepairMaTypeListApi(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.repairList = res.rows;
|
||||
this.total = res.total;
|
||||
this.loading = false;
|
||||
this.repairList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
init() {
|
||||
if (this.rowObj.code !== null && this.rowObj.code !== '') {
|
||||
this.dynamicValidateForm.premiumList = [];
|
||||
this.dynamicValidateFormTwo.premiumListTwo = [];
|
||||
this.addDomainOne();
|
||||
this.dynamicValidateForm.premiumList = []
|
||||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainOne()
|
||||
} else {
|
||||
this.dynamicValidateForm.premiumList = [];
|
||||
this.dynamicValidateFormTwo.premiumListTwo = [];
|
||||
this.addDomainTwo();
|
||||
this.dynamicValidateForm.premiumList = []
|
||||
this.dynamicValidateFormTwo.premiumListTwo = []
|
||||
this.addDomainTwo()
|
||||
}
|
||||
getSupplierSelectApi().then(res => {
|
||||
getSupplierSelectApi().then((res) => {
|
||||
this.supplierSelectList = res.data
|
||||
})
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.dialogShowFlag = false;
|
||||
this.dialogShowFlag = false
|
||||
// this.$refs["form"].resetFields();
|
||||
// this.dynamicValidateForm.premiumList = [];
|
||||
},
|
||||
|
|
@ -335,7 +499,7 @@ export default {
|
|||
// 维修内容 repairContent
|
||||
// 维修数量 repairNum
|
||||
this.dynamicValidateForm.premiumList.push({
|
||||
selected: "N",
|
||||
selected: 'N',
|
||||
partName: '',
|
||||
repairer: '',
|
||||
partType: '',
|
||||
|
|
@ -345,12 +509,12 @@ export default {
|
|||
supplierId: '',
|
||||
partPrice: '',
|
||||
repairNum: 1,
|
||||
key: Date.now()
|
||||
});
|
||||
key: Date.now(),
|
||||
})
|
||||
},
|
||||
addDomainTwo() {
|
||||
this.dynamicValidateFormTwo.premiumListTwo.push({
|
||||
selected: "N",
|
||||
selected: 'N',
|
||||
partName: '',
|
||||
repairer: '',
|
||||
partType: '',
|
||||
|
|
@ -358,18 +522,27 @@ export default {
|
|||
partCost: '',
|
||||
repairContent: '',
|
||||
repairNum: '',
|
||||
key: Date.now()
|
||||
});
|
||||
key: Date.now(),
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs["dynamicValidateForm"].validate(valid => {
|
||||
this.$refs['dynamicValidateForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dynamicValidateForm.premiumList.forEach(item => {
|
||||
item.partCost = item.partPrice;
|
||||
this.dynamicValidateForm.premiumList.forEach((item) => {
|
||||
item.partCost = item.partPrice
|
||||
})
|
||||
// this.dynamicValidateForm.premiumList[0].partCost = this.dynamicValidateForm.premiumList[0].partPrice;
|
||||
// 编码管理传递参数
|
||||
console.log('this.dynamicValidateForm.premiumList1111)', this.dynamicValidateForm.premiumList);
|
||||
|
||||
this.dynamicValidateForm.premiumList.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
console.log(
|
||||
'this.dynamicValidateForm.premiumList1111)',
|
||||
this.dynamicValidateForm.premiumList,
|
||||
)
|
||||
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
@ -379,10 +552,13 @@ export default {
|
|||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(this.dynamicValidateForm.premiumList)
|
||||
partStrList: JSON.stringify(
|
||||
this.dynamicValidateForm.premiumList,
|
||||
),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params).then(res => {
|
||||
submitRepairApplyApi(params)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getList()
|
||||
this.fullscreenLoading = false
|
||||
|
|
@ -390,23 +566,35 @@ export default {
|
|||
this.$message.success('操作成功!')
|
||||
this.$emit('domainChange', res.code)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
submitTwo() {
|
||||
this.$refs["dynamicValidateFormTwo"].validate(valid => {
|
||||
this.$refs['dynamicValidateFormTwo'].validate((valid) => {
|
||||
if (valid) {
|
||||
// this.dynamicValidateFormTwo.premiumListTwo[0].partCost = this.dynamicValidateFormTwo.premiumListTwo[0].partPrice;
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach(item => {
|
||||
item.partCost = item.partPrice;
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach(
|
||||
(item) => {
|
||||
item.partCost = item.partPrice
|
||||
},
|
||||
)
|
||||
|
||||
this.dynamicValidateFormTwo.premiumListTwo.forEach((e) => {
|
||||
if (e.partType == 0) {
|
||||
e.partCost = ''
|
||||
}
|
||||
})
|
||||
|
||||
console.log('this.dynamicValidateFormTwo.premiumListTwo2222', this.dynamicValidateFormTwo.premiumListTwo);
|
||||
console.log(
|
||||
'this.dynamicValidateFormTwo.premiumListTwo2222',
|
||||
this.dynamicValidateFormTwo.premiumListTwo,
|
||||
)
|
||||
// 数量管理传递参数
|
||||
let params = {
|
||||
taskId: this.rowObj.taskId,
|
||||
|
|
@ -416,10 +604,13 @@ export default {
|
|||
repairType: 2,
|
||||
companyId: this.companyId,
|
||||
repairNum: 1,
|
||||
partStrList: JSON.stringify(this.dynamicValidateFormTwo.premiumListTwo)
|
||||
partStrList: JSON.stringify(
|
||||
this.dynamicValidateFormTwo.premiumListTwo,
|
||||
),
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
submitRepairApplyApi(params).then(res => {
|
||||
submitRepairApplyApi(params)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getList()
|
||||
this.fullscreenLoading = false
|
||||
|
|
@ -427,16 +618,17 @@ export default {
|
|||
this.$message.success('操作成功!')
|
||||
this.$emit('domainChange', res.code)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.form_box_one {
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ module.exports = {
|
|||
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
|
||||
// target: `https://z.csgmall.com.cn`,
|
||||
|
||||
target: `http://192.168.2.134:28080`, //超
|
||||
// target: `http://192.168.2.134:28080`, //超
|
||||
// target: `http://10.40.92.81:28080`, //韩/
|
||||
// target: `http://10.40.92.74:8080`,//旭/
|
||||
target: `http://192.168.2.82:28080`,//旭/
|
||||
// target: `http://192.168.2.248:28080`, //帅
|
||||
// target: `http://192.168.2.209:28080`, //福
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue