优化新购配件页面回显问题
This commit is contained in:
parent
5c3c788d71
commit
eab8f94c0e
|
|
@ -7,6 +7,7 @@
|
||||||
size="small"
|
size="small"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="80px"
|
label-width="80px"
|
||||||
|
:disabled="isView || isAccept"
|
||||||
>
|
>
|
||||||
<el-form-item label="采购日期" prop="purchaseTime">
|
<el-form-item label="采购日期" prop="purchaseTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
|
@ -14,7 +15,6 @@
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
type="date"
|
type="date"
|
||||||
:disabled="isDisabled"
|
|
||||||
placeholder="请选择采购日期"
|
placeholder="请选择采购日期"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
type="date"
|
type="date"
|
||||||
:disabled="isDisabled"
|
|
||||||
:picker-options="pickerOptions"
|
:picker-options="pickerOptions"
|
||||||
placeholder="请选择到货日期"
|
placeholder="请选择到货日期"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
|
|
@ -35,7 +34,6 @@
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择采购员"
|
placeholder="请选择采购员"
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
:disabled="isDisabled"
|
|
||||||
>
|
>
|
||||||
<el-option label="请选择" :value="0"></el-option>
|
<el-option label="请选择" :value="0"></el-option>
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -51,7 +49,6 @@
|
||||||
v-model="maForm.remark"
|
v-model="maForm.remark"
|
||||||
placeholder="请输入备注"
|
placeholder="请输入备注"
|
||||||
clearable
|
clearable
|
||||||
:disabled="isDisabled"
|
|
||||||
type="textarea"
|
type="textarea"
|
||||||
maxlength="150"
|
maxlength="150"
|
||||||
rows="1"
|
rows="1"
|
||||||
|
|
@ -67,6 +64,7 @@
|
||||||
:inline="true"
|
:inline="true"
|
||||||
v-show="showSearch"
|
v-show="showSearch"
|
||||||
label-width="80px"
|
label-width="80px"
|
||||||
|
:disabled="isView || isAccept"
|
||||||
>
|
>
|
||||||
<el-form-item label="配件类型" prop="equipmentId">
|
<el-form-item label="配件类型" prop="equipmentId">
|
||||||
<treeselect
|
<treeselect
|
||||||
|
|
@ -76,7 +74,7 @@
|
||||||
:disable-branch-nodes="true"
|
:disable-branch-nodes="true"
|
||||||
placeholder="请选择机具类型"
|
placeholder="请选择机具类型"
|
||||||
@select="select"
|
@select="select"
|
||||||
:disabled="isDisabled"
|
:disabled="isView || isAccept"
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -86,7 +84,6 @@
|
||||||
placeholder="配件厂家"
|
placeholder="配件厂家"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
:disabled="isDisabled"
|
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
@change="changeSupplier"
|
@change="changeSupplier"
|
||||||
>
|
>
|
||||||
|
|
@ -117,7 +114,7 @@
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
v-if="!isDisabled"
|
v-if="isAdd || isEdit"
|
||||||
@click="handleSave"
|
@click="handleSave"
|
||||||
>保存</el-button
|
>保存</el-button
|
||||||
>
|
>
|
||||||
|
|
@ -128,7 +125,7 @@
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
v-if="isCheck"
|
v-if="isAccept"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleListCheck"
|
@click="handleListCheck"
|
||||||
v-hasPermi="['newPurchase:parts:notice:accept:batch']"
|
v-hasPermi="['newPurchase:parts:notice:accept:batch']"
|
||||||
|
|
@ -195,7 +192,7 @@
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="scope.row.purchasePrice"
|
v-model="scope.row.purchasePrice"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:disabled="isCheck || isView"
|
:disabled="isView || isAccept"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:min="0"
|
:min="0"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
|
|
@ -207,7 +204,7 @@
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="scope.row.purchaseNum"
|
v-model="scope.row.purchaseNum"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:disabled="isCheck || isView"
|
:disabled="isView || isAccept"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:min="1"
|
:min="1"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
|
|
@ -227,7 +224,7 @@
|
||||||
placeholder="厂家"
|
placeholder="厂家"
|
||||||
clearable
|
clearable
|
||||||
style="width: 180px"
|
style="width: 180px"
|
||||||
:disabled="isCheck || isView"
|
:disabled="isView || isAccept"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in supplierList"
|
v-for="item in supplierList"
|
||||||
|
|
@ -247,14 +244,14 @@
|
||||||
label="操作"
|
label="操作"
|
||||||
align="center"
|
align="center"
|
||||||
class-name="small-padding fixed-width"
|
class-name="small-padding fixed-width"
|
||||||
v-if="!isView"
|
v-if="!isView || isAccept"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
v-if="isCheck && scope.row.status == 0"
|
v-if="isAccept && scope.row.status == 0"
|
||||||
@click="handleCheck(scope.row)"
|
@click="handleCheck(scope.row)"
|
||||||
v-hasPermi="['newPurchase:parts:notice:accept']"
|
v-hasPermi="['newPurchase:parts:notice:accept']"
|
||||||
>验收</el-button
|
>验收</el-button
|
||||||
|
|
@ -263,7 +260,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
v-if="!isCheck && scope.row.status == 0"
|
v-if="isEdit && scope.row.status == 0"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
|
|
@ -271,7 +268,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
v-if="isShow"
|
v-if="isAdd"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
|
|
@ -414,13 +411,13 @@ export default {
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isCheck: {
|
isAdd: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: () => {
|
default: () => {
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isDisabled: {
|
isAccept: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: () => {
|
default: () => {
|
||||||
return false
|
return false
|
||||||
|
|
@ -428,6 +425,7 @@ export default {
|
||||||
},
|
},
|
||||||
partsTaskId: {
|
partsTaskId: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
|
default: () => null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -587,15 +585,20 @@ export default {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
this.taskId = this.partsTaskId
|
this.taskId = this.partsTaskId
|
||||||
|
|
||||||
|
// 如果传入了 taskId 则需要查询详情
|
||||||
|
if (this.partsTaskId) {
|
||||||
|
this.getTaskInfo()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getUserList()
|
this.getUserList()
|
||||||
this.supplierInfoList()
|
this.supplierInfoList()
|
||||||
this.getAccessoryTree()
|
this.getAccessoryTree()
|
||||||
|
|
||||||
if (this.isView) {
|
// if (this.isView) {
|
||||||
this.getTaskInfo()
|
// this.getTaskInfo()
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询用户列表--采购员 */
|
/** 查询用户列表--采购员 */
|
||||||
|
|
|
||||||
|
|
@ -534,7 +534,9 @@ export default {
|
||||||
// path: '/store/newBuy/newAccessoryAccept',
|
// path: '/store/newBuy/newAccessoryAccept',
|
||||||
// query,
|
// query,
|
||||||
// })
|
// })
|
||||||
this.$emit('editParts', row.taskId)
|
// this.$emit('editParts', row.taskId)
|
||||||
|
|
||||||
|
this.$emit('handleParts', 2, row.taskId)
|
||||||
},
|
},
|
||||||
/** 查看按钮操作 */
|
/** 查看按钮操作 */
|
||||||
handleView(row) {
|
handleView(row) {
|
||||||
|
|
@ -544,7 +546,8 @@ export default {
|
||||||
// query,
|
// query,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
this.$emit('queryParts', row.taskId)
|
// this.$emit('queryParts', row.taskId)
|
||||||
|
this.$emit('handleParts', 3, row.taskId)
|
||||||
},
|
},
|
||||||
/** 验收按钮操作 */
|
/** 验收按钮操作 */
|
||||||
handleCheck(row) {
|
handleCheck(row) {
|
||||||
|
|
@ -553,7 +556,8 @@ export default {
|
||||||
// path: '/store/newBuy/newAccessoryAccept',
|
// path: '/store/newBuy/newAccessoryAccept',
|
||||||
// query,
|
// query,
|
||||||
// })
|
// })
|
||||||
this.$emit('acceptParts', row.taskId)
|
// this.$emit('acceptParts', row.taskId)
|
||||||
|
this.$emit('handleParts', 4, row.taskId)
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function () {
|
||||||
|
|
@ -600,7 +604,9 @@ export default {
|
||||||
// path: '/store/newBuy/newAccessoryAccept',
|
// path: '/store/newBuy/newAccessoryAccept',
|
||||||
// query,
|
// query,
|
||||||
// })
|
// })
|
||||||
this.$emit('addParts')
|
// this.$emit('addParts')
|
||||||
|
|
||||||
|
this.$emit('handleParts', 1)
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,10 @@
|
||||||
:partsTaskId="partsTaskId"
|
:partsTaskId="partsTaskId"
|
||||||
:isView="isView"
|
:isView="isView"
|
||||||
:isEdit="isEdit"
|
:isEdit="isEdit"
|
||||||
:isCheck="isCheck"
|
:isAdd="isAdd"
|
||||||
:isDisabled="isDisabled"
|
:isAccept="isAccept"
|
||||||
@addParts="addParts"
|
|
||||||
@queryParts="queryParts"
|
|
||||||
@editParts="editParts"
|
|
||||||
@acceptParts="acceptParts"
|
|
||||||
@partsSaveSuccess="partsSaveSuccess"
|
@partsSaveSuccess="partsSaveSuccess"
|
||||||
|
@handleParts="handleParts"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -39,40 +36,81 @@ export default {
|
||||||
partsTaskId: '',
|
partsTaskId: '',
|
||||||
isView: false,
|
isView: false,
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
isCheck: false,
|
isAdd: false,
|
||||||
isDisabled: false,
|
isAccept: false,
|
||||||
|
// isCheck: false,
|
||||||
|
// isDisabled: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/* 新增配件 */
|
/* 新增配件 */
|
||||||
addParts() {
|
// addParts() {
|
||||||
this.pageContent = '新增配件'
|
// this.pageContent = '新增配件'
|
||||||
this.isShowComponent = 'AddParts'
|
// this.isShowComponent = 'AddParts'
|
||||||
},
|
// },
|
||||||
/* 查询配件 */
|
// /* 查询配件 */
|
||||||
queryParts(taskId) {
|
// queryParts(taskId) {
|
||||||
this.partsTaskId = taskId
|
// this.partsTaskId = taskId
|
||||||
this.isView = true
|
// this.isView = true
|
||||||
this.isDisabled = true
|
// this.isDisabled = true
|
||||||
this.isShowComponent = 'AddParts'
|
// this.isShowComponent = 'AddParts'
|
||||||
},
|
// },
|
||||||
/* 新增 修改保存成功 */
|
/* 新增 修改保存成功 */
|
||||||
partsSaveSuccess() {
|
partsSaveSuccess() {
|
||||||
this.isShowComponent = 'Home'
|
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.partsTaskId = taskId
|
||||||
this.isView = true
|
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
this.isShowComponent = 'AddParts'
|
this.isAdd = false
|
||||||
},
|
this.isView = false
|
||||||
/* 验收配件 */
|
this.isAccept = false
|
||||||
acceptParts(taskId) {
|
break
|
||||||
|
case 3:
|
||||||
|
this.pageContent = '配件详情'
|
||||||
this.partsTaskId = taskId
|
this.partsTaskId = taskId
|
||||||
|
this.isEdit = false
|
||||||
|
this.isAdd = false
|
||||||
this.isView = true
|
this.isView = true
|
||||||
this.isDisabled = true
|
this.isAccept = false
|
||||||
this.isCheck = true
|
break
|
||||||
|
case 4:
|
||||||
|
this.pageContent = '配件验收'
|
||||||
|
this.partsTaskId = taskId
|
||||||
|
this.isEdit = false
|
||||||
|
this.isAdd = false
|
||||||
|
this.isAccept = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
this.isShowComponent = 'AddParts'
|
this.isShowComponent = 'AddParts'
|
||||||
},
|
},
|
||||||
/* 返回按钮 */
|
/* 返回按钮 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue