Merge branch 'material-ui' of http://14.103.246.124:16000/bonus/bonus-ui into material-ui
This commit is contained in:
		
						commit
						8e0cb9831e
					
				
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -26,6 +26,7 @@
 | 
				
			||||||
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
 | 
					        <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 icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
 | 
				
			||||||
        <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
 | 
					        <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
 | 
				
			||||||
 | 
					        <el-button type="warning" icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
 | 
				
			||||||
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
 | 
					        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
 | 
				
			||||||
      </el-form-item>
 | 
					      </el-form-item>
 | 
				
			||||||
    </el-form>
 | 
					    </el-form>
 | 
				
			||||||
| 
						 | 
					@ -179,6 +180,45 @@
 | 
				
			||||||
        <el-button @click="cancel">取 消</el-button>
 | 
					        <el-button @click="cancel">取 消</el-button>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </el-dialog>
 | 
					    </el-dialog>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- 导入对话框 -->
 | 
				
			||||||
 | 
					    <el-dialog
 | 
				
			||||||
 | 
					      :title="upload.title"
 | 
				
			||||||
 | 
					      :visible.sync="upload.open"
 | 
				
			||||||
 | 
					      width="400px"
 | 
				
			||||||
 | 
					      append-to-body
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
 | 
					      <el-upload
 | 
				
			||||||
 | 
					        ref="upload"
 | 
				
			||||||
 | 
					        :limit="1"
 | 
				
			||||||
 | 
					        accept=".xlsx, .xls"
 | 
				
			||||||
 | 
					        :headers="upload.headers"
 | 
				
			||||||
 | 
					        :action="upload.url + '?updateSupport=' + upload.updateSupport"
 | 
				
			||||||
 | 
					        :disabled="upload.isUploading"
 | 
				
			||||||
 | 
					        :on-progress="handleFileUploadProgress"
 | 
				
			||||||
 | 
					        :on-success="handleFileSuccess"
 | 
				
			||||||
 | 
					        :auto-upload="false"
 | 
				
			||||||
 | 
					        drag
 | 
				
			||||||
 | 
					      >
 | 
				
			||||||
 | 
					        <i class="el-icon-upload"></i>
 | 
				
			||||||
 | 
					        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
 | 
				
			||||||
 | 
					        <div class="el-upload__tip text-center" slot="tip">
 | 
				
			||||||
 | 
					          <span>仅允许导入xls、xlsx格式文件。</span>
 | 
				
			||||||
 | 
					          <a
 | 
				
			||||||
 | 
					            :href="uploadUrlTemp"
 | 
				
			||||||
 | 
					            download="机具检验标识信息导入模板"
 | 
				
			||||||
 | 
					            class="text-button primary-lease"
 | 
				
			||||||
 | 
					            style="color: #409eff; text-decoration: none; font-size: 14px;"
 | 
				
			||||||
 | 
					          >
 | 
				
			||||||
 | 
					            模板下载
 | 
				
			||||||
 | 
					          </a>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					      </el-upload>
 | 
				
			||||||
 | 
					      <div slot="footer" class="dialog-footer">
 | 
				
			||||||
 | 
					        <el-button type="primary" @click="submitFileForm">确 定</el-button>
 | 
				
			||||||
 | 
					        <el-button @click="upload.open = false">取 消</el-button>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </el-dialog>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -187,6 +227,7 @@ import {
 | 
				
			||||||
  addWsMaInfoData, delGadget,
 | 
					  addWsMaInfoData, delGadget,
 | 
				
			||||||
  getDeviceType, getGadgetInfo, getGadgetList, updateGadgetInfo
 | 
					  getDeviceType, getGadgetInfo, getGadgetList, updateGadgetInfo
 | 
				
			||||||
} from '@/api/ma/device'
 | 
					} from '@/api/ma/device'
 | 
				
			||||||
 | 
					import {getToken} from "@/utils/auth";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  name: 'Device',
 | 
					  name: 'Device',
 | 
				
			||||||
| 
						 | 
					@ -221,6 +262,22 @@ export default {
 | 
				
			||||||
        sex: undefined,
 | 
					        sex: undefined,
 | 
				
			||||||
        teamId: undefined
 | 
					        teamId: undefined
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					      uploadUrlTemp:null,
 | 
				
			||||||
 | 
					      // 导入参数
 | 
				
			||||||
 | 
					      upload: {
 | 
				
			||||||
 | 
					        // 是否显示弹出层(用户导入)
 | 
				
			||||||
 | 
					        open: false,
 | 
				
			||||||
 | 
					        // 弹出层标题(用户导入)
 | 
				
			||||||
 | 
					        title: "",
 | 
				
			||||||
 | 
					        // 是否禁用上传
 | 
				
			||||||
 | 
					        isUploading: false,
 | 
				
			||||||
 | 
					        // 是否更新已经存在的用户数据
 | 
				
			||||||
 | 
					        updateSupport: 0,
 | 
				
			||||||
 | 
					        // 设置上传的请求头部
 | 
				
			||||||
 | 
					        headers: { Authorization: "Bearer " + getToken() },
 | 
				
			||||||
 | 
					        // 上传的地址
 | 
				
			||||||
 | 
					        url: process.env.VUE_APP_BASE_API + "/material/wsMaInfo/importData"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
      // 弹出层标题
 | 
					      // 弹出层标题
 | 
				
			||||||
      title: "",
 | 
					      title: "",
 | 
				
			||||||
      // 是否显示弹出层
 | 
					      // 是否显示弹出层
 | 
				
			||||||
| 
						 | 
					@ -282,6 +339,8 @@ export default {
 | 
				
			||||||
  created() {
 | 
					  created() {
 | 
				
			||||||
    this.getList()
 | 
					    this.getList()
 | 
				
			||||||
    this.getDeviceTypeOptions();
 | 
					    this.getDeviceTypeOptions();
 | 
				
			||||||
 | 
					    this.uploadUrlTemp=window.location.origin+"/iws/jiju-api/aaa.xlsx";
 | 
				
			||||||
 | 
					    // this.uploadUrlTemp=window.location.origin+"/aaa.xlsx";
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    /** 查询列表 */
 | 
					    /** 查询列表 */
 | 
				
			||||||
| 
						 | 
					@ -373,6 +432,10 @@ export default {
 | 
				
			||||||
        `领料出库报表_${currentTime}.xlsx`
 | 
					        `领料出库报表_${currentTime}.xlsx`
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    handleImport() {
 | 
				
			||||||
 | 
					      this.upload.title = "小工具编码信息导入";
 | 
				
			||||||
 | 
					      this.upload.open = true;
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    /** 新增按钮操作 */
 | 
					    /** 新增按钮操作 */
 | 
				
			||||||
    handleAdd() {
 | 
					    handleAdd() {
 | 
				
			||||||
      this.reset();
 | 
					      this.reset();
 | 
				
			||||||
| 
						 | 
					@ -497,6 +560,22 @@ export default {
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
      this.deviceModelOptions = [];
 | 
					      this.deviceModelOptions = [];
 | 
				
			||||||
      this.resetForm("form");
 | 
					      this.resetForm("form");
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    // 文件上传中处理
 | 
				
			||||||
 | 
					    handleFileUploadProgress(event, file, fileList) {
 | 
				
			||||||
 | 
					      this.upload.isUploading = true;
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    // 文件上传成功处理
 | 
				
			||||||
 | 
					    handleFileSuccess(response, file, fileList) {
 | 
				
			||||||
 | 
					      this.upload.open = false;
 | 
				
			||||||
 | 
					      this.upload.isUploading = false;
 | 
				
			||||||
 | 
					      this.$refs.upload.clearFiles();
 | 
				
			||||||
 | 
					      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
 | 
				
			||||||
 | 
					      this.getList();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    // 提交上传文件
 | 
				
			||||||
 | 
					    submitFileForm() {
 | 
				
			||||||
 | 
					      this.$refs.upload.submit();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -480,6 +480,7 @@ export default {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    /** 机具类型 */
 | 
					    /** 机具类型 */
 | 
				
			||||||
    equipmentType() {
 | 
					    equipmentType() {
 | 
				
			||||||
 | 
					      const loading = this.$loading()
 | 
				
			||||||
      equipmentTypeTree({
 | 
					      equipmentTypeTree({
 | 
				
			||||||
        agreementIdList: this.agreementId,
 | 
					        agreementIdList: this.agreementId,
 | 
				
			||||||
        proId: this.maForm.proId,
 | 
					        proId: this.maForm.proId,
 | 
				
			||||||
| 
						 | 
					@ -497,6 +498,8 @@ export default {
 | 
				
			||||||
        if (this.equipmentList.length > 0) {
 | 
					        if (this.equipmentList.length > 0) {
 | 
				
			||||||
          this.deviceType = this.equipmentList.map(item => item.typeId)
 | 
					          this.deviceType = this.equipmentList.map(item => item.typeId)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					      }).finally(() => {
 | 
				
			||||||
 | 
					        loading.close()
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // 处理类型数据
 | 
					    // 处理类型数据
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue