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