代码优化

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