优化新购配件页面回显问题

This commit is contained in:
BianLzhaoMin 2024-06-19 11:20:54 +08:00
parent 5c3c788d71
commit eab8f94c0e
3 changed files with 103 additions and 56 deletions

View File

@ -7,6 +7,7 @@
size="small"
:inline="true"
label-width="80px"
:disabled="isView || isAccept"
>
<el-form-item label="采购日期" prop="purchaseTime">
<el-date-picker
@ -14,7 +15,6 @@
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
:disabled="isDisabled"
placeholder="请选择采购日期"
></el-date-picker>
</el-form-item>
@ -24,7 +24,6 @@
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
:disabled="isDisabled"
:picker-options="pickerOptions"
placeholder="请选择到货日期"
></el-date-picker>
@ -35,7 +34,6 @@
filterable
placeholder="请选择采购员"
style="width: 240px"
:disabled="isDisabled"
>
<el-option label="请选择" :value="0"></el-option>
<el-option
@ -51,7 +49,6 @@
v-model="maForm.remark"
placeholder="请输入备注"
clearable
:disabled="isDisabled"
type="textarea"
maxlength="150"
rows="1"
@ -67,6 +64,7 @@
:inline="true"
v-show="showSearch"
label-width="80px"
:disabled="isView || isAccept"
>
<el-form-item label="配件类型" prop="equipmentId">
<treeselect
@ -76,7 +74,7 @@
:disable-branch-nodes="true"
placeholder="请选择机具类型"
@select="select"
:disabled="isDisabled"
:disabled="isView || isAccept"
style="width: 240px"
/>
</el-form-item>
@ -86,7 +84,6 @@
placeholder="配件厂家"
clearable
filterable
:disabled="isDisabled"
style="width: 240px"
@change="changeSupplier"
>
@ -117,7 +114,7 @@
plain
icon="el-icon-plus"
size="mini"
v-if="!isDisabled"
v-if="isAdd || isEdit"
@click="handleSave"
>保存</el-button
>
@ -128,7 +125,7 @@
plain
icon="el-icon-plus"
size="mini"
v-if="isCheck"
v-if="isAccept"
:disabled="multiple"
@click="handleListCheck"
v-hasPermi="['newPurchase:parts:notice:accept:batch']"
@ -195,7 +192,7 @@
<el-input-number
v-model="scope.row.purchasePrice"
controls-position="right"
:disabled="isCheck || isView"
:disabled="isView || isAccept"
style="width: 100%"
:min="0"
></el-input-number>
@ -207,7 +204,7 @@
<el-input-number
v-model="scope.row.purchaseNum"
controls-position="right"
:disabled="isCheck || isView"
:disabled="isView || isAccept"
style="width: 100%"
:min="1"
></el-input-number>
@ -227,7 +224,7 @@
placeholder="厂家"
clearable
style="width: 180px"
:disabled="isCheck || isView"
:disabled="isView || isAccept"
>
<el-option
v-for="item in supplierList"
@ -247,14 +244,14 @@
label="操作"
align="center"
class-name="small-padding fixed-width"
v-if="!isView"
v-if="!isView || isAccept"
>
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="isCheck && scope.row.status == 0"
v-if="isAccept && scope.row.status == 0"
@click="handleCheck(scope.row)"
v-hasPermi="['newPurchase:parts:notice:accept']"
>验收</el-button
@ -263,7 +260,7 @@
size="mini"
type="text"
icon="el-icon-delete"
v-if="!isCheck && scope.row.status == 0"
v-if="isEdit && scope.row.status == 0"
@click="handleDelete(scope.row)"
>删除</el-button
>
@ -271,7 +268,7 @@
size="mini"
type="text"
icon="el-icon-delete"
v-if="isShow"
v-if="isAdd"
@click="handleDelete(scope.row)"
>删除</el-button
>
@ -414,13 +411,13 @@ export default {
return false
},
},
isCheck: {
isAdd: {
type: Boolean,
default: () => {
return false
},
},
isDisabled: {
isAccept: {
type: Boolean,
default: () => {
return false
@ -428,6 +425,7 @@ export default {
},
partsTaskId: {
type: [String, Number],
default: () => null,
},
},
data() {
@ -587,15 +585,20 @@ export default {
// }
this.taskId = this.partsTaskId
// taskId
if (this.partsTaskId) {
this.getTaskInfo()
}
},
mounted() {
this.getUserList()
this.supplierInfoList()
this.getAccessoryTree()
if (this.isView) {
this.getTaskInfo()
}
// if (this.isView) {
// this.getTaskInfo()
// }
},
methods: {
/** 查询用户列表--采购员 */

View File

@ -534,7 +534,9 @@ export default {
// path: '/store/newBuy/newAccessoryAccept',
// query,
// })
this.$emit('editParts', row.taskId)
// this.$emit('editParts', row.taskId)
this.$emit('handleParts', 2, row.taskId)
},
/** 查看按钮操作 */
handleView(row) {
@ -544,7 +546,8 @@ export default {
// query,
// })
this.$emit('queryParts', row.taskId)
// this.$emit('queryParts', row.taskId)
this.$emit('handleParts', 3, row.taskId)
},
/** 验收按钮操作 */
handleCheck(row) {
@ -553,7 +556,8 @@ export default {
// path: '/store/newBuy/newAccessoryAccept',
// query,
// })
this.$emit('acceptParts', row.taskId)
// this.$emit('acceptParts', row.taskId)
this.$emit('handleParts', 4, row.taskId)
},
/** 提交按钮 */
submitForm: function () {
@ -600,7 +604,9 @@ export default {
// path: '/store/newBuy/newAccessoryAccept',
// query,
// })
this.$emit('addParts')
// this.$emit('addParts')
this.$emit('handleParts', 1)
},
/** 删除按钮操作 */
handleDelete(row) {

View File

@ -11,13 +11,10 @@
:partsTaskId="partsTaskId"
:isView="isView"
:isEdit="isEdit"
:isCheck="isCheck"
:isDisabled="isDisabled"
@addParts="addParts"
@queryParts="queryParts"
@editParts="editParts"
@acceptParts="acceptParts"
:isAdd="isAdd"
:isAccept="isAccept"
@partsSaveSuccess="partsSaveSuccess"
@handleParts="handleParts"
/>
</div>
</template>
@ -39,40 +36,81 @@ export default {
partsTaskId: '',
isView: false,
isEdit: false,
isCheck: false,
isDisabled: false,
isAdd: false,
isAccept: false,
// isCheck: false,
// isDisabled: false,
}
},
methods: {
/* 新增配件 */
addParts() {
this.pageContent = '新增配件'
this.isShowComponent = 'AddParts'
},
/* 查询配件 */
queryParts(taskId) {
this.partsTaskId = taskId
this.isView = true
this.isDisabled = true
this.isShowComponent = 'AddParts'
},
// addParts() {
// this.pageContent = ''
// this.isShowComponent = 'AddParts'
// },
// /* */
// queryParts(taskId) {
// this.partsTaskId = taskId
// this.isView = true
// this.isDisabled = true
// this.isShowComponent = 'AddParts'
// },
/* 新增 修改保存成功 */
partsSaveSuccess() {
this.isShowComponent = 'Home'
},
/* 编辑配件 */
editParts(taskId) {
// /* */
// editParts(taskId) {
// this.partsTaskId = taskId
// this.isView = true
// this.isEdit = true
// this.isShowComponent = 'AddParts'
// },
// /* */
// acceptParts(taskId) {
// this.partsTaskId = taskId
// this.isView = true
// this.isDisabled = true
// this.isCheck = true
// this.isShowComponent = 'AddParts'
// },
//
handleParts(type, taskId) {
switch (type) {
case 1:
this.pageContent = '新增配件'
this.partsTaskId = null
this.isAdd = true
this.isEdit = false
this.isView = false
this.isAccept = false
break
case 2:
this.pageContent = '编辑配件'
this.partsTaskId = taskId
this.isView = true
this.isEdit = true
this.isShowComponent = 'AddParts'
},
/* 验收配件 */
acceptParts(taskId) {
this.isAdd = false
this.isView = false
this.isAccept = false
break
case 3:
this.pageContent = '配件详情'
this.partsTaskId = taskId
this.isEdit = false
this.isAdd = false
this.isView = true
this.isDisabled = true
this.isCheck = true
this.isAccept = false
break
case 4:
this.pageContent = '配件验收'
this.partsTaskId = taskId
this.isEdit = false
this.isAdd = false
this.isAccept = true
break
}
this.isShowComponent = 'AddParts'
},
/* 返回按钮 */