字段修改
This commit is contained in:
parent
42cc440727
commit
fcfe1cdc40
|
|
@ -197,7 +197,16 @@ export function handleTree(data, id, parentId, children) {
|
||||||
adaptToChildrenList(c);
|
adaptToChildrenList(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (o.buyPrice !== undefined) {
|
||||||
|
o.buyPrice = formatBuyPrice(o.buyPrice);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
function formatBuyPrice(price) {
|
||||||
|
if (price === undefined || price === null) return '';
|
||||||
|
return parseFloat(price).toFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,24 +265,24 @@
|
||||||
:disabled="!isRequired"
|
:disabled="!isRequired"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<!-- <el-form-item-->
|
||||||
v-if="domain.partType == 1"
|
<!-- v-if="domain.partType == 1"-->
|
||||||
:prop="'premiumListTwo.' + index + '.partCost'"
|
<!-- :prop="'premiumListTwo.' + index + '.partCost'"-->
|
||||||
label="配件单价:"
|
<!-- label="配件单价:"-->
|
||||||
:rules="{
|
<!-- :rules="{-->
|
||||||
required: false,
|
<!-- required: false,-->
|
||||||
validator: meneyIntegerValidator,
|
<!-- validator: meneyIntegerValidator,-->
|
||||||
trigger: 'blur',
|
<!-- trigger: 'blur',-->
|
||||||
}"
|
<!-- }"-->
|
||||||
>
|
<!-- >-->
|
||||||
<el-input
|
<!-- <el-input-->
|
||||||
v-model="domain.partCost"
|
<!-- v-model="domain.partCost"-->
|
||||||
placeholder="请输入"
|
<!-- placeholder="请输入"-->
|
||||||
size="small"
|
<!-- size="small"-->
|
||||||
maxlength="10"
|
<!-- maxlength="10"-->
|
||||||
style="width: 350px"
|
<!-- style="width: 350px"-->
|
||||||
></el-input>
|
<!-- ></el-input>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:prop="'premiumListTwo.' + index + '.repairContent'"
|
:prop="'premiumListTwo.' + index + '.repairContent'"
|
||||||
label="维修内容:"
|
label="维修内容:"
|
||||||
|
|
@ -585,6 +585,7 @@ export default {
|
||||||
this.index = null
|
this.index = null
|
||||||
this.$message.success('操作成功!')
|
this.$message.success('操作成功!')
|
||||||
this.$emit('domainChange', res.code)
|
this.$emit('domainChange', res.code)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
||||||
|
|
@ -252,19 +252,19 @@
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
}"
|
}"
|
||||||
> -->
|
> -->
|
||||||
<el-form-item
|
<!-- <el-form-item-->
|
||||||
v-if="domain.partType == 1"
|
<!-- v-if="domain.partType == 1"-->
|
||||||
label="配件单价(元):"
|
<!-- label="配件单价(元):"-->
|
||||||
label-width="120px"
|
<!-- label-width="120px"-->
|
||||||
>
|
<!-- >-->
|
||||||
<el-input
|
<!-- <el-input-->
|
||||||
v-model="domain.partPrice"
|
<!-- v-model="domain.partPrice"-->
|
||||||
placeholder="请输入"
|
<!-- placeholder="请输入"-->
|
||||||
size="small"
|
<!-- size="small"-->
|
||||||
maxlength="10"
|
<!-- maxlength="10"-->
|
||||||
style="width: 330px"
|
<!-- style="width: 330px"-->
|
||||||
></el-input>
|
<!-- ></el-input>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="配件数量:"
|
label="配件数量:"
|
||||||
:rules="{
|
:rules="{
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="buyPrice"
|
prop="buyPrice"
|
||||||
label="购置价格"
|
label="价格"
|
||||||
min-width="260"
|
min-width="260"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -472,7 +472,9 @@ export default {
|
||||||
// this.loading = true;
|
// this.loading = true;
|
||||||
listPartType(this.queryParams)
|
listPartType(this.queryParams)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
console.log(this.deptList)
|
||||||
this.deptList = this.handleTree(response.data, 'paId')
|
this.deptList = this.handleTree(response.data, 'paId')
|
||||||
|
console.log(this.deptList)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -544,7 +546,7 @@ export default {
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset()
|
this.reset()
|
||||||
this.open = true
|
this.open = true
|
||||||
this.title = '修改部门'
|
this.title = '修改配件'
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
this.initGetPartType(row)
|
this.initGetPartType(row)
|
||||||
},
|
},
|
||||||
|
|
@ -554,6 +556,11 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.paId != undefined) {
|
if (this.form.paId != undefined) {
|
||||||
delete this.form.currentId
|
delete this.form.currentId
|
||||||
|
// 检查 buyPrice 是否为空或未定义,若如此则设为 null
|
||||||
|
this.form.buyPrice = this.form.buyPrice ? Number(this.form.buyPrice) : null;
|
||||||
|
// 检查 num 是否为空或未定义,若如此则设为 null
|
||||||
|
this.form.num = this.form.num ? Number(this.form.num) : null;
|
||||||
|
console.log(this.form)
|
||||||
updatePartTypeById(this.form).then((response) => {
|
updatePartTypeById(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess('修改成功')
|
this.$modal.msgSuccess('修改成功')
|
||||||
this.open = false
|
this.open = false
|
||||||
|
|
@ -641,6 +648,7 @@ export default {
|
||||||
this.form.currentId = row.parentId
|
this.form.currentId = row.parentId
|
||||||
},
|
},
|
||||||
async initGetPartType(row) {
|
async initGetPartType(row) {
|
||||||
|
console.log(row, '-----------------------')
|
||||||
const currentItem = this.getAllParentArr(
|
const currentItem = this.getAllParentArr(
|
||||||
this.deptList,
|
this.deptList,
|
||||||
row.parentId,
|
row.parentId,
|
||||||
|
|
|
||||||
|
|
@ -135,13 +135,13 @@
|
||||||
prop="buyPrice"
|
prop="buyPrice"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<!-- <el-table-column-->
|
||||||
label="丢失赔偿"
|
<!-- label="丢失赔偿"-->
|
||||||
align="center"
|
<!-- align="center"-->
|
||||||
key="payPrice"
|
<!-- key="payPrice"-->
|
||||||
prop="payPrice"
|
<!-- prop="payPrice"-->
|
||||||
show-overflow-tooltip
|
<!-- show-overflow-tooltip-->
|
||||||
/>
|
<!-- />-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="库管员"
|
label="库管员"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
@ -360,7 +360,6 @@
|
||||||
<el-form-item label="内部租赁价" prop="leasePrice">
|
<el-form-item label="内部租赁价" prop="leasePrice">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.leasePrice"
|
v-model="form.leasePrice"
|
||||||
type="number"
|
|
||||||
placeholder="请输入租赁价格"
|
placeholder="请输入租赁价格"
|
||||||
maxlength="10"
|
maxlength="10"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -617,20 +617,22 @@ export default {
|
||||||
/** 配件类型 */
|
/** 配件类型 */
|
||||||
getAccessoryTree() {
|
getAccessoryTree() {
|
||||||
getAccessoryTree().then((response) => {
|
getAccessoryTree().then((response) => {
|
||||||
this.equipmentTypeList = response.data
|
this.equipmentTypeList = response.data;
|
||||||
|
|
||||||
this.equipmentTypeList.forEach((item, index) => {
|
this.equipmentTypeList.forEach((item, index) => {
|
||||||
if (item.children.length > 0) {
|
// 确保 item.children 是一个数组
|
||||||
|
if (Array.isArray(item.children) && item.children.length > 0) {
|
||||||
item.children.forEach((item2, index2) => {
|
item.children.forEach((item2, index2) => {
|
||||||
if (item2.children.length > 0) {
|
// 同样检查 item2.children 是否是一个数组
|
||||||
|
if (Array.isArray(item2.children) && item2.children.length > 0) {
|
||||||
item2.children.forEach((item3) => {
|
item2.children.forEach((item3) => {
|
||||||
item3.machineTypeName = item2.label
|
item3.machineTypeName = item2.label;
|
||||||
item3.specificationType = item3.label
|
item3.specificationType = item3.label;
|
||||||
item3.partId = item3.id
|
item3.partId = item3.id;
|
||||||
// item3.purchasePrice = 1
|
// 使用 Vue 的 $set 方法确保响应式
|
||||||
// item3.purchaseNum = 1
|
this.$set(item3, 'purchasePrice', 0);
|
||||||
this.$set(item3, 'purchasePrice', 0)
|
this.$set(item3, 'purchaseNum', 1);
|
||||||
this.$set(item3, 'purchaseNum', 1)
|
});
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -647,6 +649,7 @@ export default {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$set(row, 'supplierId', '')
|
this.$set(row, 'supplierId', '')
|
||||||
this.$set(row, 'purchasePrice', 0)
|
this.$set(row, 'purchasePrice', 0)
|
||||||
this.$set(row, 'purchaseNum', 1)
|
this.$set(row, 'purchaseNum', 1)
|
||||||
|
|
@ -676,6 +679,7 @@ export default {
|
||||||
|
|
||||||
this.maForm.taskId = this.taskId
|
this.maForm.taskId = this.taskId
|
||||||
this.maForm.partDetailsList = this.equipmentList
|
this.maForm.partDetailsList = this.equipmentList
|
||||||
|
|
||||||
console.log(this.maForm)
|
console.log(this.maForm)
|
||||||
if (isEmpty) {
|
if (isEmpty) {
|
||||||
if (this.equipmentList.length > 0) {
|
if (this.equipmentList.length > 0) {
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ export default {
|
||||||
this.isDisabled = false
|
this.isDisabled = false
|
||||||
this.isCheck = false
|
this.isCheck = false
|
||||||
this.isShow = true
|
this.isShow = true
|
||||||
|
this.isEdit = false
|
||||||
},
|
},
|
||||||
/* 查询配件 */
|
/* 查询配件 */
|
||||||
queryParts(taskId) {
|
queryParts(taskId) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue