配件库存、维修单签名、报废附件校验、报告loding
This commit is contained in:
		
							parent
							
								
									58739a7637
								
							
						
					
					
						commit
						2d2de874d2
					
				| 
						 | 
					@ -0,0 +1,155 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					    <div class="app-container">
 | 
				
			||||||
 | 
					      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
 | 
				
			||||||
 | 
					        <el-form-item  prop="keyWord">
 | 
				
			||||||
 | 
					            <el-input
 | 
				
			||||||
 | 
					                v-model="queryParams.keyWord"
 | 
				
			||||||
 | 
					                placeholder="请输入关键词"
 | 
				
			||||||
 | 
					                clearable
 | 
				
			||||||
 | 
					                @keyup.enter.native="handleQuery"
 | 
				
			||||||
 | 
					                maxlength="20"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </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-form-item>
 | 
				
			||||||
 | 
					      </el-form>
 | 
				
			||||||
 | 
					      <el-row :gutter="10" class="mb8">
 | 
				
			||||||
 | 
					            <el-col :span="1.5">
 | 
				
			||||||
 | 
					                <el-button
 | 
				
			||||||
 | 
					                    type="warning" plain
 | 
				
			||||||
 | 
					                    icon="el-icon-download"
 | 
				
			||||||
 | 
					                    size="mini"
 | 
				
			||||||
 | 
					                    @click="handleExport"
 | 
				
			||||||
 | 
					                >导出数据</el-button>
 | 
				
			||||||
 | 
					            </el-col>
 | 
				
			||||||
 | 
					        </el-row>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="taskId" border>
 | 
				
			||||||
 | 
					        <el-table-column label="序号" align="center" width="80" type="index">
 | 
				
			||||||
 | 
					          <template slot-scope="scope">
 | 
				
			||||||
 | 
					            <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
 | 
				
			||||||
 | 
					          </template>
 | 
				
			||||||
 | 
					        </el-table-column>
 | 
				
			||||||
 | 
					        <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="storeNum"  :show-overflow-tooltip="true"/>
 | 
				
			||||||
 | 
					      </el-table>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <pagination
 | 
				
			||||||
 | 
					        v-show="total>0"
 | 
				
			||||||
 | 
					        :total="total"
 | 
				
			||||||
 | 
					        :page.sync="queryParams.pageNum"
 | 
				
			||||||
 | 
					        :limit.sync="queryParams.pageSize"
 | 
				
			||||||
 | 
					        @pagination="getList"
 | 
				
			||||||
 | 
					      />
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  </template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <script>
 | 
				
			||||||
 | 
					  import {getPartPersonNumApi} from '@/api/part/partArrived';
 | 
				
			||||||
 | 
					import vueEasyPrint from "vue-easy-print";
 | 
				
			||||||
 | 
					  export default {
 | 
				
			||||||
 | 
					    name: "PartAccept",
 | 
				
			||||||
 | 
					    dicts: ['part_task_status'],
 | 
				
			||||||
 | 
					    components: { vueEasyPrint },
 | 
				
			||||||
 | 
					    data() {
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        // 遮罩层
 | 
				
			||||||
 | 
					        loading: false,
 | 
				
			||||||
 | 
					        // 非单个禁用
 | 
				
			||||||
 | 
					        single: true,
 | 
				
			||||||
 | 
					        // 非多个禁用
 | 
				
			||||||
 | 
					        multiple: true,
 | 
				
			||||||
 | 
					        // 显示搜索条件
 | 
				
			||||||
 | 
					        showSearch: true,
 | 
				
			||||||
 | 
					        // 总条数
 | 
				
			||||||
 | 
					        total: 0,
 | 
				
			||||||
 | 
					        //表格数据
 | 
				
			||||||
 | 
					        tableList: [],
 | 
				
			||||||
 | 
					        // 弹出层标题
 | 
				
			||||||
 | 
					        title: "",
 | 
				
			||||||
 | 
					        // 是否显示弹出层
 | 
				
			||||||
 | 
					        open: false,
 | 
				
			||||||
 | 
					        // 查询参数
 | 
				
			||||||
 | 
					        queryParams: {
 | 
				
			||||||
 | 
					          pageNum: 1,
 | 
				
			||||||
 | 
					          pageSize: 10,
 | 
				
			||||||
 | 
					          keyWord:undefined,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    created() {
 | 
				
			||||||
 | 
					      this.getList();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					        /** 查询列表 */
 | 
				
			||||||
 | 
					        getList() {
 | 
				
			||||||
 | 
					            this.loading = true;
 | 
				
			||||||
 | 
					          getPartPersonNumApi(this.queryParams).then(response => {
 | 
				
			||||||
 | 
					                this.tableList = response.data.rows;
 | 
				
			||||||
 | 
					                this.total = response.data.total;
 | 
				
			||||||
 | 
					                this.loading = false;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        /** 重置按钮操作 */
 | 
				
			||||||
 | 
					        resetQuery() {
 | 
				
			||||||
 | 
					            this.resetForm("queryForm");
 | 
				
			||||||
 | 
					            this.queryParams.keyWord=null;
 | 
				
			||||||
 | 
					            this.handleQuery();
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        /** 搜索按钮操作 */
 | 
				
			||||||
 | 
					        handleQuery() {
 | 
				
			||||||
 | 
					        this.queryParams.pageNum = 1;
 | 
				
			||||||
 | 
					        this.getList();
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        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 currentTime = formatTime(new Date());
 | 
				
			||||||
 | 
					            this.download(
 | 
				
			||||||
 | 
					                "/material/complex_query/export",
 | 
				
			||||||
 | 
					                { ...this.queryParams},
 | 
				
			||||||
 | 
					                `配件库存_${currentTime}.xlsx`
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  </script>
 | 
				
			||||||
 | 
					  <style lang="scss" scoped>
 | 
				
			||||||
 | 
					  .uploadImg {
 | 
				
			||||||
 | 
					    padding-top: 20px;
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    align-items: center;
 | 
				
			||||||
 | 
					    justify-content: center;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  .deviceCode {
 | 
				
			||||||
 | 
					      margin-top: 10px;
 | 
				
			||||||
 | 
					      padding-bottom: 20px;
 | 
				
			||||||
 | 
					      font-size: 18px;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  ::v-deep.el-table .fixed-width .el-button--mini {
 | 
				
			||||||
 | 
					      width: 60px !important;
 | 
				
			||||||
 | 
					      margin-bottom: 10px;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  //隐藏图片上传框的css
 | 
				
			||||||
 | 
					  ::v-deep.disabled {
 | 
				
			||||||
 | 
					      .el-upload--picture-card {
 | 
				
			||||||
 | 
					          display: none;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  </style>
 | 
				
			||||||
| 
						 | 
					@ -350,22 +350,40 @@
 | 
				
			||||||
                <el-table-column label="操作" align="center" width="100">
 | 
					                <el-table-column label="操作" align="center" width="100">
 | 
				
			||||||
                  <template slot-scope="scope">
 | 
					                  <template slot-scope="scope">
 | 
				
			||||||
                    <div style="display: flex; align-items: center; justify-content: space-between">
 | 
					                    <div style="display: flex; align-items: center; justify-content: space-between">
 | 
				
			||||||
                    <el-upload ref="upload"  :headers="upload.headers"
 | 
					                      <el-upload
 | 
				
			||||||
                    :action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
 | 
					                        ref="upload"
 | 
				
			||||||
                    :on-success="(response, file, fileList) => handleFileSuccess(scope.row, response, file, fileList)"   :auto-upload="true"
 | 
					                        :headers="upload.headers"
 | 
				
			||||||
 | 
					                        :action="upload.url"
 | 
				
			||||||
 | 
					                        :show-file-list="false"
 | 
				
			||||||
 | 
					                        accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
 | 
				
			||||||
 | 
					                        :auto-upload="true"
 | 
				
			||||||
 | 
					                        :on-success="(response, file, fileList) => handleFileSuccess(scope.row, response, file, fileList)"
 | 
				
			||||||
                        :before-upload="(file) => beforeUpload(scope.row, file)"
 | 
					                        :before-upload="(file) => beforeUpload(scope.row, file)"
 | 
				
			||||||
 | 
					                        :on-error="handleUploadError"
 | 
				
			||||||
 | 
					                        :on-change="(file, fileList) => handleFileChange(file, fileList, scope.row)"
 | 
				
			||||||
                      >
 | 
					                      >
 | 
				
			||||||
                    <el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">
 | 
					                        <el-button
 | 
				
			||||||
                            上传
 | 
					                          size="mini"
 | 
				
			||||||
 | 
					                          type="text"
 | 
				
			||||||
 | 
					                          @click="beforeFileUpload(scope.row)"
 | 
				
			||||||
 | 
					                          :loading="uploadLoading && currentUploadRow === scope.row"
 | 
				
			||||||
 | 
					                          :disabled="uploadLoading && currentUploadRow !== scope.row"
 | 
				
			||||||
 | 
					                        >
 | 
				
			||||||
 | 
					                          {{ (uploadLoading && currentUploadRow === scope.row) ? '上传中...' : '上传' }}
 | 
				
			||||||
                        </el-button>
 | 
					                        </el-button>
 | 
				
			||||||
                      </el-upload>
 | 
					                      </el-upload>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <el-button size="mini" type="text" @click="picturePreviewFile(scope.row)" v-if="scope.row.fileListTemp!=0" style="margin-left: 20px;">
 | 
					                      <el-button
 | 
				
			||||||
 | 
					                        size="mini"
 | 
				
			||||||
 | 
					                        type="text"
 | 
				
			||||||
 | 
					                        @click="picturePreviewFile(scope.row)"
 | 
				
			||||||
 | 
					                        v-if="scope.row.fileListTemp != 0"
 | 
				
			||||||
 | 
					                        style="margin-left: 20px;"
 | 
				
			||||||
 | 
					                        :disabled="uploadLoading"
 | 
				
			||||||
 | 
					                      >
 | 
				
			||||||
                        查看
 | 
					                        查看
 | 
				
			||||||
                      </el-button>
 | 
					                      </el-button>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                  </template>
 | 
					                  </template>
 | 
				
			||||||
            </el-table-column>
 | 
					            </el-table-column>
 | 
				
			||||||
            </el-table>
 | 
					            </el-table>
 | 
				
			||||||
| 
						 | 
					@ -552,7 +570,9 @@ export default {
 | 
				
			||||||
            currentMatchIndex: -1, // 当前匹配项索引
 | 
					            currentMatchIndex: -1, // 当前匹配项索引
 | 
				
			||||||
            matchedOptions: [], // 匹配的选项
 | 
					            matchedOptions: [], // 匹配的选项
 | 
				
			||||||
            keepSelectOpen: false, // 控制下拉框是否保持打开
 | 
					            keepSelectOpen: false, // 控制下拉框是否保持打开
 | 
				
			||||||
            isSearching: false // 添加搜索状态标记
 | 
					            isSearching: false, // 添加搜索状态标记
 | 
				
			||||||
 | 
					            uploadLoading: false, // 上传加载状态
 | 
				
			||||||
 | 
					            currentUploadRow: null, // 当前正在上传的行
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    computed: {
 | 
					    computed: {
 | 
				
			||||||
| 
						 | 
					@ -1107,141 +1127,120 @@ export default {
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
                .catch(() => {})
 | 
					                .catch(() => {})
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        beforeFileUpload(row){
 | 
					      // 点击上传按钮前准备
 | 
				
			||||||
            this.rowData.fileType = row.fileType
 | 
					      beforeFileUpload(row) {
 | 
				
			||||||
 | 
					        this.rowData.fileType = row.fileType;
 | 
				
			||||||
 | 
					        this.currentUploadRow = row;
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // 文件上传前的处理
 | 
				
			||||||
      beforeUpload(row, file) {
 | 
					      beforeUpload(row, file) {
 | 
				
			||||||
 | 
					        this.uploadLoading = true;
 | 
				
			||||||
        row.fileList.push(file);
 | 
					        row.fileList.push(file);
 | 
				
			||||||
            console.log('6666666',row.fileList)
 | 
					 | 
				
			||||||
        if (row.fileList.length > 3) {
 | 
					        if (row.fileList.length > 3) {
 | 
				
			||||||
          this.$message.warning('最多只能上传三张图片');
 | 
					          this.$message.warning('最多只能上传三张图片');
 | 
				
			||||||
                // 删除最后一个文件
 | 
					 | 
				
			||||||
          row.fileList.pop();
 | 
					          row.fileList.pop();
 | 
				
			||||||
                return false; // 阻止上传
 | 
					          this.uploadLoading = false;
 | 
				
			||||||
 | 
					          return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // 文件选择变化(包括取消选择)
 | 
				
			||||||
 | 
					      handleFileChange(file, fileList, row) {
 | 
				
			||||||
 | 
					        // 当用户取消文件选择时,fileList为空
 | 
				
			||||||
 | 
					        if (!fileList || fileList.length === 0) {
 | 
				
			||||||
 | 
					          this.uploadLoading = false;
 | 
				
			||||||
 | 
					          this.currentUploadRow = null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
                return true; // 允许上传
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
        // 文件上传成功处理
 | 
					        // 文件上传成功处理
 | 
				
			||||||
        handleFileSuccess(row,response, file, fileList) {
 | 
					      handleFileSuccess(row, response, file, fileList) {
 | 
				
			||||||
            if (response.code == 200) {
 | 
					        this.uploadLoading = false;
 | 
				
			||||||
                if (this.taskId == "") {//新增逻辑
 | 
					        this.currentUploadRow = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (response.code === 200) {
 | 
				
			||||||
 | 
					          // 新增逻辑
 | 
				
			||||||
          row.fileListTemp.push({
 | 
					          row.fileListTemp.push({
 | 
				
			||||||
                    "name": response.data.name,
 | 
					            name: response.data.name,
 | 
				
			||||||
                    "url": response.data.url,
 | 
					            url: response.data.url,
 | 
				
			||||||
                })
 | 
					          });
 | 
				
			||||||
                // console.log(response)
 | 
					
 | 
				
			||||||
                // console.log(this.rowData)
 | 
					          const obj = {
 | 
				
			||||||
                // console.log(this.rowData.bmFileInfos)
 | 
					            taskId: this.taskId,
 | 
				
			||||||
                let obj = {
 | 
					            taskType: "0",
 | 
				
			||||||
                    "taskId": this.taskId,
 | 
					            name: response.data.name,
 | 
				
			||||||
                    "taskType": "0",
 | 
					            url: response.data.url,
 | 
				
			||||||
                    "name": response.data.name,
 | 
					            modelId: this.rowData.partId,
 | 
				
			||||||
                    "url": response.data.url,
 | 
					            fileType: this.rowData.fileType,
 | 
				
			||||||
                    "modelId": this.rowData.partId,
 | 
					          };
 | 
				
			||||||
                    "fileType": this.rowData.fileType,
 | 
					
 | 
				
			||||||
                    //   "dictLabel": this.rowData.dictLabel,
 | 
					          const index = this.fileDataList.findIndex(v => v.fileType == this.rowData.fileType);
 | 
				
			||||||
                }
 | 
					          if (index > -1) {
 | 
				
			||||||
                //根据文件上传返回更新文件管理弹窗内容
 | 
					            this.fileDataList[index].name = response.data.name;
 | 
				
			||||||
                let index = this.fileDataList.findIndex(v=>v.fileType==this.rowData.fileType)
 | 
					            this.fileDataList[index].url = response.data.url;
 | 
				
			||||||
                this.fileDataList[index].name = response.data.name
 | 
					 | 
				
			||||||
                this.fileDataList[index].url = response.data.url
 | 
					 | 
				
			||||||
                //判断当前上传的文件是否已上传过-再往机具类型数据中插入
 | 
					 | 
				
			||||||
                if(this.rowData.bmFileInfos.length>0){
 | 
					 | 
				
			||||||
                    let index2 = this.rowData.bmFileInfos.findIndex(v=>v.fileType==this.rowData.fileType)
 | 
					 | 
				
			||||||
                    if(index2>-1){//相同类型文件重复上传-替换
 | 
					 | 
				
			||||||
                        this.rowData.bmFileInfos.splice(index2,0,obj)
 | 
					 | 
				
			||||||
                    }else{//不存在相同类型文件-添加
 | 
					 | 
				
			||||||
                        this.rowData.bmFileInfos.push(obj)
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }else{
 | 
					 | 
				
			||||||
                    this.rowData.bmFileInfos.push(obj)
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                } else {//编辑逻辑
 | 
					          if (this.rowData.bmFileInfos.length > 0) {
 | 
				
			||||||
                row.fileListTemp.push({
 | 
					            const index2 = this.rowData.bmFileInfos.findIndex(v => v.fileType == this.rowData.fileType);
 | 
				
			||||||
                    "name": response.data.name,
 | 
					            if (index2 > -1) {
 | 
				
			||||||
                    "url": response.data.url,
 | 
					              this.rowData.bmFileInfos.splice(index2, 0, obj);
 | 
				
			||||||
                })
 | 
					            } else {
 | 
				
			||||||
                let obj = {
 | 
					              this.rowData.bmFileInfos.push(obj);
 | 
				
			||||||
                "taskId": this.taskId,
 | 
					 | 
				
			||||||
                "taskType": "0",
 | 
					 | 
				
			||||||
                "name": response.data.name,
 | 
					 | 
				
			||||||
                "url": response.data.url,
 | 
					 | 
				
			||||||
                "modelId": this.rowData.partId,
 | 
					 | 
				
			||||||
                "fileType": this.rowData.fileType,
 | 
					 | 
				
			||||||
                //   "dictLabel": this.rowData.dictLabel,
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
                //根据文件上传返回更新文件管理弹窗内容
 | 
					          } else {
 | 
				
			||||||
                let index = this.fileDataList.findIndex(v=>v.fileType==this.rowData.fileType)
 | 
					            this.rowData.bmFileInfos.push(obj);
 | 
				
			||||||
                this.fileDataList[index].name = response.data.name
 | 
					 | 
				
			||||||
                this.fileDataList[index].url = response.data.url
 | 
					 | 
				
			||||||
                //判断当前上传的文件是否已上传过-再往机具类型数据中插入
 | 
					 | 
				
			||||||
                if(this.rowData.bmFileInfos.length>0){
 | 
					 | 
				
			||||||
                    let index2 = this.rowData.bmFileInfos.findIndex(v=>v.fileType==this.rowData.fileType)
 | 
					 | 
				
			||||||
                    if(index2>-1){//相同类型文件重复上传-替换
 | 
					 | 
				
			||||||
                        this.rowData.bmFileInfos.splice(index2,0,obj)
 | 
					 | 
				
			||||||
                    }else{//不存在相同类型文件-添加
 | 
					 | 
				
			||||||
                        this.rowData.bmFileInfos.push(obj)
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
                }else{
 | 
					 | 
				
			||||||
                    this.rowData.bmFileInfos.push(obj)
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                uploadPurchaseFile(obj).then((response) => {
 | 
					 | 
				
			||||||
                    this.$modal.msgSuccess('上传成功')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                }).catch(() => {
 | 
					          // 若是编辑逻辑
 | 
				
			||||||
                    this.$modal.msgError('上传失败')
 | 
					          if (this.taskId !== "") {
 | 
				
			||||||
                })
 | 
					            uploadPurchaseFile(obj)
 | 
				
			||||||
 | 
					              .then(() => this.$modal.msgSuccess("上传成功"))
 | 
				
			||||||
 | 
					              .catch(() => this.$modal.msgError("上传失败"));
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					      // 上传失败
 | 
				
			||||||
 | 
					      handleUploadError(error, file, fileList) {
 | 
				
			||||||
 | 
					        this.uploadLoading = false;
 | 
				
			||||||
 | 
					        this.currentUploadRow = null;
 | 
				
			||||||
 | 
					        this.$modal.msgError("上传失败");
 | 
				
			||||||
 | 
					        console.error("上传失败:", error);
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      picturePreviewFile(row) {
 | 
					      picturePreviewFile(row) {
 | 
				
			||||||
            row.fileList = []
 | 
					        row.fileList = row.fileListTemp.map(item => ({
 | 
				
			||||||
            row.fileListTemp.forEach(item=>{
 | 
					          name: item.name,
 | 
				
			||||||
                row.fileList.push({
 | 
					          url: item.url,
 | 
				
			||||||
                    "name": item.name,
 | 
					        }));
 | 
				
			||||||
                    "url": item.url,
 | 
					        this.fileId = row.fileType;
 | 
				
			||||||
                })
 | 
					        this.fileListInfo = row.fileListTemp;
 | 
				
			||||||
            })
 | 
					        this.dialogVisibleFile = true;
 | 
				
			||||||
            this.fileId = row.fileType
 | 
					 | 
				
			||||||
            this.fileListInfo = row.fileListTemp
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            this.dialogVisibleFile = true
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //图片查看
 | 
					      // 图片预览
 | 
				
			||||||
      picturePreview(file) {
 | 
					      picturePreview(file) {
 | 
				
			||||||
            this.dialogImageUrl = file.url.replaceAll("#","%23")
 | 
					        this.dialogImageUrl = file.url.replaceAll("#", "%23");
 | 
				
			||||||
            const parts = file.name.split('.')
 | 
					        const ext = file.name.split('.').pop().toLowerCase();
 | 
				
			||||||
            const extension = parts.pop()
 | 
					        if (["doc", "docx", "pdf"].includes(ext)) {
 | 
				
			||||||
          if(extension === 'doc' || extension === 'DOC' || extension === 'docx' || extension === 'DOCX' || extension === 'pdf' || extension === 'PDF'){
 | 
					          window.open(file.url, file.name);
 | 
				
			||||||
                const windowName = file.name
 | 
					        } else {
 | 
				
			||||||
            window.open(file.url,windowName)
 | 
					          this.dialogVisible = true;
 | 
				
			||||||
          }else{
 | 
					 | 
				
			||||||
            this.dialogVisible = true
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //删除图片
 | 
					      // 删除图片
 | 
				
			||||||
      pictureDelete(row, id) {
 | 
					      pictureDelete(row, id) {
 | 
				
			||||||
            let index = id
 | 
					 | 
				
			||||||
        this.fileListInfo = this.fileListInfo.filter(item => item.url !== row.url);
 | 
					        this.fileListInfo = this.fileListInfo.filter(item => item.url !== row.url);
 | 
				
			||||||
            this.fileDataList[this.fileId].fileList = this.fileDataList[this.fileId].fileList.filter(item => item.url !== row.url);
 | 
					        this.fileDataList[this.fileId].fileList =
 | 
				
			||||||
            this.fileDataList[this.fileId].fileListTemp = this.fileDataList[this.fileId].fileListTemp.filter(item => item.url !== row.url);
 | 
					          this.fileDataList[this.fileId].fileList.filter(item => item.url !== row.url);
 | 
				
			||||||
            let bmFiles = []
 | 
					        this.fileDataList[this.fileId].fileListTemp =
 | 
				
			||||||
            this.rowData.bmFileInfos.forEach((item)=>{
 | 
					          this.fileDataList[this.fileId].fileListTemp.filter(item => item.url !== row.url);
 | 
				
			||||||
                if (item.fileType != this.fileId) {
 | 
					
 | 
				
			||||||
                    bmFiles.push(item)
 | 
					        this.rowData.bmFileInfos = this.rowData.bmFileInfos.filter(item => {
 | 
				
			||||||
                }else{
 | 
					          if (item.fileType !== this.fileId) return true;
 | 
				
			||||||
                    if (item.url!= row.url) {
 | 
					          return item.url !== row.url;
 | 
				
			||||||
                        bmFiles.push(item)
 | 
					        });
 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            })
 | 
					 | 
				
			||||||
            this.rowData.bmFileInfos = bmFiles;
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /** 删除按钮操作 */
 | 
					        /** 删除按钮操作 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -295,7 +295,7 @@
 | 
				
			||||||
              </el-input>
 | 
					              </el-input>
 | 
				
			||||||
        </el-form-item>
 | 
					        </el-form-item>
 | 
				
			||||||
        <el-row>
 | 
					        <el-row>
 | 
				
			||||||
          <el-form-item label="照片">
 | 
					          <el-form-item label="照片" required>
 | 
				
			||||||
            <el-upload
 | 
					            <el-upload
 | 
				
			||||||
              action="#"
 | 
					              action="#"
 | 
				
			||||||
              :file-list="fileList"
 | 
					              :file-list="fileList"
 | 
				
			||||||
| 
						 | 
					@ -518,7 +518,7 @@
 | 
				
			||||||
            <el-form-item label="报废原因" prop="scrapReason">
 | 
					            <el-form-item label="报废原因" prop="scrapReason">
 | 
				
			||||||
              <el-input v-model="formRight.scrapReason" placeholder="请输入报废原因" clearable maxlength="150" type="textarea" style="width: 240px" rows="4"></el-input>
 | 
					              <el-input v-model="formRight.scrapReason" placeholder="请输入报废原因" clearable maxlength="150" type="textarea" style="width: 240px" rows="4"></el-input>
 | 
				
			||||||
            </el-form-item>
 | 
					            </el-form-item>
 | 
				
			||||||
          <el-form-item label="照片">
 | 
					          <el-form-item label="照片" required>
 | 
				
			||||||
            <el-upload
 | 
					            <el-upload
 | 
				
			||||||
              action="#"
 | 
					              action="#"
 | 
				
			||||||
              :file-list="fileList"
 | 
					              :file-list="fileList"
 | 
				
			||||||
| 
						 | 
					@ -1310,6 +1310,11 @@ export default {
 | 
				
			||||||
      this.uploadKey = Date.now();
 | 
					      this.uploadKey = Date.now();
 | 
				
			||||||
      this.$refs["scrapForm"].validate(async(valid) => {
 | 
					      this.$refs["scrapForm"].validate(async(valid) => {
 | 
				
			||||||
          if(valid){
 | 
					          if(valid){
 | 
				
			||||||
 | 
					            // 添加文件必传验证
 | 
				
			||||||
 | 
					            if(this.fileList.length === 0){
 | 
				
			||||||
 | 
					              this.$message.error('请上传照片');
 | 
				
			||||||
 | 
					              return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            if(this.fileList.length!=0){
 | 
					            if(this.fileList.length!=0){
 | 
				
			||||||
            await  this.getImaUpload(),
 | 
					            await  this.getImaUpload(),
 | 
				
			||||||
            await this.addWaitRepairPic(this.scrapForm);
 | 
					            await this.addWaitRepairPic(this.scrapForm);
 | 
				
			||||||
| 
						 | 
					@ -1539,6 +1544,13 @@ export default {
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      if((Number(this.formLeft.repairNum) + Number(this.formMiddle.repairNum)+ Number(this.formRight.scrapNum)) ==0) {
 | 
				
			||||||
 | 
					        this.$message({
 | 
				
			||||||
 | 
					          message: '请输入维修数量 ',
 | 
				
			||||||
 | 
					          type: 'warning'
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      let refTemp = [];
 | 
					      let refTemp = [];
 | 
				
			||||||
      if(this.formLeft.repairNum!=0){
 | 
					      if(this.formLeft.repairNum!=0){
 | 
				
			||||||
          refTemp.push(this.$refs.formLeft)
 | 
					          refTemp.push(this.$refs.formLeft)
 | 
				
			||||||
| 
						 | 
					@ -1548,6 +1560,11 @@ export default {
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if(this.formRight.scrapNum!=0){
 | 
					      if(this.formRight.scrapNum!=0){
 | 
				
			||||||
        refTemp.push(this.$refs.formRight)
 | 
					        refTemp.push(this.$refs.formRight)
 | 
				
			||||||
 | 
					        // 添加文件必传验证
 | 
				
			||||||
 | 
					        if(this.fileList.length === 0){
 | 
				
			||||||
 | 
					          this.$message.error('请上传照片');
 | 
				
			||||||
 | 
					          return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      const valid = await this.validateForms(refTemp)
 | 
					      const valid = await this.validateForms(refTemp)
 | 
				
			||||||
      if(valid){
 | 
					      if(valid){
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -311,40 +311,50 @@
 | 
				
			||||||
              </tbody>
 | 
					              </tbody>
 | 
				
			||||||
            </table>
 | 
					            </table>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <div class="fillIn" style=" margin-top: 20px; display: flex; justify-content: space-between;">
 | 
					            <div class="fillIn" style="margin-top: 20px; display: flex; align-items: center; justify-content: space-between;">
 | 
				
			||||||
              <div class="item" style="width: 50%">
 | 
					              <!-- 负责人 + 签名 -->
 | 
				
			||||||
                <div>
 | 
					              <div class="item" style="width: 50%; display: flex; align-items: center;">
 | 
				
			||||||
                  <span>负责人:</span>
 | 
					                <div style="width: 30%; white-space: nowrap; display: flex; align-items: center;">
 | 
				
			||||||
 | 
					                  维修人员:
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					                <div
 | 
				
			||||||
 | 
					                  v-if="repairTicketlLevelOne.signUrl"
 | 
				
			||||||
 | 
					                  style="width: 70%; display: flex; justify-content: flex-start;"
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                  <img
 | 
				
			||||||
 | 
					                    :src="repairTicketlLevelOne.signUrl"
 | 
				
			||||||
 | 
					                    style="width: 40px; height: 100px; object-fit: contain;"
 | 
				
			||||||
 | 
					                    :class="{ 'is-rotate': repairTicketlLevelOne.signType == 0 }"
 | 
				
			||||||
 | 
					                    alt=""
 | 
				
			||||||
 | 
					                  />
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              <div class="item" style="width: 50%">
 | 
					              <!-- 完成日期 -->
 | 
				
			||||||
                <div>
 | 
					              <div class="item" style="width: 50%; display: flex; align-items: center;">
 | 
				
			||||||
                <span>完成日期:</span>
 | 
					                <span>完成日期:</span>
 | 
				
			||||||
                  {{ repairTicketlLevelOne.finishTime }}
 | 
					                <span style="margin-left: 4px;">{{ repairTicketlLevelOne.repairTime }}</span>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					<!--            <div class="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between;">-->
 | 
				
			||||||
 | 
					<!--              <div class="item" style="width: 33%">-->
 | 
				
			||||||
 | 
					<!--                <div>-->
 | 
				
			||||||
 | 
					<!--                  <span>维修人员:</span>-->
 | 
				
			||||||
 | 
					<!--                </div>-->
 | 
				
			||||||
 | 
					<!--              </div>-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            </div>
 | 
					<!--              <div class="item" style="width: 33%">-->
 | 
				
			||||||
            <div class="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between;">
 | 
					<!--                <div>-->
 | 
				
			||||||
              <div class="item" style="width: 33%">
 | 
					<!--                  <span>试验人员:</span>-->
 | 
				
			||||||
                <div>
 | 
					<!--                </div>-->
 | 
				
			||||||
                  <span>维修人员:</span>
 | 
					<!--              </div>-->
 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
              </div>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
              <div class="item" style="width: 33%">
 | 
					<!--              <div class="item" style="width: 33%">-->
 | 
				
			||||||
                <div>
 | 
					<!--                <div>-->
 | 
				
			||||||
                  <span>试验人员:</span>
 | 
					<!--                  <span>检验人员:</span>-->
 | 
				
			||||||
                </div>
 | 
					<!--                </div>-->
 | 
				
			||||||
              </div>
 | 
					<!--              </div>-->
 | 
				
			||||||
 | 
					<!--            </div>-->
 | 
				
			||||||
              <div class="item" style="width: 33%">
 | 
					 | 
				
			||||||
                <div>
 | 
					 | 
				
			||||||
                  <span>检验人员:</span>
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
              </div>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
        <!-- </vue-easy-print> -->
 | 
					        <!-- </vue-easy-print> -->
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
| 
						 | 
					@ -510,8 +520,8 @@ export default {
 | 
				
			||||||
            //维修单显示
 | 
					            //维修单显示
 | 
				
			||||||
            openPrint:false,
 | 
					            openPrint:false,
 | 
				
			||||||
            printData: {},
 | 
					            printData: {},
 | 
				
			||||||
            //选择的taskId数组
 | 
					            // //选择的taskId数组
 | 
				
			||||||
            ids:[],
 | 
					            // ids:[],
 | 
				
			||||||
            taskList:[],
 | 
					            taskList:[],
 | 
				
			||||||
            //维修任务单上部分数据
 | 
					            //维修任务单上部分数据
 | 
				
			||||||
            repairTicketlLevelOne:{},
 | 
					            repairTicketlLevelOne:{},
 | 
				
			||||||
| 
						 | 
					@ -866,4 +876,8 @@ export default {
 | 
				
			||||||
.part-info .total-price {
 | 
					.part-info .total-price {
 | 
				
			||||||
    margin-left: 20px; /* 调整间距大小 */
 | 
					    margin-left: 20px; /* 调整间距大小 */
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					.is-rotate {
 | 
				
			||||||
 | 
					  transform: rotate(-90deg);
 | 
				
			||||||
 | 
					  transform-origin: center center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue