取消
@@ -174,11 +156,73 @@ Blame
import SmallTitle from '../../base/alarm/Record/SmallTitle.vue';
import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
import Editor from "@/components/Editor";
-import FileUpload from "@/components/FileUpload";
+// import FileUpload from "@/components/FileUpload";
import { getDictDatas } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import { getDictDataLabel } from '@/utils/dict';
+const uploadedFile = {
+ name: 'UploadedFile',
+ props: ['file', 'disabled'],
+ data() {
+ return {};
+ },
+ methods: {
+ handleDelete() {
+ this.$emit('delete', this.file);
+ },
+ async handleDownload() {
+ const data = await this.$axios({
+ url: this.file.fileUrl,
+ method: 'get',
+ responseType: 'blob',
+ });
+
+ await this.$message.success('开始下载');
+ // create download link
+ const url = window.URL.createObjectURL(data);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = this.file.fileName;
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ },
+ },
+ mounted() {
+ },
+ render: function (h) {
+ return (
+
+ {this.file.fileName}
+ {!this.disabled && (
+
+ )}
+
+ );
+ },
+};
+
export default {
name: 'DialogForm',
model: {
@@ -186,7 +230,7 @@ export default {
event: 'update',
},
emits: ['update'],
- components: { SmallTitle, Editor, FileUpload },
+ components: { SmallTitle, Editor, uploadedFile },
props: {
// dataForm: {
// type: Object,
@@ -237,18 +281,18 @@ export default {
this.visible = true;
this.$nextTick(() => {
- this.$refs['form'].resetFields();
+ // this.$refs['form'].resetFields();
if (this.dataForm.id) {
// 获取设备维修
getEqRepair(this.dataForm.id).then(response => {
this.formLoading = false
this.dataForm = response.data;
- this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
- if (this.dataForm.files.length > 0) {
- this.file = this.dataForm.files[0].fileUrl
- this.fileName = this.dataForm.files[0].fileName
- }
+ // this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
+ // if (this.dataForm.files.length > 0) {
+ // this.file = this.dataForm.files[0].fileUrl
+ // this.fileName = this.dataForm.files[0].fileName
+ // }
});
} else {
// if (this.urlOptions.isGetCode) {
@@ -337,4 +381,18 @@ export default {
justify-content: flex-end;
padding: 18px;
}
+.blodTip {
+ height: 16px;
+ font-size: 14px;
+ font-weight: 600;
+ color: rgba(0,0,0,0.85);
+ margin-bottom: 8px;
+}
+.lightTip {
+ /* height: 16px; */
+ font-size: 14px;
+ font-weight: 400;
+ color: rgba(102,102,102,0.75);
+ margin-bottom: 12px;
+}
diff --git a/src/views/equipment/base/repair/Repair--add.vue b/src/views/equipment/base/repair/Repair--add.vue
new file mode 100644
index 00000000..63b1c217
--- /dev/null
+++ b/src/views/equipment/base/repair/Repair--add.vue
@@ -0,0 +1,799 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 上传文件
+
+
+ 只能上传jpg/png文件, 大小不超过2MB
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/equipment/base/repair/index.vue b/src/views/equipment/base/repair/index.vue
index a0b4873b..ead4e709 100644
--- a/src/views/equipment/base/repair/index.vue
+++ b/src/views/equipment/base/repair/index.vue
@@ -41,9 +41,7 @@
v-if="open"
ref="form"
v-model="form"
- :disabled="mode == 'detail'"
- :has-files="true"
- :rows="rows" />
+ :disabled="mode == 'detail'" />
moment(val).format('yyyy-MM-DD HH:mm:ss');
export default {
name: 'EquipmentRepair',
- components: { CustomDialogForm },
+ components: { CustomDialogForm, DialogForm },
mixins: [basicPageMixin],
data() {
return {
@@ -107,7 +106,7 @@ export default {
{ prop: 'lineName', label: '产线名' },
{ prop: 'sectionName', label: '工段名' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
- { prop: 'faultDetail', label: '故障明细' },
+ { prop: 'faultDetail', label: '故障明细', subcomponent: htmls },
// { prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true },
{
prop: 'maintenanceStartTime',
@@ -126,7 +125,7 @@ export default {
filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
},
// { prop: 'maintenanceDuration', label: '维修时长(h)' },
- { prop: 'remark', label: '维修描述' }, // 没有参数
+ { prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, // 没有参数
// { prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
// { prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true }
@@ -187,71 +186,6 @@ export default {
color: 'success',
},
],
- rows: [
- [
- {
- input: true,
- label: '维修单号',
- prop: 'repairOrderNumber',
- rules: [{ required: true, message: '维修单号不能为空', trigger: 'blur' }],
- },
- {
- select: true,
- label: '设备名称',
- prop: 'equipmentId',
- // url: '/base/core-equipment/listAll',
- url: '/base/core-equipment/page?special=false&pageNo=1&pageSize=99',
- bind: {
- filterable: true,
- clearable: true,
- },
- rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
- },
- ],
- [
- {
- // TODO: 和班组联动
- // select: true,
- input: true,
- label: '维修工',
- prop: 'repairman',
- // url: '/base/core-worker/listAll',
- // valueKey: 'name',
- bind: {
- filterable: true,
- clearable: true,
- // multiple: true,
- },
- // options: [{ label: 'test', value: 'test' }],
- rules: [{ required: true, message: '维修工不能为空', trigger: 'blur' }],
- },
- {
- input: true,
- label: '联系方式',
- prop: 'repairmanPhone',
- },
- ],
- [
- {
- datetime: true,
- label: '故障发生时间',
- prop: 'faultTime',
- rules: [{ required: true, message: '故障发生时间不能为空', trigger: 'blur' }],
- bind: {
- format: 'yyyy-MM-dd HH:mm:ss',
- 'value-format': 'timestamp',
- // 'value-format': 'yyyy-MM-dd HH:mm:ss',
- clearable: true,
- },
- },
- {
- select: true,
- label: '故障级别',
- prop: 'faultLevel', // 数据字典
- options: this.getDictDatas(this.DICT_TYPE.FAULT_LEVEL),
- },
- ],
- ],
// 是否显示弹出层
open: false,
// 查询参数
@@ -262,6 +196,7 @@ export default {
maintenanceResult: null,
createTime: null,
equipmentId: null,
+ special: false
},
// 表单参数
form: {},
@@ -387,7 +322,10 @@ export default {
// }
// 修改的提交
if (this.form.id != null) {
- this.put(this.form).then((response) => {
+ this.put({
+ ...this.form,
+ repairman: this.form.repairman.join(',')
+ }).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
@@ -395,7 +333,10 @@ export default {
return;
}
// 添加的提交
- this.post(this.form).then((response) => {
+ this.post({
+ ...this.form,
+ repairman: this.form.repairman.join(',')
+ }).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();