spring
2025-03-25 604147ab79d5246a6215a7a89bd340dcc393a085
设备导入功能
已修改2个文件
24 ■■■■ 文件已修改
src/views/CNAS/resourceDemand/device/component/management.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/outsourcedParts/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/management.vue
@@ -11,13 +11,13 @@
            </el-select>
          </el-form-item>
          <el-form-item label="设备名称" prop="deviceName">
            <el-input size="small" placeholder="请输入" clearable v-model="queryParams.deviceName"
                        <el-input size="small" style="width: 160px;" placeholder="请输入" clearable v-model="queryParams.deviceName"
                      @keyup.enter.native="refreshTable()">
            </el-input>
          </el-form-item>
          <el-form-item label="规格型号" prop="specificationModel">
            <el-input size="small" placeholder="请输入" clearable
                      v-model="queryParams.specificationModel" @keyup.enter.native="refreshTable()"></el-input>
                        <el-input size="small" placeholder="请输入" clearable v-model="queryParams.specificationModel"
                            @keyup.enter.native="refreshTable()" style="width: 160px;"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" size="mini" @click="refreshTable">查询</el-button>
@@ -26,6 +26,11 @@
        </el-form>
      </div>
      <div>
                <el-upload ref='upload' style="display: inline;margin-right: 8px" :action="uploadAction"
                    :before-upload="beforeUpload" :headers="uploadHeader" :on-error="onError" :on-success="handleSuccessUp"
                    :show-file-list="false" accept='.xls,.xlsx'>
                    <el-button size="small" type="primary">导入</el-button>
                </el-upload>
        <el-button size="small" type="primary" @click="dialogVisible2 = true">新增</el-button>
        <el-button size="small" type="primary" @click="handleDownOne">导出</el-button>
      </div>
@@ -415,6 +420,7 @@
    },
    data() {
        return {
            uploadAction: process.env.VUE_APP_BASE_API + '/deviceScope/importDevice',
            dateFormat: 'yyyy-MM-dd',
            deviceId: '',
            fileTypeOptions: [
@@ -765,6 +771,15 @@
                })
            }
        },
        handleSuccessUp(response, file, fileList) {
            this.$refs.upload.clearFiles()
            if (response.code !== 200) {
                this.$message.error(response.msg)
                return
            }
            this.$message.success('上传成功')
            this.refreshTable()
        },
        submitForm() {
            if (!this.formData.deviceName) {
                this.$message.error('未输入仪器名称')
@@ -1013,6 +1028,7 @@
    background-color: #fff;
    height: calc(100vh - 16em);
}
.picName {
    overflow: hidden;
    text-overflow: ellipsis;
@@ -1020,6 +1036,7 @@
    word-break: break-all;
    width: 120px;
}
.form-item >>>.el-form-item__content {
  width: 120px;
}
src/views/business/outsourcedParts/index.vue
@@ -188,6 +188,7 @@
    this.getDicts("inspection_task_state").then((response) => {
      this.inspectionTaskState = this.dictToValue(response.data);
    });
    this.getList()
  },
  methods: {
    getList() {