领料出库
This commit is contained in:
		
							parent
							
								
									79b064b554
								
							
						
					
					
						commit
						630c6bd13c
					
				| 
						 | 
					@ -79,6 +79,15 @@ export function receiveSubmit(data) {
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 领用申请提交-新增
 | 
				
			||||||
 | 
					export function receiveSubmitTwo(data) {
 | 
				
			||||||
 | 
					    return request({
 | 
				
			||||||
 | 
					        url: '/material/directRotation/submit',
 | 
				
			||||||
 | 
					        method: 'post',
 | 
				
			||||||
 | 
					        data
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 领用申请提交-编辑
 | 
					// 领用申请提交-编辑
 | 
				
			||||||
export function receiveEdit(data) {
 | 
					export function receiveEdit(data) {
 | 
				
			||||||
    return request({
 | 
					    return request({
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,6 +61,15 @@ export function getListLeasePersonApi(data) {
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 领料申请-获取库存信息
 | 
				
			||||||
 | 
					export function getPendingOutNumByTypeId(typeId) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/material/leaseTask/getPendingOutNumByTypeId/' + typeId,
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 领料申请租赁工程下拉框
 | 
					// 领料申请租赁工程下拉框
 | 
				
			||||||
export function getListProject(data) {
 | 
					export function getListProject(data) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -126,6 +126,23 @@ export function rejectLeaseOut(data) {
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 领料出库-删除
 | 
				
			||||||
 | 
					export function deleteLeaseOut(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/material/leaseTask/delLeaseDetails',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 领料出库-修改预领数量
 | 
				
			||||||
 | 
					export function updatePreNum(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/material/lease_apply_info/updateLeaseNum',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
// 出库数量
 | 
					// 出库数量
 | 
				
			||||||
export function getOutNumApi(data) {
 | 
					export function getOutNumApi(data) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -334,7 +334,7 @@
 | 
				
			||||||
import { getMaTypeOpt } from '@/api/ma/base'
 | 
					import { getMaTypeOpt } from '@/api/ma/base'
 | 
				
			||||||
import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply'
 | 
					import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply'
 | 
				
			||||||
import { downloadFile, downloadFileData } from '@/utils/download'
 | 
					import { downloadFile, downloadFileData } from '@/utils/download'
 | 
				
			||||||
import { getUseringData, receiveSubmit, receiveEdit, receiveDetail, getEquipmentThreeTypes } from '@/api/business/index'
 | 
					import { getUseringData, receiveSubmitTwo, receiveEdit, receiveDetail, getEquipmentThreeTypes } from '@/api/business/index'
 | 
				
			||||||
import Treeselect from '@riophae/vue-treeselect'
 | 
					import Treeselect from '@riophae/vue-treeselect'
 | 
				
			||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 | 
					import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 | 
				
			||||||
import { getToken } from '@/utils/auth'
 | 
					import { getToken } from '@/utils/auth'
 | 
				
			||||||
| 
						 | 
					@ -1102,7 +1102,7 @@ export default {
 | 
				
			||||||
                                    const res = await receiveEdit(params)
 | 
					                                    const res = await receiveEdit(params)
 | 
				
			||||||
                                    console.log('🚀 ~ handleSave ~ res:', res)
 | 
					                                    console.log('🚀 ~ handleSave ~ res:', res)
 | 
				
			||||||
                                } else {
 | 
					                                } else {
 | 
				
			||||||
                                    const res = await receiveSubmit(params)
 | 
					                                    const res = await receiveSubmitTwo(params)
 | 
				
			||||||
                                    console.log('🚀 ~ handleSave ~ res:', res)
 | 
					                                    console.log('🚀 ~ handleSave ~ res:', res)
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                this.$message.success('操作成功')
 | 
					                                this.$message.success('操作成功')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -63,7 +63,7 @@
 | 
				
			||||||
      :data="leaseList"
 | 
					      :data="leaseList"
 | 
				
			||||||
      @selection-change="handleSelectionChange"
 | 
					      @selection-change="handleSelectionChange"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-table-column type="selection" width="55" align="center" :selectable="(row) => row.pendingNum != 0" />
 | 
					      <el-table-column type="selection" width="55" align="center" :selectable="(row) => row.pendingNum != 0 && (row.storageNum-row.pendingOutNum>=row.num)" />
 | 
				
			||||||
      <el-table-column align="center" label="序号" type="index" width="55" />
 | 
					      <el-table-column align="center" label="序号" type="index" width="55" />
 | 
				
			||||||
      <el-table-column
 | 
					      <el-table-column
 | 
				
			||||||
        align="center"
 | 
					        align="center"
 | 
				
			||||||
| 
						 | 
					@ -80,6 +80,7 @@
 | 
				
			||||||
      <el-table-column align="center" label="计量单位" prop="unitName" />
 | 
					      <el-table-column align="center" label="计量单位" prop="unitName" />
 | 
				
			||||||
      <el-table-column align="center" label="需求数量" prop="preNum" />
 | 
					      <el-table-column align="center" label="需求数量" prop="preNum" />
 | 
				
			||||||
      <el-table-column align="center" label="当前库存" prop="storageNum" />
 | 
					      <el-table-column align="center" label="当前库存" prop="storageNum" />
 | 
				
			||||||
 | 
					      <el-table-column align="center" label="待出库数量" prop="pendingOutNum" />
 | 
				
			||||||
      <el-table-column align="center" label="已发布数量" prop="publishNum" :show-overflow-tooltip="true"/>
 | 
					      <el-table-column align="center" label="已发布数量" prop="publishNum" :show-overflow-tooltip="true"/>
 | 
				
			||||||
      <el-table-column align="center" label="已供应数量" prop="outNum" :show-overflow-tooltip="true"/>
 | 
					      <el-table-column align="center" label="已供应数量" prop="outNum" :show-overflow-tooltip="true"/>
 | 
				
			||||||
      <el-table-column align="center" label="待发布数量" prop="pendingNum" :show-overflow-tooltip="true">
 | 
					      <el-table-column align="center" label="待发布数量" prop="pendingNum" :show-overflow-tooltip="true">
 | 
				
			||||||
| 
						 | 
					@ -107,6 +108,7 @@
 | 
				
			||||||
            placeholder="请选择规格型号"
 | 
					            placeholder="请选择规格型号"
 | 
				
			||||||
            style="width: 100%"
 | 
					            style="width: 100%"
 | 
				
			||||||
            :key="scope.$index"
 | 
					            :key="scope.$index"
 | 
				
			||||||
 | 
					            @change="handleChangeType(scope.row)"
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
            <el-option
 | 
					            <el-option
 | 
				
			||||||
              v-for="option in scope.row.typeOptions"
 | 
					              v-for="option in scope.row.typeOptions"
 | 
				
			||||||
| 
						 | 
					@ -235,7 +237,7 @@
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  getApplyInfo,getTypeOptions,applySubmit
 | 
					  getApplyInfo,getTypeOptions,applySubmit
 | 
				
			||||||
} from "@/api/leasePublish/index";
 | 
					} from "@/api/leasePublish/index";
 | 
				
			||||||
import { getUnitListLeaseApi, getListLeasePersonApi } from '@/api/lease/apply'
 | 
					import { getUnitListLeaseApi, getListLeasePersonApi,getPendingOutNumByTypeId } from '@/api/lease/apply'
 | 
				
			||||||
import { getToken } from "@/utils/auth";
 | 
					import { getToken } from "@/utils/auth";
 | 
				
			||||||
import Treeselect from '@riophae/vue-treeselect'
 | 
					import Treeselect from '@riophae/vue-treeselect'
 | 
				
			||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 | 
					import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 | 
				
			||||||
| 
						 | 
					@ -443,13 +445,35 @@ export default {
 | 
				
			||||||
      if(row.num > row.pendingNum){
 | 
					      if(row.num > row.pendingNum){
 | 
				
			||||||
        this.$message.error('领料数量不能大于待发布数量')
 | 
					        this.$message.error('领料数量不能大于待发布数量')
 | 
				
			||||||
        this.$set(row, 'num', row.pendingNum)
 | 
					        this.$set(row, 'num', row.pendingNum)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      if(row.num > (row.storageNum-row.pendingOutNum)){
 | 
				
			||||||
 | 
					        const excessNum = row.storageNum - row.pendingOutNum;
 | 
				
			||||||
 | 
					        this.$message.error(`领料数量不能大于剩余可出库数量${excessNum}`);
 | 
				
			||||||
 | 
					        this.$set(row, 'num', row.pendingNum)
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (row.num < 1) {
 | 
					      if (row.num < 1) {
 | 
				
			||||||
        this.$set(row, 'num', 1)
 | 
					        this.$set(row, 'num', 1)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //规格型号切换
 | 
				
			||||||
 | 
					    async handleChangeType(row) {
 | 
				
			||||||
 | 
					      console.log("xxxxxxxx",row.newTypeId)
 | 
				
			||||||
 | 
					      const res =  await getPendingOutNumByTypeId(row.newTypeId)
 | 
				
			||||||
 | 
					       console.log('yyyyyyyyy',res.data)
 | 
				
			||||||
 | 
					      if(res.code==200){
 | 
				
			||||||
 | 
					        console.log('yyyyyyyyy',res.data.pendingOutNum)
 | 
				
			||||||
 | 
					        this.$set(row, 'pendingOutNum', res.data.pendingOutNum)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      // this.$set(row, 'newTypeId', row.newTypeId)
 | 
				
			||||||
 | 
					      // this.$set(row, 'num', row.num)
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    handleSign(){
 | 
					    handleSign(){
 | 
				
			||||||
        this.closeView()
 | 
					        this.closeView()
 | 
				
			||||||
        this.$router.push({ path: '/lease/protocol' })
 | 
					        this.$router.push({ path: '/lease/protocol' })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -232,6 +232,27 @@
 | 
				
			||||||
                <el-table-column label="类型名称" align="center" prop="maTypeName" :show-overflow-tooltip="true" />
 | 
					                <el-table-column label="类型名称" align="center" prop="maTypeName" :show-overflow-tooltip="true" />
 | 
				
			||||||
                <el-table-column label="规格型号" align="center" prop="typeName" :show-overflow-tooltip="true" />
 | 
					                <el-table-column label="规格型号" align="center" prop="typeName" :show-overflow-tooltip="true" />
 | 
				
			||||||
                <el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
 | 
					                <el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
 | 
				
			||||||
 | 
					                <el-table-column label="预出库数量" align="center" prop="preNum" :show-overflow-tooltip="true" v-if="checkShowPreButton()">
 | 
				
			||||||
 | 
					                    <template slot-scope="scope">
 | 
				
			||||||
 | 
					                        <template  v-if="scope.row.outNum > 0">
 | 
				
			||||||
 | 
					                            <el-input
 | 
				
			||||||
 | 
					                                v-model.number="scope.row.preNum"
 | 
				
			||||||
 | 
					                                controls-position="right"
 | 
				
			||||||
 | 
					                                type="number"
 | 
				
			||||||
 | 
					                                style="width: 100%"
 | 
				
			||||||
 | 
					                                clearable
 | 
				
			||||||
 | 
					                                placeholder="请输入预出库数量"
 | 
				
			||||||
 | 
					                                :min="0"
 | 
				
			||||||
 | 
					                                @change="checkPreNum(scope.row)"
 | 
				
			||||||
 | 
					                            ></el-input>
 | 
				
			||||||
 | 
					                        </template>
 | 
				
			||||||
 | 
					                        <template v-else>
 | 
				
			||||||
 | 
					                            {{ scope.row.preNum }}
 | 
				
			||||||
 | 
					                        </template>
 | 
				
			||||||
 | 
					                    </template>
 | 
				
			||||||
 | 
					                </el-table-column>
 | 
				
			||||||
 | 
					                <el-table-column label="当前库存" align="center" prop="storageNum" :show-overflow-tooltip="true" v-if="checkShowPreButton()"/>
 | 
				
			||||||
 | 
					                <el-table-column label="待出库库存" align="center" prop="pendingOutNum" :show-overflow-tooltip="true" v-if="checkShowPreButton()"/>
 | 
				
			||||||
                <el-table-column label="待出库数量" align="center" prop="outNum" :show-overflow-tooltip="true" />
 | 
					                <el-table-column label="待出库数量" align="center" prop="outNum" :show-overflow-tooltip="true" />
 | 
				
			||||||
                <el-table-column label="已出库数量" align="center" prop="alNum" :show-overflow-tooltip="true" />
 | 
					                <el-table-column label="已出库数量" align="center" prop="alNum" :show-overflow-tooltip="true" />
 | 
				
			||||||
                <el-table-column label="操作" align="center" width="120px" v-if="checkShowRejectButton()">
 | 
					                <el-table-column label="操作" align="center" width="120px" v-if="checkShowRejectButton()">
 | 
				
			||||||
| 
						 | 
					@ -244,6 +265,14 @@
 | 
				
			||||||
                        >
 | 
					                        >
 | 
				
			||||||
                            驳回
 | 
					                            驳回
 | 
				
			||||||
                        </el-button>
 | 
					                        </el-button>
 | 
				
			||||||
 | 
					                        <el-button
 | 
				
			||||||
 | 
					                            size="mini"
 | 
				
			||||||
 | 
					                            type="danger"
 | 
				
			||||||
 | 
					                            @click="handleDelete(scope.row)"
 | 
				
			||||||
 | 
					                            v-if="scope.row.alNum == 0 && taskType == '2'"
 | 
				
			||||||
 | 
					                        >
 | 
				
			||||||
 | 
					                            删除
 | 
				
			||||||
 | 
					                        </el-button>
 | 
				
			||||||
                    </template>
 | 
					                    </template>
 | 
				
			||||||
                </el-table-column>
 | 
					                </el-table-column>
 | 
				
			||||||
            </el-table>
 | 
					            </el-table>
 | 
				
			||||||
| 
						 | 
					@ -686,7 +715,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import { getListLeaseApply, getApplyInfo, getCheckInfo } from '@/api/lease/apply'
 | 
					import { getListLeaseApply, getApplyInfo, getCheckInfo } from '@/api/lease/apply'
 | 
				
			||||||
import { outInfoList, getDetailsByTypeId, submitOut, submitNumOut, rejectLeaseOut, getOutNumApi } from '@/api/lease/out'
 | 
					import { outInfoList, getDetailsByTypeId, submitOut, submitNumOut, rejectLeaseOut, getOutNumApi,deleteLeaseOut,updatePreNum } from '@/api/lease/out'
 | 
				
			||||||
import vueEasyPrint from 'vue-easy-print'
 | 
					import vueEasyPrint from 'vue-easy-print'
 | 
				
			||||||
// import chapter from '../../../../utils/chapter';
 | 
					// import chapter from '../../../../utils/chapter';
 | 
				
			||||||
import printJS from 'print-js'
 | 
					import printJS from 'print-js'
 | 
				
			||||||
| 
						 | 
					@ -1265,6 +1294,44 @@ export default {
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //输入预出库数量
 | 
				
			||||||
 | 
					        async checkPreNum(row) {
 | 
				
			||||||
 | 
					            console.log(row)
 | 
				
			||||||
 | 
					            // let maxNum = row.pendingNum-row.pendingOutNum
 | 
				
			||||||
 | 
					            let minNum = row.alNum
 | 
				
			||||||
 | 
					            if (row.unitValue == 1) {
 | 
				
			||||||
 | 
					                row.preNum = Number(String(row.preNum).replace(/[^\d.]/g, ''))
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                row.preNum = Number(String(row.preNum).replace(/[^\d]/g, ''))
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (row.preNum <= 0) {
 | 
				
			||||||
 | 
					                row.preNum = 0
 | 
				
			||||||
 | 
					                return 
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (row.preNum < row.alNum) {
 | 
				
			||||||
 | 
					                row.preNum = minNum
 | 
				
			||||||
 | 
					                this.$message.error('预出库数量不能小于已出库数量')
 | 
				
			||||||
 | 
					                return 
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (row.preNum > (row.storageNum-row.pendingOutNum)) {
 | 
				
			||||||
 | 
					                // row.preNum = maxNum
 | 
				
			||||||
 | 
					                this.$message.error('预出库数量不能大于可出库数量')
 | 
				
			||||||
 | 
					                return 
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            const res = await updatePreNum({
 | 
				
			||||||
 | 
					                preNum: row.preNum,
 | 
				
			||||||
 | 
					                parentId: row.parentId,
 | 
				
			||||||
 | 
					                typeId: row.typeId,
 | 
				
			||||||
 | 
					                newTypeId: row.newTypeId,
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            if (res.code == 200) {
 | 
				
			||||||
 | 
					                // this.$set(row, 'outNum', row.preNum-row.alNum)
 | 
				
			||||||
 | 
					                this.handleQueryOutView()
 | 
				
			||||||
 | 
					                this.getList()
 | 
				
			||||||
 | 
					                this.getOutNum()
 | 
				
			||||||
 | 
					            } 
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        printView() {
 | 
					        printView() {
 | 
				
			||||||
            this.$refs.remarksPrintRefView.print()
 | 
					            this.$refs.remarksPrintRefView.print()
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
| 
						 | 
					@ -1333,6 +1400,12 @@ export default {
 | 
				
			||||||
            return this.getListOutInfo && this.getListOutInfo.some(item => item.alNum == 0)
 | 
					            return this.getListOutInfo && this.getListOutInfo.some(item => item.alNum == 0)
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 检查是否显示预出库字段
 | 
				
			||||||
 | 
					        checkShowPreButton() {
 | 
				
			||||||
 | 
					            // 检查列表中是否有已出库数量为0的数据
 | 
				
			||||||
 | 
					            return this.getListOutInfo && this.getListOutInfo.some(item => item.alNum == 0) && this.currentRowData.status != 4
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 处理驳回操作
 | 
					        // 处理驳回操作
 | 
				
			||||||
        handleReject(row) {
 | 
					        handleReject(row) {
 | 
				
			||||||
            console.log(row)
 | 
					            console.log(row)
 | 
				
			||||||
| 
						 | 
					@ -1371,6 +1444,39 @@ export default {
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 处理删除操作
 | 
				
			||||||
 | 
					        handleDelete(row) {
 | 
				
			||||||
 | 
					            console.log(row)
 | 
				
			||||||
 | 
					            this.$confirm('确定要删除此条数据吗?', '提示', {
 | 
				
			||||||
 | 
					                confirmButtonText: '确定',
 | 
				
			||||||
 | 
					                cancelButtonText: '取消',
 | 
				
			||||||
 | 
					                type: 'warning'
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					                .then(() => {
 | 
				
			||||||
 | 
					                    // 调用删除API
 | 
				
			||||||
 | 
					                    const rejectData = {
 | 
				
			||||||
 | 
					                        parentId: row.parentId,
 | 
				
			||||||
 | 
					                        typeId: row.typeId,
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    deleteLeaseOut(rejectData)
 | 
				
			||||||
 | 
					                        .then(response => {
 | 
				
			||||||
 | 
					                            this.$modal.msgSuccess('删除成功')
 | 
				
			||||||
 | 
					                            // 刷新查看弹窗的数据
 | 
				
			||||||
 | 
					                            this.getListView()
 | 
				
			||||||
 | 
					                            // 刷新主列表数据
 | 
				
			||||||
 | 
					                            this.getList()
 | 
				
			||||||
 | 
					                        })
 | 
				
			||||||
 | 
					                        .catch(error => {
 | 
				
			||||||
 | 
					                            this.$modal.msgError('删除失败: ' + (error.message || '未知错误'))
 | 
				
			||||||
 | 
					                        })
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
 | 
					                .catch(() => {
 | 
				
			||||||
 | 
					                    // 用户取消操作
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //绘制五角星
 | 
					        //绘制五角星
 | 
				
			||||||
        create5star(context, sx, sy, radius, color, rotato) {
 | 
					        create5star(context, sx, sy, radius, color, rotato) {
 | 
				
			||||||
            context.save()
 | 
					            context.save()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,7 +132,7 @@
 | 
				
			||||||
    </el-dialog>
 | 
					    </el-dialog>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- 弹框 -->
 | 
					    <!-- 弹框 -->
 | 
				
			||||||
    <el-dialog title="试验记录表" :visible.sync="dialogVisible" width="46%">
 | 
					    <el-dialog title="试验记录表" :visible.sync="dialogVisible" width="46%" @close="closeDialog">
 | 
				
			||||||
      <div  id="print-content">
 | 
					      <div  id="print-content">
 | 
				
			||||||
        <vue-easy-print tableShow ref="remarksPrintRef2" class="print" style="margin: 0 20px">
 | 
					        <vue-easy-print tableShow ref="remarksPrintRef2" class="print" style="margin: 0 20px">
 | 
				
			||||||
          <div style="text-align: center; font-weight: 600; font-size: 30px">机具(物流)分公司动力设备维修及试验记录单</div>
 | 
					          <div style="text-align: center; font-weight: 600; font-size: 30px">机具(物流)分公司动力设备维修及试验记录单</div>
 | 
				
			||||||
| 
						 | 
					@ -269,7 +269,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <div slot="footer" class="dialog-footer" style="text-align: center">
 | 
					      <div slot="footer" class="dialog-footer" style="text-align: center">
 | 
				
			||||||
        <el-button type="primary" @click="print">打 印</el-button>
 | 
					        <el-button type="primary" @click="print">打 印</el-button>
 | 
				
			||||||
        <el-button @click="dialogVisible = false">关 闭</el-button>
 | 
					        <el-button @click="closeDialog">关 闭</el-button>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </el-dialog>
 | 
					    </el-dialog>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -403,6 +403,7 @@ export default {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async handleRecord(row){
 | 
					    async handleRecord(row){
 | 
				
			||||||
      this.dialogVisible = true;
 | 
					      this.dialogVisible = true;
 | 
				
			||||||
 | 
					      this.printTableData = [];
 | 
				
			||||||
      let param  = {
 | 
					      let param  = {
 | 
				
			||||||
        id:row.id,
 | 
					        id:row.id,
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					@ -456,7 +457,17 @@ export default {
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 关闭弹框并清除数据
 | 
				
			||||||
 | 
					    closeDialog() {
 | 
				
			||||||
 | 
					      this.dialogVisible = false; // 关闭弹框
 | 
				
			||||||
 | 
					      this.printInfo = {}; // 清空数据
 | 
				
			||||||
 | 
					      this.printTableData = []; // 清空表格数据
 | 
				
			||||||
 | 
					      this.testResult1 = '';
 | 
				
			||||||
 | 
					      this.testResult2 = '';
 | 
				
			||||||
 | 
					      this.testResult3 = '';
 | 
				
			||||||
 | 
					      this.testConclusion = '合格';
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,319 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					    <div class="app-container" id="">
 | 
				
			||||||
 | 
					      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
 | 
				
			||||||
 | 
					        <el-form-item prop="time">
 | 
				
			||||||
 | 
					            <el-date-picker
 | 
				
			||||||
 | 
					                v-model="queryParams.time"
 | 
				
			||||||
 | 
					                range-separator="至"
 | 
				
			||||||
 | 
					                start-placeholder="开始日期"
 | 
				
			||||||
 | 
					                end-placeholder="结束日期"
 | 
				
			||||||
 | 
					                type="daterange"
 | 
				
			||||||
 | 
					                value-format="yyyy-MM-dd"
 | 
				
			||||||
 | 
					                style="width: 240px"
 | 
				
			||||||
 | 
					            ></el-date-picker>
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="keyWord">
 | 
				
			||||||
 | 
					          <el-input
 | 
				
			||||||
 | 
					            v-model="queryParams.keyWord"
 | 
				
			||||||
 | 
					            placeholder="请输入关键字"
 | 
				
			||||||
 | 
					            clearable :maxlength="20"
 | 
				
			||||||
 | 
					            style="width: 240px"
 | 
				
			||||||
 | 
					          />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="unitId">
 | 
				
			||||||
 | 
					            <treeselect
 | 
				
			||||||
 | 
					                v-model="queryParams.unitId"
 | 
				
			||||||
 | 
					                :options="unitList" :normalizer="normalizer"
 | 
				
			||||||
 | 
					                :show-count="true" style="width: 240px" :disable-branch-nodes="true"
 | 
				
			||||||
 | 
					                noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
 | 
				
			||||||
 | 
					                placeholder="请选择退料单位" @select="unitChange"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="proId">
 | 
				
			||||||
 | 
					            <treeselect
 | 
				
			||||||
 | 
					                v-model="queryParams.proId"
 | 
				
			||||||
 | 
					                :options="proList" :normalizer="normalizer"
 | 
				
			||||||
 | 
					                :show-count="true" style="width: 240px" :disable-branch-nodes="true"
 | 
				
			||||||
 | 
					                noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
 | 
				
			||||||
 | 
					                placeholder="请选择退料工程" @select="proChange"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="typeName">
 | 
				
			||||||
 | 
					            <el-input
 | 
				
			||||||
 | 
					                v-model="queryParams.typeName"
 | 
				
			||||||
 | 
					                placeholder="请输入机具名称"
 | 
				
			||||||
 | 
					                clearable :maxlength="20"
 | 
				
			||||||
 | 
					                style="width: 240px"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item>
 | 
				
			||||||
 | 
					            <el-button
 | 
				
			||||||
 | 
					                type="primary"
 | 
				
			||||||
 | 
					                icon="el-icon-search"
 | 
				
			||||||
 | 
					                size="mini"
 | 
				
			||||||
 | 
					                @click="handleQuery"
 | 
				
			||||||
 | 
					                >查询</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            <el-button
 | 
				
			||||||
 | 
					                icon="el-icon-refresh"
 | 
				
			||||||
 | 
					                size="mini"
 | 
				
			||||||
 | 
					                @click="resetQuery"
 | 
				
			||||||
 | 
					                >重置</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            <el-button
 | 
				
			||||||
 | 
					                type="warning"
 | 
				
			||||||
 | 
					                plain
 | 
				
			||||||
 | 
					                icon="el-icon-download"
 | 
				
			||||||
 | 
					                size="mini"
 | 
				
			||||||
 | 
					                @click="handleExport"
 | 
				
			||||||
 | 
					                >导出</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					      </el-form>
 | 
				
			||||||
 | 
					      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
				
			||||||
 | 
					      <el-table v-loading="loading" :data="tableList" border :max-height="650">
 | 
				
			||||||
 | 
					          <el-table-column label="序号" align="center" type="index">
 | 
				
			||||||
 | 
					                <template scope="scope">
 | 
				
			||||||
 | 
					                    <span>{{ (queryParams.pageNum - 1) * 10 + scope.$index+1 }}</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					          </el-table-column>
 | 
				
			||||||
 | 
					          <el-table-column label="退料单位" align="center" prop="unitName" width="100"/>
 | 
				
			||||||
 | 
					          <el-table-column label="退料工程" align="center" prop="proName" width="100"/>
 | 
				
			||||||
 | 
					          <el-table-column label="维修单号" align="center" prop="code" width="150px" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="机具名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="计量单位" align="center" prop="unit" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="退料数量" align="center" prop="backNum"/>
 | 
				
			||||||
 | 
					          <el-table-column label="抽检数量" align="center" prop="cjNum" :show-overflow-tooltip="true"></el-table-column>
 | 
				
			||||||
 | 
					          <el-table-column label="试验数量" align="center" prop="syNum" width="100"></el-table-column>
 | 
				
			||||||
 | 
					          <el-table-column label="抽检人" align="center" prop="backMan"></el-table-column>
 | 
				
			||||||
 | 
					          <el-table-column label="试验人" align="center" prop="backDate" width="100"></el-table-column>
 | 
				
			||||||
 | 
					          <el-table-column label="额定载荷" align="center" prop="statusName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="试验载荷" align="center" prop="statusName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="持荷时间" align="center" prop="statusName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					      </el-table>
 | 
				
			||||||
 | 
					      <pagination
 | 
				
			||||||
 | 
					          v-show="total > 0"
 | 
				
			||||||
 | 
					          :total="total"
 | 
				
			||||||
 | 
					          :page.sync="queryParams.pageNum"
 | 
				
			||||||
 | 
					          :limit.sync="queryParams.pageSize"
 | 
				
			||||||
 | 
					          :page-sizes="[10, 20, 50, 100]"
 | 
				
			||||||
 | 
					          @pagination="getList"
 | 
				
			||||||
 | 
					      />
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import {
 | 
				
			||||||
 | 
					  getMachineHistoryRecordListApi
 | 
				
			||||||
 | 
					} from '@/api/stquery/stquery';
 | 
				
			||||||
 | 
					import {
 | 
				
			||||||
 | 
					    getProjectList,
 | 
				
			||||||
 | 
					    getUnitList,
 | 
				
			||||||
 | 
					} from '@/api/back/index.js'
 | 
				
			||||||
 | 
					import Treeselect from "@riophae/vue-treeselect";
 | 
				
			||||||
 | 
					import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					    name: 'RepairTest',
 | 
				
			||||||
 | 
					    dicts: [],
 | 
				
			||||||
 | 
					    components: { Treeselect },
 | 
				
			||||||
 | 
					    data() {
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            // 遮罩层
 | 
				
			||||||
 | 
					            loading: false,
 | 
				
			||||||
 | 
					            // 选中数组
 | 
				
			||||||
 | 
					            ids: [],
 | 
				
			||||||
 | 
					            // 弹出层标题
 | 
				
			||||||
 | 
					            title: '查看',
 | 
				
			||||||
 | 
					            // 非单个禁用
 | 
				
			||||||
 | 
					            single: true,
 | 
				
			||||||
 | 
					            // 非多个禁用
 | 
				
			||||||
 | 
					            multiple: true,
 | 
				
			||||||
 | 
					            // 显示搜索条件
 | 
				
			||||||
 | 
					            showSearch: true,
 | 
				
			||||||
 | 
					            selectTreeProps: {
 | 
				
			||||||
 | 
					                children: 'children',
 | 
				
			||||||
 | 
					                label: 'name',
 | 
				
			||||||
 | 
					                // multiple: false,
 | 
				
			||||||
 | 
					                value: 'id',
 | 
				
			||||||
 | 
					                // multiple: true,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            unitId: null,
 | 
				
			||||||
 | 
					            projectId: null,
 | 
				
			||||||
 | 
					            unitList: [],
 | 
				
			||||||
 | 
					            proList: [],
 | 
				
			||||||
 | 
					            // 总条数
 | 
				
			||||||
 | 
					            total: 0,
 | 
				
			||||||
 | 
					            // 主表格数据
 | 
				
			||||||
 | 
					            tableList: [],
 | 
				
			||||||
 | 
					            // 查询参数
 | 
				
			||||||
 | 
					            queryParams: {
 | 
				
			||||||
 | 
					                pageNum: 1,
 | 
				
			||||||
 | 
					                pageSize: 10,
 | 
				
			||||||
 | 
					                time: null,
 | 
				
			||||||
 | 
					                unitId: null,
 | 
				
			||||||
 | 
					                proId: null,
 | 
				
			||||||
 | 
					                keyWord: null,
 | 
				
			||||||
 | 
					                typeName: null, //物资名称
 | 
				
			||||||
 | 
					                statusName: null //状态
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    created() {
 | 
				
			||||||
 | 
					        const end = new Date()
 | 
				
			||||||
 | 
					        let start = new Date()
 | 
				
			||||||
 | 
					        start.setMonth(start.getMonth() - 1)
 | 
				
			||||||
 | 
					        this.queryParams.time = [this.format(start), this.format(end)]
 | 
				
			||||||
 | 
					        this.initSelectData()
 | 
				
			||||||
 | 
					        this.getList()
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					      format(date) {
 | 
				
			||||||
 | 
					        const y = date.getFullYear()
 | 
				
			||||||
 | 
					        const m = String(date.getMonth() + 1).padStart(2, '0')
 | 
				
			||||||
 | 
					        const day = String(date.getDate()).padStart(2, '0')
 | 
				
			||||||
 | 
					        return `${y}-${m}-${day}`
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      initSelectData() {
 | 
				
			||||||
 | 
					          this.GetUnitData()
 | 
				
			||||||
 | 
					          this.GetProData()
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /** 转换菜单数据结构 */
 | 
				
			||||||
 | 
					      normalizer(node) {
 | 
				
			||||||
 | 
					            if (node.children && !node.children.length) {
 | 
				
			||||||
 | 
					                delete node.children;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return {
 | 
				
			||||||
 | 
					                id: node.id,
 | 
				
			||||||
 | 
					                label: node.name,
 | 
				
			||||||
 | 
					                children: node.children,
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      // 获取 来往单位 列表数据
 | 
				
			||||||
 | 
					      async GetUnitData() {
 | 
				
			||||||
 | 
					              const params = {
 | 
				
			||||||
 | 
					                //   projectId: this.queryParams.proId /*  */,
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					              const res = await getUnitList(params)
 | 
				
			||||||
 | 
					              this.unitList = res.data
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      unitChange(val){
 | 
				
			||||||
 | 
					        //   if(val&&val.length>0){
 | 
				
			||||||
 | 
					        //       this.queryParams.unitId=this.unitId[this.unitId.length - 1]
 | 
				
			||||||
 | 
					        //   }else if(val&&val.length==0){
 | 
				
			||||||
 | 
					        //       this.queryParams.unitId=""
 | 
				
			||||||
 | 
					        //   }
 | 
				
			||||||
 | 
					        //   this.GetProData()
 | 
				
			||||||
 | 
					        setTimeout(()=>{
 | 
				
			||||||
 | 
					            this.GetProData()
 | 
				
			||||||
 | 
					        },500)
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // 获取 工程名称 列表数据
 | 
				
			||||||
 | 
					      async GetProData() {
 | 
				
			||||||
 | 
					              const params = { unitId: this.queryParams.unitId}
 | 
				
			||||||
 | 
					              const res = await getProjectList(params)
 | 
				
			||||||
 | 
					              this.proList = res.data
 | 
				
			||||||
 | 
					              this.queryParams.proId=null
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      proChange(val){
 | 
				
			||||||
 | 
					        //   if(val&&val.length>0){
 | 
				
			||||||
 | 
					        //       this.queryParams.proId=this.projectId[this.projectId.length - 1]
 | 
				
			||||||
 | 
					        //   }else if(val&&val.length==0){
 | 
				
			||||||
 | 
					        //       this.queryParams.proId=""
 | 
				
			||||||
 | 
					        //   }
 | 
				
			||||||
 | 
					        //   this.GetUnitData()
 | 
				
			||||||
 | 
					        setTimeout(()=>{
 | 
				
			||||||
 | 
					            this.GetUnitData()
 | 
				
			||||||
 | 
					        },500)
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // 获取列表
 | 
				
			||||||
 | 
					      async getList() {
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            this.loading = true
 | 
				
			||||||
 | 
					            const params = {
 | 
				
			||||||
 | 
					                  unitId: this.queryParams.unitId,
 | 
				
			||||||
 | 
					                  proId: this.queryParams.proId,
 | 
				
			||||||
 | 
					                  keyWord: this.queryParams.keyWord,
 | 
				
			||||||
 | 
					                  typeName: this.queryParams.typeName,
 | 
				
			||||||
 | 
					                  statusName: this.queryParams.statusName,
 | 
				
			||||||
 | 
					                  startTime: this.queryParams.time && this.queryParams.time[0],
 | 
				
			||||||
 | 
					                  endTime: this.queryParams.time && this.queryParams.time[1],
 | 
				
			||||||
 | 
					                  pageSize: this.queryParams.pageSize,
 | 
				
			||||||
 | 
					                  pageNum: this.queryParams.pageNum
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            const res = await getMachineHistoryRecordListApi(params)
 | 
				
			||||||
 | 
					            this.loading = false
 | 
				
			||||||
 | 
					            if(res.data.rows.length>0){
 | 
				
			||||||
 | 
					              this.tableList = res.data.rows;
 | 
				
			||||||
 | 
					            }else{
 | 
				
			||||||
 | 
					              this.tableList=[]
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            this.total = res.data.total;
 | 
				
			||||||
 | 
					        } catch (error) {
 | 
				
			||||||
 | 
					            this.loading = false
 | 
				
			||||||
 | 
					        } finally {
 | 
				
			||||||
 | 
					            this.loading = false
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /** 搜索按钮操作 */
 | 
				
			||||||
 | 
					      handleQuery() {
 | 
				
			||||||
 | 
					          this.queryParams.pageNum = 1
 | 
				
			||||||
 | 
					          this.getList()
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /** 重置按钮操作 */
 | 
				
			||||||
 | 
					      resetQuery() {
 | 
				
			||||||
 | 
					        const end = new Date()
 | 
				
			||||||
 | 
					        let start = new Date()
 | 
				
			||||||
 | 
					        start.setMonth(start.getMonth() - 1)
 | 
				
			||||||
 | 
					        this.queryParams.time = [this.format(start), this.format(end)]
 | 
				
			||||||
 | 
					        this.unitId=[]
 | 
				
			||||||
 | 
					        this.projectId=[]
 | 
				
			||||||
 | 
					        this.resetForm('queryForm')
 | 
				
			||||||
 | 
					        this.handleQuery()
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /** 导出按钮操作 */
 | 
				
			||||||
 | 
					      handleExport() {
 | 
				
			||||||
 | 
					        const formatTime = (date) => {
 | 
				
			||||||
 | 
					          const year = date.getFullYear();
 | 
				
			||||||
 | 
					          const month = String(date.getMonth() + 1).padStart(2, '0');
 | 
				
			||||||
 | 
					          const day = String(date.getDate()).padStart(2, '0');
 | 
				
			||||||
 | 
					          const hours = String(date.getHours()).padStart(2, '0');
 | 
				
			||||||
 | 
					          const minutes = String(date.getMinutes()).padStart(2, '0');
 | 
				
			||||||
 | 
					          const seconds = String(date.getSeconds()).padStart(2, '0');
 | 
				
			||||||
 | 
					          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        const params = {
 | 
				
			||||||
 | 
					            unitId: this.queryParams.unitId,
 | 
				
			||||||
 | 
					            proId: this.queryParams.proId,
 | 
				
			||||||
 | 
					            keyWord: this.queryParams.keyWord,
 | 
				
			||||||
 | 
					            typeName: this.queryParams.typeName,
 | 
				
			||||||
 | 
					            statusName: this.queryParams.statusName,
 | 
				
			||||||
 | 
					            startTime: this.queryParams.time && this.queryParams.time[0],
 | 
				
			||||||
 | 
					            endTime: this.queryParams.time && this.queryParams.time[1],
 | 
				
			||||||
 | 
					            pageSize: this.queryParams.pageSize,
 | 
				
			||||||
 | 
					            pageNum: this.queryParams.pageNum
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        const currentTime = formatTime(new Date());
 | 
				
			||||||
 | 
					          this.download(
 | 
				
			||||||
 | 
					              'material/complex_query/exportMachineHistoryRecord',
 | 
				
			||||||
 | 
					              {
 | 
				
			||||||
 | 
					                  ...params,
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					              `维修检验试验_${currentTime}.xlsx`,
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
					::v-deep.el-table .fixed-width .el-button--mini {
 | 
				
			||||||
 | 
					    width: 60px !important;
 | 
				
			||||||
 | 
					    margin-bottom: 10px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.clickText {
 | 
				
			||||||
 | 
					  color: #02a7f0;
 | 
				
			||||||
 | 
					  cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,551 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					    <div class="app-container" id="">
 | 
				
			||||||
 | 
					      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
 | 
				
			||||||
 | 
					        <el-form-item prop="time">
 | 
				
			||||||
 | 
					            <el-date-picker
 | 
				
			||||||
 | 
					                v-model="queryParams.time"
 | 
				
			||||||
 | 
					                range-separator="至"
 | 
				
			||||||
 | 
					                start-placeholder="开始日期"
 | 
				
			||||||
 | 
					                end-placeholder="结束日期"
 | 
				
			||||||
 | 
					                type="daterange"
 | 
				
			||||||
 | 
					                value-format="yyyy-MM-dd"
 | 
				
			||||||
 | 
					                style="width: 240px"
 | 
				
			||||||
 | 
					            ></el-date-picker>
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="keyWord">
 | 
				
			||||||
 | 
					          <el-input
 | 
				
			||||||
 | 
					            v-model="queryParams.keyWord"
 | 
				
			||||||
 | 
					            placeholder="请输入关键字"
 | 
				
			||||||
 | 
					            clearable :maxlength="20"
 | 
				
			||||||
 | 
					            style="width: 240px"
 | 
				
			||||||
 | 
					          />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="unitId">
 | 
				
			||||||
 | 
					            <treeselect
 | 
				
			||||||
 | 
					                v-model="queryParams.unitId"
 | 
				
			||||||
 | 
					                :options="unitList" :normalizer="normalizer"
 | 
				
			||||||
 | 
					                :show-count="true" style="width: 240px" :disable-branch-nodes="true"
 | 
				
			||||||
 | 
					                noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
 | 
				
			||||||
 | 
					                placeholder="请选择退料单位" @select="unitChange"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="proId">
 | 
				
			||||||
 | 
					            <treeselect
 | 
				
			||||||
 | 
					                v-model="queryParams.proId"
 | 
				
			||||||
 | 
					                :options="proList" :normalizer="normalizer"
 | 
				
			||||||
 | 
					                :show-count="true" style="width: 240px" :disable-branch-nodes="true"
 | 
				
			||||||
 | 
					                noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
 | 
				
			||||||
 | 
					                placeholder="请选择退料工程" @select="proChange"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item prop="typeName">
 | 
				
			||||||
 | 
					            <el-input
 | 
				
			||||||
 | 
					                v-model="queryParams.typeName"
 | 
				
			||||||
 | 
					                placeholder="请输入机具名称"
 | 
				
			||||||
 | 
					                clearable :maxlength="20"
 | 
				
			||||||
 | 
					                style="width: 240px"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					        <el-form-item>
 | 
				
			||||||
 | 
					            <el-button
 | 
				
			||||||
 | 
					                type="primary"
 | 
				
			||||||
 | 
					                icon="el-icon-search"
 | 
				
			||||||
 | 
					                size="mini"
 | 
				
			||||||
 | 
					                @click="handleQuery"
 | 
				
			||||||
 | 
					                >查询</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            <el-button
 | 
				
			||||||
 | 
					                icon="el-icon-refresh"
 | 
				
			||||||
 | 
					                size="mini"
 | 
				
			||||||
 | 
					                @click="resetQuery"
 | 
				
			||||||
 | 
					                >重置</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            <el-button
 | 
				
			||||||
 | 
					                type="warning"
 | 
				
			||||||
 | 
					                plain
 | 
				
			||||||
 | 
					                icon="el-icon-download"
 | 
				
			||||||
 | 
					                size="mini"
 | 
				
			||||||
 | 
					                @click="handleExport"
 | 
				
			||||||
 | 
					                >导出</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					        </el-form-item>
 | 
				
			||||||
 | 
					      </el-form>
 | 
				
			||||||
 | 
					      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
				
			||||||
 | 
					      <el-table v-loading="loading" :data="tableList" border :max-height="650">
 | 
				
			||||||
 | 
					          <el-table-column label="序号" align="center" type="index">
 | 
				
			||||||
 | 
					                <template scope="scope">
 | 
				
			||||||
 | 
					                    <span>{{ (queryParams.pageNum - 1) * 10 + scope.$index+1 }}</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					          </el-table-column>
 | 
				
			||||||
 | 
					          <el-table-column label="退料单位" align="center" prop="unitName" />
 | 
				
			||||||
 | 
					          <el-table-column label="退料工程" align="center" prop="proName" />
 | 
				
			||||||
 | 
					          <el-table-column label="维修单号" align="center" prop="code"  :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="机具名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="设备编号" align="center" prop="maCode" :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					          <el-table-column label="操作" align="center" >
 | 
				
			||||||
 | 
					            <template slot-scope="scope">
 | 
				
			||||||
 | 
					                <el-button size="mini" type="success"   @click="handleRecord(scope.row)">试验记录单</el-button>
 | 
				
			||||||
 | 
					            </template>
 | 
				
			||||||
 | 
					          </el-table-column>
 | 
				
			||||||
 | 
					      </el-table>
 | 
				
			||||||
 | 
					      <pagination
 | 
				
			||||||
 | 
					          v-show="total > 0"
 | 
				
			||||||
 | 
					          :total="total"
 | 
				
			||||||
 | 
					          :page.sync="queryParams.pageNum"
 | 
				
			||||||
 | 
					          :limit.sync="queryParams.pageSize"
 | 
				
			||||||
 | 
					          :page-sizes="[10, 20, 50, 100]"
 | 
				
			||||||
 | 
					          @pagination="getList"
 | 
				
			||||||
 | 
					      />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- 弹框 -->
 | 
				
			||||||
 | 
					    <el-dialog title="试验记录表" :visible.sync="dialogVisible" width="46%" @close="closeDialog">
 | 
				
			||||||
 | 
					      <div  id="print-content">
 | 
				
			||||||
 | 
					        <vue-easy-print tableShow ref="remarksPrintRef2" class="print" style="margin: 0 20px">
 | 
				
			||||||
 | 
					          <div style="text-align: center; font-weight: 600; font-size: 30px">机具(物流)分公司动力设备维修及试验记录单</div>
 | 
				
			||||||
 | 
					            <div class="info" style="margin: 10px 20px 0; display: flex; justify-content: space-between;">
 | 
				
			||||||
 | 
					                  <div
 | 
				
			||||||
 | 
					                        class="item"
 | 
				
			||||||
 | 
					                        style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
 | 
				
			||||||
 | 
					                        <span>退料单号:{{this.printInfo.code}}</span>
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					                    <div
 | 
				
			||||||
 | 
					                        class="item"
 | 
				
			||||||
 | 
					                        style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
 | 
				
			||||||
 | 
					                        <span>提交日期:{{this.printInfo.createTime}}</span>
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					                    <div class="item" style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
 | 
				
			||||||
 | 
					                        <span>设备编号:{{this.printInfo.maCode}}</span>
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          <div style="border: 3px solid #000; min-height: 900px; line-height: 3; position: relative">
 | 
				
			||||||
 | 
					            <div style="font-weight: 800; border-bottom: 1px solid #888; display: flex">
 | 
				
			||||||
 | 
					              <div style="width: 100%; padding-left: 10px;text-align: center">{{this.printInfo.typeName }}</div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <div v-for="(group, groupIndex) in groupPrintData" :key="groupIndex" style="display: flex; border-bottom: 1px solid #000;">
 | 
				
			||||||
 | 
					              <!-- 遍历分组中的每个元素,每个元素生成 name 和 status 两个表格 -->
 | 
				
			||||||
 | 
					              <div v-for="(row, index) in group" :key="index" style="flex: 1; display: flex; border-right: 1px solid #000;">
 | 
				
			||||||
 | 
					                <div style="flex: 1; text-align: center; border-right: 1px solid #000; padding: 3px;">
 | 
				
			||||||
 | 
					                  <span style="display: block;">{{ row.partName || '' }}</span>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <div style="flex: 1; text-align: center; padding: 3px;">
 | 
				
			||||||
 | 
					                  <span style="display: block;">{{ row.status || '' }}</span>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          <div style="position: absolute; bottom: 0; width: 100%;">
 | 
				
			||||||
 | 
					            <div style="font-weight: 800; border-bottom: 1px solid #888;border-top: 1px solid #888; display: flex">
 | 
				
			||||||
 | 
					              <div style="width: 20%; text-align: center;border-right: 1px solid #888;">空载试验</div>
 | 
				
			||||||
 | 
					              <div style="width: 80%; text-align: center; display: flex; justify-content: space-between; ">
 | 
				
			||||||
 | 
					                <!-- <span style="margin-left: 10px;">维修提交合格<span style="letter-spacing: 2em;">(    )</span></span>
 | 
				
			||||||
 | 
					                <span>维修提交报废<span style="letter-spacing: 2em;">(    )</span></span> -->
 | 
				
			||||||
 | 
					                <span style="margin-left: 10px;">维修提交合格<span :style="{ letterSpacing: printInfo && printInfo.scrapNum === 0 ? '0.9em' : '2em' }">(
 | 
				
			||||||
 | 
					                  <!-- 当 scrapNum 等于 0 时显示打勾图片 -->
 | 
				
			||||||
 | 
					                  <img v-if="printInfo && printInfo.scrapNum === 0" src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.0em 0 0; display: inline-block;"/>
 | 
				
			||||||
 | 
					                )</span></span>
 | 
				
			||||||
 | 
					                <span>维修提交报废<span :style="{ letterSpacing: printInfo && printInfo.scrapNum > 0 ? '1.0em' : '2em' }">(
 | 
				
			||||||
 | 
					                  <!-- 当 scrapNum 大于 0 时显示打勾图片 -->
 | 
				
			||||||
 | 
					                  <img v-if="printInfo && printInfo.scrapNum > 0" src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.0em 0 0; display: inline-block;"/>
 | 
				
			||||||
 | 
					                )</span></span>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <div style="font-weight: 800; border-bottom: 1px solid #888; display: flex">
 | 
				
			||||||
 | 
					              <div style="width: 20%; text-align: center;border-right: 1px solid #888;">标识等</div>
 | 
				
			||||||
 | 
					              <div style="width: 80%; text-align: center; display: flex; justify-content: space-between;">
 | 
				
			||||||
 | 
					                <span style="margin-left: 10px;">二维码<span style="letter-spacing: 1.5em;">(<img src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.2em 0 0; display: inline-block;"/>)</span></span>
 | 
				
			||||||
 | 
					                <span>铭牌<span style="letter-spacing: 1.5em;">(<img src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.2em 0 0; display: inline-block;"/>)</span></span>
 | 
				
			||||||
 | 
					                <span>档位<span style="letter-spacing: 1.5em;">(<img src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.2em 0 0; display: inline-block;"/>)</span></span>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <div style="font-weight: 800; border-bottom: 1px solid #888; display: flex">
 | 
				
			||||||
 | 
					              <div style="width: 60%;  display: flex; flex-direction: column;">
 | 
				
			||||||
 | 
					                <!-- 第一行:试验记录标题 -->
 | 
				
			||||||
 | 
					                <div style="display: flex; border-bottom: 1px solid #888;height: 40px;">
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">额定负载</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">试验负载(T/MPa)</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center;">持荷时间(分/秒)</div>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <!-- 第二行:试验记录结果 -->
 | 
				
			||||||
 | 
					                <div style="display: flex; border-bottom: 1px solid #888;height: 40px;">
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ testResult1 || '' }}</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ testResult2 || '' }}</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center;">{{ testResult3 || '' }}</div>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <!-- 第三行:试验日期、检验人员、提交人员标题 -->
 | 
				
			||||||
 | 
					                <div style="display: flex; border-bottom: 1px solid #888;height: 40px;">
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">试验日期</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">检修人员</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center;">试验人员</div>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <!-- 第四行:对应结果 -->
 | 
				
			||||||
 | 
					                <div style="display: flex;height: 40px;">
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ formatDate(printInfo.createTime) }}</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ this.printInfo.repairer }}</div>
 | 
				
			||||||
 | 
					                  <div style="flex: 1; text-align: center;">{{  this.printInfo.userName }}</div>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					              <!-- 右边部分,占三分之一 -->
 | 
				
			||||||
 | 
					              <div style="width: 40%; display: flex; border-left: 1px solid #888;">
 | 
				
			||||||
 | 
					                <!-- 第一列:试验结论 -->
 | 
				
			||||||
 | 
					                <div style="width: 25%;text-align: center; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid #888;">
 | 
				
			||||||
 | 
					                  <span>试验结论</span>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <!-- 第二列:合格 -->
 | 
				
			||||||
 | 
					                <div style="width: 75%; padding: 0;">
 | 
				
			||||||
 | 
					                  <input 
 | 
				
			||||||
 | 
					                    type="text"
 | 
				
			||||||
 | 
					                    v-model="testConclusion"
 | 
				
			||||||
 | 
					                    style="
 | 
				
			||||||
 | 
					                      width: 100%;
 | 
				
			||||||
 | 
					                      height: 100%;
 | 
				
			||||||
 | 
					                      font-size: 64px;
 | 
				
			||||||
 | 
					                      color: red;
 | 
				
			||||||
 | 
					                      font-weight: bold;
 | 
				
			||||||
 | 
					                      border: none;
 | 
				
			||||||
 | 
					                      outline: none;
 | 
				
			||||||
 | 
					                      box-sizing: border-box;
 | 
				
			||||||
 | 
					                      text-align: center;
 | 
				
			||||||
 | 
					                      background-color: white;
 | 
				
			||||||
 | 
					                      font-family: SimSun;
 | 
				
			||||||
 | 
					                    "
 | 
				
			||||||
 | 
					                  />
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          <div class="fillIn" style="margin-top: 10px; display: flex; justify-content: space-between">
 | 
				
			||||||
 | 
					            <div class="item" style="width: 33%">
 | 
				
			||||||
 | 
					              <div>
 | 
				
			||||||
 | 
					                <span>审核:</span>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <div class="item" style="width: 33%">
 | 
				
			||||||
 | 
					              <div>
 | 
				
			||||||
 | 
					                <span>检验员:{{ '高民' }}</span>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </vue-easy-print>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <div slot="footer" class="dialog-footer" style="text-align: center">
 | 
				
			||||||
 | 
					        <el-button type="primary" @click="print">打 印</el-button>
 | 
				
			||||||
 | 
					        <el-button @click="closeDialog">关 闭</el-button>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </el-dialog>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import {
 | 
				
			||||||
 | 
					  getMachineHistoryRecordListApi
 | 
				
			||||||
 | 
					} from '@/api/stquery/stquery';
 | 
				
			||||||
 | 
					import {
 | 
				
			||||||
 | 
					    getProjectList,
 | 
				
			||||||
 | 
					    getUnitList,
 | 
				
			||||||
 | 
					} from '@/api/back/index.js'
 | 
				
			||||||
 | 
					import Treeselect from "@riophae/vue-treeselect";
 | 
				
			||||||
 | 
					import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					    name: 'TestRecord',
 | 
				
			||||||
 | 
					    dicts: [],
 | 
				
			||||||
 | 
					    components: { Treeselect },
 | 
				
			||||||
 | 
					    data() {
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            // 遮罩层
 | 
				
			||||||
 | 
					            loading: false,
 | 
				
			||||||
 | 
					            // 选中数组
 | 
				
			||||||
 | 
					            ids: [],
 | 
				
			||||||
 | 
					            // 弹出层标题
 | 
				
			||||||
 | 
					            title: '查看',
 | 
				
			||||||
 | 
					            // 非单个禁用
 | 
				
			||||||
 | 
					            single: true,
 | 
				
			||||||
 | 
					            // 非多个禁用
 | 
				
			||||||
 | 
					            multiple: true,
 | 
				
			||||||
 | 
					            // 显示搜索条件
 | 
				
			||||||
 | 
					            showSearch: true,
 | 
				
			||||||
 | 
					            selectTreeProps: {
 | 
				
			||||||
 | 
					                children: 'children',
 | 
				
			||||||
 | 
					                label: 'name',
 | 
				
			||||||
 | 
					                // multiple: false,
 | 
				
			||||||
 | 
					                value: 'id',
 | 
				
			||||||
 | 
					                // multiple: true,
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            unitId: null,
 | 
				
			||||||
 | 
					            projectId: null,
 | 
				
			||||||
 | 
					            unitList: [],
 | 
				
			||||||
 | 
					            proList: [],
 | 
				
			||||||
 | 
					            // 总条数
 | 
				
			||||||
 | 
					            total: 0,
 | 
				
			||||||
 | 
					            // 主表格数据
 | 
				
			||||||
 | 
					            tableList: [],
 | 
				
			||||||
 | 
					            // 查询参数
 | 
				
			||||||
 | 
					            queryParams: {
 | 
				
			||||||
 | 
					                pageNum: 1,
 | 
				
			||||||
 | 
					                pageSize: 10,
 | 
				
			||||||
 | 
					                time: null,
 | 
				
			||||||
 | 
					                unitId: null,
 | 
				
			||||||
 | 
					                proId: null,
 | 
				
			||||||
 | 
					                keyWord: null,
 | 
				
			||||||
 | 
					                typeName: null, //物资名称
 | 
				
			||||||
 | 
					                statusName: null //状态
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            dialogVisible: false, // 弹框显示
 | 
				
			||||||
 | 
					            printTableData: [], 
 | 
				
			||||||
 | 
					            printInfo:{},
 | 
				
			||||||
 | 
					            testResult1: '',
 | 
				
			||||||
 | 
					            testResult2: '',
 | 
				
			||||||
 | 
					            testResult3: '',
 | 
				
			||||||
 | 
					            testConclusion: '合格',
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    computed: {
 | 
				
			||||||
 | 
					        groupPrintData() {
 | 
				
			||||||
 | 
					            const result = [];
 | 
				
			||||||
 | 
					            console.log("xxxxxxxxxxxxx",this.printTableData.length)
 | 
				
			||||||
 | 
					            for (let i = 0; i < this.printTableData.length; i += 2) {
 | 
				
			||||||
 | 
					                const group = this.printTableData.slice(i, i + 2);
 | 
				
			||||||
 | 
					                // 若分组不足 2 个元素,补充空对象
 | 
				
			||||||
 | 
					                while (group.length < 2) {
 | 
				
			||||||
 | 
					                    group.push({ partName: '', status: '' });
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                result.push(group);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    created() {
 | 
				
			||||||
 | 
					        const end = new Date()
 | 
				
			||||||
 | 
					        let start = new Date()
 | 
				
			||||||
 | 
					        start.setMonth(start.getMonth() - 1)
 | 
				
			||||||
 | 
					        this.queryParams.time = [this.format(start), this.format(end)]
 | 
				
			||||||
 | 
					        this.initSelectData()
 | 
				
			||||||
 | 
					        this.getList()
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					      format(date) {
 | 
				
			||||||
 | 
					        const y = date.getFullYear()
 | 
				
			||||||
 | 
					        const m = String(date.getMonth() + 1).padStart(2, '0')
 | 
				
			||||||
 | 
					        const day = String(date.getDate()).padStart(2, '0')
 | 
				
			||||||
 | 
					        return `${y}-${m}-${day}`
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 定义格式化日期的方法
 | 
				
			||||||
 | 
					      formatDate(dateStr) {
 | 
				
			||||||
 | 
					        if (!dateStr) return '';
 | 
				
			||||||
 | 
					        const date = new Date(dateStr);
 | 
				
			||||||
 | 
					        const year = date.getFullYear();
 | 
				
			||||||
 | 
					        const month = String(date.getMonth() + 1).padStart(2, '0');
 | 
				
			||||||
 | 
					        const day = String(date.getDate()).padStart(2, '0');
 | 
				
			||||||
 | 
					        return `${year}-${month}-${day}`;
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      initSelectData() {
 | 
				
			||||||
 | 
					          this.GetUnitData()
 | 
				
			||||||
 | 
					          this.GetProData()
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /** 转换菜单数据结构 */
 | 
				
			||||||
 | 
					      normalizer(node) {
 | 
				
			||||||
 | 
					            if (node.children && !node.children.length) {
 | 
				
			||||||
 | 
					                delete node.children;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return {
 | 
				
			||||||
 | 
					                id: node.id,
 | 
				
			||||||
 | 
					                label: node.name,
 | 
				
			||||||
 | 
					                children: node.children,
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      // 获取 来往单位 列表数据
 | 
				
			||||||
 | 
					      async GetUnitData() {
 | 
				
			||||||
 | 
					              const params = {
 | 
				
			||||||
 | 
					                //   projectId: this.queryParams.proId /*  */,
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					              const res = await getUnitList(params)
 | 
				
			||||||
 | 
					              this.unitList = res.data
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      unitChange(val){
 | 
				
			||||||
 | 
					        //   if(val&&val.length>0){
 | 
				
			||||||
 | 
					        //       this.queryParams.unitId=this.unitId[this.unitId.length - 1]
 | 
				
			||||||
 | 
					        //   }else if(val&&val.length==0){
 | 
				
			||||||
 | 
					        //       this.queryParams.unitId=""
 | 
				
			||||||
 | 
					        //   }
 | 
				
			||||||
 | 
					        //   this.GetProData()
 | 
				
			||||||
 | 
					        setTimeout(()=>{
 | 
				
			||||||
 | 
					            this.GetProData()
 | 
				
			||||||
 | 
					        },500)
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // 获取 工程名称 列表数据
 | 
				
			||||||
 | 
					      async GetProData() {
 | 
				
			||||||
 | 
					              const params = { unitId: this.queryParams.unitId}
 | 
				
			||||||
 | 
					              const res = await getProjectList(params)
 | 
				
			||||||
 | 
					              this.proList = res.data
 | 
				
			||||||
 | 
					              this.queryParams.proId=null
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      proChange(val){
 | 
				
			||||||
 | 
					        //   if(val&&val.length>0){
 | 
				
			||||||
 | 
					        //       this.queryParams.proId=this.projectId[this.projectId.length - 1]
 | 
				
			||||||
 | 
					        //   }else if(val&&val.length==0){
 | 
				
			||||||
 | 
					        //       this.queryParams.proId=""
 | 
				
			||||||
 | 
					        //   }
 | 
				
			||||||
 | 
					        //   this.GetUnitData()
 | 
				
			||||||
 | 
					        setTimeout(()=>{
 | 
				
			||||||
 | 
					            this.GetUnitData()
 | 
				
			||||||
 | 
					        },500)
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // 获取列表
 | 
				
			||||||
 | 
					      async getList() {
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            this.loading = true
 | 
				
			||||||
 | 
					            const params = {
 | 
				
			||||||
 | 
					                  unitId: this.queryParams.unitId,
 | 
				
			||||||
 | 
					                  proId: this.queryParams.proId,
 | 
				
			||||||
 | 
					                  keyWord: this.queryParams.keyWord,
 | 
				
			||||||
 | 
					                  typeName: this.queryParams.typeName,
 | 
				
			||||||
 | 
					                  statusName: this.queryParams.statusName,
 | 
				
			||||||
 | 
					                  startTime: this.queryParams.time && this.queryParams.time[0],
 | 
				
			||||||
 | 
					                  endTime: this.queryParams.time && this.queryParams.time[1],
 | 
				
			||||||
 | 
					                  pageSize: this.queryParams.pageSize,
 | 
				
			||||||
 | 
					                  pageNum: this.queryParams.pageNum
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            const res = await getMachineHistoryRecordListApi(params)
 | 
				
			||||||
 | 
					            this.loading = false
 | 
				
			||||||
 | 
					            if(res.data.rows.length>0){
 | 
				
			||||||
 | 
					              this.tableList = res.data.rows;
 | 
				
			||||||
 | 
					            }else{
 | 
				
			||||||
 | 
					              this.tableList=[]
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            this.total = res.data.total;
 | 
				
			||||||
 | 
					        } catch (error) {
 | 
				
			||||||
 | 
					            this.loading = false
 | 
				
			||||||
 | 
					        } finally {
 | 
				
			||||||
 | 
					            this.loading = false
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /** 搜索按钮操作 */
 | 
				
			||||||
 | 
					      handleQuery() {
 | 
				
			||||||
 | 
					          this.queryParams.pageNum = 1
 | 
				
			||||||
 | 
					          this.getList()
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /** 重置按钮操作 */
 | 
				
			||||||
 | 
					      resetQuery() {
 | 
				
			||||||
 | 
					        const end = new Date()
 | 
				
			||||||
 | 
					        let start = new Date()
 | 
				
			||||||
 | 
					        start.setMonth(start.getMonth() - 1)
 | 
				
			||||||
 | 
					        this.queryParams.time = [this.format(start), this.format(end)]
 | 
				
			||||||
 | 
					        this.unitId=[]
 | 
				
			||||||
 | 
					        this.projectId=[]
 | 
				
			||||||
 | 
					        this.resetForm('queryForm')
 | 
				
			||||||
 | 
					        this.handleQuery()
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        async handleRecord(row){
 | 
				
			||||||
 | 
					        this.dialogVisible = true;
 | 
				
			||||||
 | 
					        this.printTableData = [];
 | 
				
			||||||
 | 
					        let param  = {
 | 
				
			||||||
 | 
					            id:row.id,
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        const res = await getRepairRecord(param)
 | 
				
			||||||
 | 
					        this.printInfo = res.data[0]
 | 
				
			||||||
 | 
					        if(this.printInfo && this.printInfo.ratedLoad) {
 | 
				
			||||||
 | 
					            this.testResult1 = this.printInfo.ratedLoad + '(T/MPa)'
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            this.testResult1 = ''
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if(this.printInfo && this.printInfo.testLoad) {
 | 
				
			||||||
 | 
					            this.testResult2 = this.printInfo.testLoad + '(T/MPa)'
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            this.testResult2 = ''
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if(this.printInfo && this.printInfo.holdingTime) {
 | 
				
			||||||
 | 
					            this.testResult3 = this.printInfo.holdingTime + '(分/秒)'
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            this.testResult3 = ''
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if(res.data[0].partTypeList&& res.data[0].partTypeList.length != 0){
 | 
				
			||||||
 | 
					            res.data[0].partTypeList.forEach((e) => {
 | 
				
			||||||
 | 
					            this.printTableData.push({'partName':e.partName,'status':'不合格更换'})
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 打印
 | 
				
			||||||
 | 
					        print() {
 | 
				
			||||||
 | 
					            printJS({
 | 
				
			||||||
 | 
					            printable: 'print-content',
 | 
				
			||||||
 | 
					            type: 'html', //
 | 
				
			||||||
 | 
					            // targetStyles: ['*'], // 打印的元素样式
 | 
				
			||||||
 | 
					            scanStyles: false, // 是否扫描页面样式
 | 
				
			||||||
 | 
					            // css: [
 | 
				
			||||||
 | 
					            //   'https://unpkg.com/element-ui/lib/theme-chalk/index.css' // Element UI 的样式表
 | 
				
			||||||
 | 
					            // ],
 | 
				
			||||||
 | 
					            maxWidth: '1400'
 | 
				
			||||||
 | 
					            // 其他配置选项
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 关闭弹框并清除数据
 | 
				
			||||||
 | 
					        closeDialog() {
 | 
				
			||||||
 | 
					            this.dialogVisible = false; // 关闭弹框
 | 
				
			||||||
 | 
					            this.printInfo = {}; // 清空数据
 | 
				
			||||||
 | 
					            this.printTableData = []; // 清空表格数据
 | 
				
			||||||
 | 
					            this.testResult1 = '';
 | 
				
			||||||
 | 
					            this.testResult2 = '';
 | 
				
			||||||
 | 
					            this.testResult3 = '';
 | 
				
			||||||
 | 
					            this.testConclusion = '合格';
 | 
				
			||||||
 | 
					        },       
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      /** 导出按钮操作 */
 | 
				
			||||||
 | 
					      handleExport() {
 | 
				
			||||||
 | 
					        const formatTime = (date) => {
 | 
				
			||||||
 | 
					          const year = date.getFullYear();
 | 
				
			||||||
 | 
					          const month = String(date.getMonth() + 1).padStart(2, '0');
 | 
				
			||||||
 | 
					          const day = String(date.getDate()).padStart(2, '0');
 | 
				
			||||||
 | 
					          const hours = String(date.getHours()).padStart(2, '0');
 | 
				
			||||||
 | 
					          const minutes = String(date.getMinutes()).padStart(2, '0');
 | 
				
			||||||
 | 
					          const seconds = String(date.getSeconds()).padStart(2, '0');
 | 
				
			||||||
 | 
					          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        const params = {
 | 
				
			||||||
 | 
					            unitId: this.queryParams.unitId,
 | 
				
			||||||
 | 
					            proId: this.queryParams.proId,
 | 
				
			||||||
 | 
					            keyWord: this.queryParams.keyWord,
 | 
				
			||||||
 | 
					            typeName: this.queryParams.typeName,
 | 
				
			||||||
 | 
					            statusName: this.queryParams.statusName,
 | 
				
			||||||
 | 
					            startTime: this.queryParams.time && this.queryParams.time[0],
 | 
				
			||||||
 | 
					            endTime: this.queryParams.time && this.queryParams.time[1],
 | 
				
			||||||
 | 
					            pageSize: this.queryParams.pageSize,
 | 
				
			||||||
 | 
					            pageNum: this.queryParams.pageNum
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        const currentTime = formatTime(new Date());
 | 
				
			||||||
 | 
					          this.download(
 | 
				
			||||||
 | 
					              'material/complex_query/exportMachineHistoryRecord',
 | 
				
			||||||
 | 
					              {
 | 
				
			||||||
 | 
					                  ...params,
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					              `试验记录_${currentTime}.xlsx`,
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
					::v-deep.el-table .fixed-width .el-button--mini {
 | 
				
			||||||
 | 
					    width: 60px !important;
 | 
				
			||||||
 | 
					    margin-bottom: 10px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.clickText {
 | 
				
			||||||
 | 
					  color: #02a7f0;
 | 
				
			||||||
 | 
					  cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
		Loading…
	
		Reference in New Issue