代码优化

This commit is contained in:
BianLzhaoMin 2024-08-22 16:34:54 +08:00
parent 0ae75af787
commit a35e94d627
1 changed files with 30 additions and 10 deletions

View File

@ -52,7 +52,7 @@
</el-select>
</el-form-item>
<el-form-item label="工机具类型" prop="typeId">
<el-cascader
<!-- <el-cascader
v-model="queryParams.typeId"
:options="deptOptions"
:props="{
@ -64,7 +64,14 @@
@change="handleNodeClick"
aria-placeholder="请选择极具类型"
style="width: 240px"
></el-cascader>
></el-cascader> -->
<Tree
ref="mychildSon"
:width="240"
:dataList="deptList"
@changeId="selectDrop"
></Tree>
</el-form-item>
<el-form-item label="退料申请时间" prop="time">
<el-date-picker
@ -599,17 +606,20 @@ import {
// getUseNumByTypeId
} from '@/api/claimAndRefund/receive.js'
import dialogFormByCq from '@/views/claimAndRefund/return/dialogFormByCq.vue'
import Tree from '@/views/claimAndRefund/return/tree.vue'
import { listPartTypeApi } from '@/api/repairTest/repair'
// 10:42startTime,endTime typeId
// http://localhost/claimAndRefund/return/returnApply
export default {
name: '',
dicts: ['sys_normal_disable'],
components: { dialogFormByCq },
components: { dialogFormByCq, Tree },
data() {
return {
fullscreenLoading: false,
type: '',
isShowOneFlag: false,
deptList: [],
priKey: '',
//
loading: true,
@ -710,12 +720,21 @@ export default {
// this.getList();
this.initSelectData()
this.InitIGetInfo()
this.initGetUseTypeTree()
this.getTree()
// this.initGetUseTypeTree()
},
methods: {
// claimAndRefund/return/returnApplyAdd
// claimAndRefund/return/returnApplyAdd
/** 查询字典类型列表 startTime,结束日期endTime */
selectDrop(value) {
this.queryParams.typeId = value
},
getTree() {
listPartTypeApi().then((response) => {
this.deptList = response.data
})
},
async getList() {
this.loading = true
if (this.queryParams.time && this.queryParams.time.length > 0) {
@ -758,6 +777,7 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
this.queryParams.typeId = ''
// this.resetForm("queryForm");
this.$refs.queryForm.resetFields()
this.initSelectData()
@ -969,7 +989,7 @@ export default {
const res = await getAgreementInfoById(params)
// this.proList = res.data
this.queryParams.agreementCode = res.data.agreementCode
// this.initGetUseTypeTree(res.data.agreementId)
this.initGetUseTypeTree(res.data.agreementId)
},
getAgreementByUnitAndProId() {
this.InitGetAgreementInfoById()
@ -987,11 +1007,11 @@ export default {
this.dialogQueryParams.keyWord = ''
this.getDialogList()
},
async initGetUseTypeTree() {
// let params = {
// agreementId: id,
// }
const res = await getUseTypeTree()
async initGetUseTypeTree(id) {
let params = {
agreementId: id,
}
const res = await getUseTypeTree(params)
console.log('res-getUseTypeTree', res)
this.deptOptions = res.data
},