字段修改

This commit is contained in:
wcy 2024-09-06 15:35:16 +08:00
parent 42cc440727
commit fcfe1cdc40
7 changed files with 102 additions and 80 deletions

View File

@ -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;
} }

View File

@ -97,24 +97,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="'premiumList.' + index + '.partCost'" :prop="'premiumList.' + 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="'premiumList.' + index + '.repairContent'" :prop="'premiumList.' + index + '.repairContent'"
label="维修内容:" label="维修内容:"
@ -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(() => {

View File

@ -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="{

View File

@ -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,

View File

@ -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"
/> />

View File

@ -75,7 +75,7 @@
:disable-branch-nodes="true" :disable-branch-nodes="true"
placeholder="请选择机具类型" placeholder="请选择机具类型"
@select="select" @select="select"
:disabled="isDisabled" :disabled="isDisabled "
style="width: 240px" style="width: 240px"
/> />
</el-form-item> </el-form-item>
@ -140,7 +140,7 @@
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
>删除</el-button> >删除</el-button>
</el-col>--> </el-col>-->
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
@ -149,7 +149,7 @@
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
>导出</el-button> >导出</el-button>
</el-col>--> </el-col>-->
</el-row> </el-row>
@ -358,9 +358,9 @@
> >
</el-form-item> </el-form-item>
<!-- <el-form-item label="验收图片" prop="checkUrl"> <!-- <el-form-item label="验收图片" prop="checkUrl">
<el-upload <el-upload
:http-request="(obj) => imgUpLoad(obj,'fileUrl')" :http-request="(obj) => imgUpLoad(obj,'fileUrl')"
action="#" action="#"
:file-list="fileList" :file-list="fileList"
:show-file-list="false" :show-file-list="false"
list-type="picture-card" list-type="picture-card"
@ -616,21 +616,23 @@ export default {
}, },
/** 配件类型 */ /** 配件类型 */
getAccessoryTree() { getAccessoryTree() {
getAccessoryTree().then((response) => { getAccessoryTree().then((response) => {
this.equipmentTypeList = response.data this.equipmentTypeList = response.data;
this.equipmentTypeList.forEach((item, index) => {
if (item.children.length > 0) { this.equipmentTypeList.forEach((item, index) => {
item.children.forEach((item2, index2) => { // item.children
if (item2.children.length > 0) { if (Array.isArray(item.children) && item.children.length > 0) {
item2.children.forEach((item3) => { item.children.forEach((item2, index2) => {
item3.machineTypeName = item2.label // item2.children
item3.specificationType = item3.label if (Array.isArray(item2.children) && item2.children.length > 0) {
item3.partId = item3.id item2.children.forEach((item3) => {
// item3.purchasePrice = 1 item3.machineTypeName = item2.label;
// item3.purchaseNum = 1 item3.specificationType = item3.label;
this.$set(item3, 'purchasePrice', 0) item3.partId = item3.id;
this.$set(item3, 'purchaseNum', 1) // 使 Vue $set
}) this.$set(item3, 'purchasePrice', 0);
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) {

View File

@ -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) {
@ -99,4 +100,4 @@ export default {
</script> </script>
<style> <style>
</style> </style>