Merge remote-tracking branch 'origin/material-ui' into material-ui
This commit is contained in:
		
						commit
						e2946c75fe
					
				| 
						 | 
				
			
			@ -4,3 +4,8 @@ import request from '@/utils/request'
 | 
			
		|||
export const getUseMaintenanceWarningApi = data => {
 | 
			
		||||
    return request.get('/material/useMaintenanceWarning/list', { params: data })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取4级类型内容
 | 
			
		||||
export const getMaTypeApi = data => {
 | 
			
		||||
    return request.post('/material/select/getMaType', data)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -781,7 +781,8 @@ export default {
 | 
			
		|||
            approveSignList: [],
 | 
			
		||||
            currentRowData: null, // 当前查看的行数据
 | 
			
		||||
            leaseLoading: false,
 | 
			
		||||
            taskType: ''
 | 
			
		||||
            taskType: '',
 | 
			
		||||
            currentRow: {},
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    created() {
 | 
			
		||||
| 
						 | 
				
			
			@ -847,7 +848,12 @@ export default {
 | 
			
		|||
                    parentId: this.parentIdTemp,
 | 
			
		||||
                    outNum: 1,
 | 
			
		||||
                    publishTask: this.publishTask,
 | 
			
		||||
                    jiJuType: item.jiJuType
 | 
			
		||||
                    jiJuType: item.jiJuType,
 | 
			
		||||
                    leaseUnit: this.currentRow.leaseUnit,
 | 
			
		||||
                    leaseUnitId: this.currentRow.leaseUnitId,
 | 
			
		||||
                    leaseProject: this.currentRow.leaseProject,
 | 
			
		||||
                    leaseProjectId: this.currentRow.leaseProjectId,
 | 
			
		||||
                    taskId: this.currentRow.taskId
 | 
			
		||||
                })
 | 
			
		||||
            })
 | 
			
		||||
            this.single = selection.length != 1
 | 
			
		||||
| 
						 | 
				
			
			@ -957,6 +963,8 @@ export default {
 | 
			
		|||
 | 
			
		||||
        /** 出库按钮操作 */
 | 
			
		||||
        handleOut(row) {
 | 
			
		||||
            this.currentRow = row
 | 
			
		||||
            // console.log('🚀 ~ handleOut ~ this.currentRow:', this.currentRow)
 | 
			
		||||
            this.getListOutInfo = []
 | 
			
		||||
            const { id, publishTask } = row
 | 
			
		||||
            this.publishTask = publishTask
 | 
			
		||||
| 
						 | 
				
			
			@ -983,7 +991,7 @@ export default {
 | 
			
		|||
            // console.log(row)
 | 
			
		||||
            let obj = {}
 | 
			
		||||
            console.log('row', row)
 | 
			
		||||
            this.$set(obj, 'taskId', row.taskId)
 | 
			
		||||
            // this.$set(obj, 'taskId', row.taskId)
 | 
			
		||||
            this.$set(obj, 'id', row.id)
 | 
			
		||||
            this.$set(obj, 'manageType', 1)
 | 
			
		||||
            this.$set(obj, 'maId', row.maId)
 | 
			
		||||
| 
						 | 
				
			
			@ -997,6 +1005,11 @@ export default {
 | 
			
		|||
            this.$set(obj, 'num', row.num) //库存
 | 
			
		||||
            this.$set(obj, 'unitValue', row.unitValue)
 | 
			
		||||
            this.$set(obj, 'unitName', row.unitName)
 | 
			
		||||
            this.$set(obj, 'leaseUnit', this.currentRow.leaseUnit)
 | 
			
		||||
            this.$set(obj, 'leaseUnitId', this.currentRow.leaseUnitId)
 | 
			
		||||
            this.$set(obj, 'leaseProject', this.currentRow.leaseProject)
 | 
			
		||||
            this.$set(obj, 'leaseProjectId', this.currentRow.leaseProjectId)
 | 
			
		||||
            this.$set(obj, 'taskId', this.currentRow.taskId)
 | 
			
		||||
            console.log('[obj]', [obj])
 | 
			
		||||
            this.outNumList = [obj]
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -734,13 +734,14 @@ export default {
 | 
			
		|||
      this.isBatchMode = false
 | 
			
		||||
      this.dialogTitle = '新增授权'
 | 
			
		||||
      this.resetAuthForm()
 | 
			
		||||
      this.getTeamList()
 | 
			
		||||
      this.getTeamList(row.externalId)
 | 
			
		||||
 | 
			
		||||
      // 初始化领料人数据
 | 
			
		||||
      this.materialReceivers = [
 | 
			
		||||
        {
 | 
			
		||||
          name: '',
 | 
			
		||||
          idNumber: '',
 | 
			
		||||
          phone:'',
 | 
			
		||||
          idFrontPhoto: null,
 | 
			
		||||
          idBackPhoto: null,
 | 
			
		||||
          frontUploading: false,
 | 
			
		||||
| 
						 | 
				
			
			@ -763,18 +764,28 @@ export default {
 | 
			
		|||
        return
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      // 检查所有选中的申请单是否属于同一个班组
 | 
			
		||||
      const firstTeamId = this.selectedItems[0].externalId
 | 
			
		||||
      const allSameTeam = this.selectedItems.every(item => item.externalId === firstTeamId)
 | 
			
		||||
 | 
			
		||||
      if (!allSameTeam) {
 | 
			
		||||
        this.$message.error('批量授权只能选择相同班组的申请单')
 | 
			
		||||
        return
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.authDialogVisible = true
 | 
			
		||||
      this.isEditMode = false
 | 
			
		||||
      this.isBatchMode = true
 | 
			
		||||
      this.dialogTitle = `批量授权 (${this.selectedItems.length}条)`
 | 
			
		||||
      this.resetAuthForm()
 | 
			
		||||
      this.getTeamList()
 | 
			
		||||
      this.getTeamList(firstTeamId)
 | 
			
		||||
 | 
			
		||||
      // 初始化领料人数据
 | 
			
		||||
      this.materialReceivers = [
 | 
			
		||||
        {
 | 
			
		||||
          name: '',
 | 
			
		||||
          idNumber: '',
 | 
			
		||||
          phone:'',
 | 
			
		||||
          idFrontPhoto: null,
 | 
			
		||||
          idBackPhoto: null,
 | 
			
		||||
          frontUploading: false,
 | 
			
		||||
| 
						 | 
				
			
			@ -817,9 +828,9 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 获取班组列表
 | 
			
		||||
    getTeamList() {
 | 
			
		||||
    getTeamList(externalId) {
 | 
			
		||||
      const params = {
 | 
			
		||||
        externalId: null
 | 
			
		||||
        externalId: externalId
 | 
			
		||||
      }
 | 
			
		||||
      getTeamList(params).then(response => {
 | 
			
		||||
        this.teamList = response.data
 | 
			
		||||
| 
						 | 
				
			
			@ -869,6 +880,7 @@ export default {
 | 
			
		|||
      this.materialReceivers.push({
 | 
			
		||||
        name: '',
 | 
			
		||||
        idNumber: '',
 | 
			
		||||
        phone:'',
 | 
			
		||||
        idFrontPhoto: null,
 | 
			
		||||
        idBackPhoto: null,
 | 
			
		||||
        frontUploading: false,
 | 
			
		||||
| 
						 | 
				
			
			@ -1004,7 +1016,7 @@ export default {
 | 
			
		|||
      this.isEditMode = true
 | 
			
		||||
      this.isBatchMode = false
 | 
			
		||||
      this.dialogTitle = '编辑授权'
 | 
			
		||||
      this.getTeamList()
 | 
			
		||||
      this.getTeamList(row.externalId)
 | 
			
		||||
 | 
			
		||||
      // 重置表单状态
 | 
			
		||||
      this.resetAuthForm()
 | 
			
		||||
| 
						 | 
				
			
			@ -1046,6 +1058,7 @@ export default {
 | 
			
		|||
              idNumber: item.idNumber,
 | 
			
		||||
              idFrontPhoto: item.frontUrl,
 | 
			
		||||
              idBackPhoto: item.backUrl,
 | 
			
		||||
              phone:item.phone,
 | 
			
		||||
              frontUploading: false,
 | 
			
		||||
              backUploading: false
 | 
			
		||||
            }))
 | 
			
		||||
| 
						 | 
				
			
			@ -1112,8 +1125,10 @@ export default {
 | 
			
		|||
        })
 | 
			
		||||
 | 
			
		||||
        // 获取选中的班组名称
 | 
			
		||||
        const selectedTeam = this.teamList.find(team => team.id === this.authForm.teamId)
 | 
			
		||||
        const teamName = selectedTeam ? selectedTeam.name : ''
 | 
			
		||||
        // const selectedTeam = this.teamList.find(team => team.id === this.authForm.teamId);
 | 
			
		||||
        // const teamName = selectedTeam ? selectedTeam.name : '';
 | 
			
		||||
        const teamName = this.authForm.teamName;
 | 
			
		||||
        console.log("teamName", teamName)
 | 
			
		||||
 | 
			
		||||
        const requestData = {
 | 
			
		||||
          teamId: this.authForm.teamId,
 | 
			
		||||
| 
						 | 
				
			
			@ -1124,7 +1139,8 @@ export default {
 | 
			
		|||
            name: receiver.name,
 | 
			
		||||
            idNumber: receiver.idNumber,
 | 
			
		||||
            frontUrl: receiver.idFrontPhoto,
 | 
			
		||||
            backUrl: receiver.idBackPhoto
 | 
			
		||||
            backUrl: receiver.idBackPhoto,
 | 
			
		||||
            phone:receiver.phone
 | 
			
		||||
          }))
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,16 +24,29 @@
 | 
			
		|||
                    @keyup.enter.native="handleQuery"
 | 
			
		||||
                />
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            <!-- <el-form-item label="状态" prop="taskStatus">
 | 
			
		||||
                <el-select v-model="queryParams.taskStatus" placeholder="请选择状态" clearable>
 | 
			
		||||
            <el-form-item label="机具类型" prop="">
 | 
			
		||||
                <el-cascader
 | 
			
		||||
                    v-model="typeIds"
 | 
			
		||||
                    :options="typeList"
 | 
			
		||||
                    :props="{ label: 'typeName', value: 'typeId' }"
 | 
			
		||||
                    filterable
 | 
			
		||||
                    clearable
 | 
			
		||||
                    @change="handleChangeType"
 | 
			
		||||
                    style="width: 240px"
 | 
			
		||||
                ></el-cascader>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            <el-form-item label="规格型号" prop="typeId">
 | 
			
		||||
                <el-select v-model="queryParams.typeId" placeholder="请选择机规格型号" style="width: 240px">
 | 
			
		||||
                    <el-option
 | 
			
		||||
                        v-for="item in statusOptions"
 | 
			
		||||
                        :key="item.value"
 | 
			
		||||
                        :label="item.label"
 | 
			
		||||
                        :value="item.value"
 | 
			
		||||
                    />
 | 
			
		||||
                        v-for="item in typeIdList"
 | 
			
		||||
                        :key="item.typeId"
 | 
			
		||||
                        :label="item.name"
 | 
			
		||||
                        :value="item.typeId"
 | 
			
		||||
                        filterable
 | 
			
		||||
                        clearable
 | 
			
		||||
                    ></el-option>
 | 
			
		||||
                </el-select>
 | 
			
		||||
            </el-form-item> -->
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
 | 
			
		||||
            <!-- 表单按钮 -->
 | 
			
		||||
            <el-form-item>
 | 
			
		||||
| 
						 | 
				
			
			@ -43,16 +56,20 @@
 | 
			
		|||
        </el-form>
 | 
			
		||||
 | 
			
		||||
        <el-row :gutter="10" class="mb8">
 | 
			
		||||
            <el-col :span="1.5">
 | 
			
		||||
            <!-- 通知暂未开发 -->
 | 
			
		||||
            <!-- <el-col :span="1.5">
 | 
			
		||||
                <el-button type="primary" plain icon="el-icon-chat-dot-round" size="mini" @click="onHandleNotice">
 | 
			
		||||
                    通知
 | 
			
		||||
                </el-button>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            </el-col> -->
 | 
			
		||||
            <el-col :span="1.5">
 | 
			
		||||
                <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">
 | 
			
		||||
                    导出数据
 | 
			
		||||
                </el-button>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="1.5">
 | 
			
		||||
                <div style="color: red; font-size: 20px; font-weight: 800">总计:{{ total }}</div>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
			
		||||
        </el-row>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -91,7 +108,8 @@
 | 
			
		|||
<script>
 | 
			
		||||
import printJS from 'print-js'
 | 
			
		||||
import { getLeaseTaskList, deleteLeaseTask, getLeaseTask, getCodePDF } from '@/api/business/index'
 | 
			
		||||
import { getUseMaintenanceWarningApi } from '@/api/warning-analysis/engineering-in-use.js'
 | 
			
		||||
import { getUseMaintenanceWarningApi, getMaTypeApi } from '@/api/warning-analysis/engineering-in-use.js'
 | 
			
		||||
import { equipmentTypeTree } from '@/api/purchase/goodsArrived'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    data() {
 | 
			
		||||
| 
						 | 
				
			
			@ -101,8 +119,11 @@ export default {
 | 
			
		|||
                pageNum: 1,
 | 
			
		||||
                pageSize: 10,
 | 
			
		||||
                keyWord: '', // 关键字
 | 
			
		||||
                thirdTypeId: '',
 | 
			
		||||
                typeId: '',
 | 
			
		||||
                timeRange: [] // 日期范围
 | 
			
		||||
            },
 | 
			
		||||
            typeIds: [],
 | 
			
		||||
 | 
			
		||||
            total: 0, // 总条数
 | 
			
		||||
            // 表头
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +135,7 @@ export default {
 | 
			
		|||
                { label: '单位名称', prop: 'unitName', width: '200' },
 | 
			
		||||
                { label: '工程名称', prop: 'projectName', width: '200' },
 | 
			
		||||
                { label: '协议号', prop: 'agreementCode', width: '140' },
 | 
			
		||||
                { label: '超期时长', prop: 'overDays', width: '100' }
 | 
			
		||||
                { label: '临检天数', prop: 'overDays', width: '100' }
 | 
			
		||||
            ],
 | 
			
		||||
            // 表格数据
 | 
			
		||||
            tableList: [],
 | 
			
		||||
| 
						 | 
				
			
			@ -131,11 +152,14 @@ export default {
 | 
			
		|||
                { label: '数量', prop: 'preNum', width: '60px' },
 | 
			
		||||
                { label: '备注', prop: 'remark', width: '' }
 | 
			
		||||
            ],
 | 
			
		||||
            dialogList: []
 | 
			
		||||
            dialogList: [],
 | 
			
		||||
            typeList: [],
 | 
			
		||||
            typeIdList: []
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    created() {
 | 
			
		||||
        this.getList()
 | 
			
		||||
        this.getTreeList()
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        // 查询
 | 
			
		||||
| 
						 | 
				
			
			@ -146,6 +170,8 @@ export default {
 | 
			
		|||
        handleReset() {
 | 
			
		||||
            this.queryParams.pageNum = 1
 | 
			
		||||
            this.queryParams.pageSize = 10
 | 
			
		||||
            this.typeIds = []
 | 
			
		||||
            this.queryParams.thirdTypeId = ''
 | 
			
		||||
            this.$refs.queryForm.resetFields()
 | 
			
		||||
            this.getList()
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			@ -168,6 +194,49 @@ export default {
 | 
			
		|||
                this.total = 0
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        // 获取设备树
 | 
			
		||||
        async getTreeList() {
 | 
			
		||||
            try {
 | 
			
		||||
                const res = await equipmentTypeTree()
 | 
			
		||||
                console.log('🚀 ~ getTreeList ~ res:', res)
 | 
			
		||||
                if (res.data && res.data.length > 0) {
 | 
			
		||||
                    this.typeList = this.removeChildrenFromLevel3(res.data)
 | 
			
		||||
                }
 | 
			
		||||
            } catch (error) {
 | 
			
		||||
                console.log('🚀 ~ getTreeList ~ error:', error)
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        removeChildrenFromLevel3(tree) {
 | 
			
		||||
            return tree.map(node => {
 | 
			
		||||
                const newNode = { ...node }
 | 
			
		||||
 | 
			
		||||
                if (newNode.level === '3') {
 | 
			
		||||
                    // 删除 children
 | 
			
		||||
                    delete newNode.children
 | 
			
		||||
                } else if (newNode.children && newNode.children.length > 0) {
 | 
			
		||||
                    // 递归处理子节点
 | 
			
		||||
                    newNode.children = this.removeChildrenFromLevel3(newNode.children)
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return newNode
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        handleChangeType(e) {
 | 
			
		||||
            this.typeIdList = []
 | 
			
		||||
            this.queryParams.typeId = ''
 | 
			
		||||
            this.queryParams.thirdTypeId = e[e.length - 1]
 | 
			
		||||
            console.log('🚀 ~ handleChangeType ~ :', this.queryParams.thirdTypeId)
 | 
			
		||||
            this.getMaTypeList()
 | 
			
		||||
        },
 | 
			
		||||
        async getMaTypeList() {
 | 
			
		||||
            try {
 | 
			
		||||
                const res = await getMaTypeApi({ typeId: this.queryParams.thirdTypeId })
 | 
			
		||||
                this.typeIdList = res.data || []
 | 
			
		||||
            } catch (error) {
 | 
			
		||||
                console.log('🚀 ~ getMaTypeList ~ error:', error)
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        // 多选
 | 
			
		||||
        selectionChange(val) {
 | 
			
		||||
            console.log('selectionChange', val)
 | 
			
		||||
| 
						 | 
				
			
			@ -245,7 +314,7 @@ export default {
 | 
			
		|||
                // console.log('🚀 ~ getDialogContent ~ res:', PDFres)
 | 
			
		||||
                this.dialogVisible = true
 | 
			
		||||
                this.dialogForm = {
 | 
			
		||||
                    ...res.data.leaseApplyInfo,
 | 
			
		||||
                    ...res.data.leaseApplyInfo
 | 
			
		||||
                    // pdfUrl: PDFres.data.url
 | 
			
		||||
                }
 | 
			
		||||
                this.dialogList = res.data.leaseApplyDetailsList
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue