Compare commits

..

No commits in common. "888b5aa91f416176358a728d8196038d51151147" and "51f72ea5d24367234cb3403f3712c6b911d7d637" have entirely different histories.

16 changed files with 142 additions and 390 deletions

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-08 15:56:52 * @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-25 16:22:49 * @LastEditTime: 2023-11-20 16:38:18
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -74,29 +74,3 @@ export function deleteCheck(id) {
method: 'delete' method: 'delete'
}) })
} }
// 获得设备巡检设置code
export function getCode() {
return request({
url: '/base/equipment-check-config/getCode',
method: 'get'
})
}
// 创建巡检配置
export function createCheckConfig(data) {
return request({
url: '/base/equipment-check-config/create',
method: 'post',
data: data
})
}
// 更新巡检配置
export function updateCheckConfig(data) {
return request({
url: '/base/equipment-check-config/update',
method: 'put',
data: data
})
}

View File

@ -29,10 +29,10 @@
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList"> <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
<el-link :href="`${file.url}`" :underline="false" target="_blank"> <el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ fileName }} </span> <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link> </el-link>
<div class="ele-upload-list__item-content-action"> <div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link> <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div> </div>
</li> </li>
</transition-group> </transition-group>
@ -71,11 +71,6 @@ export default {
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false default: false
},
//
fName: {
type: String,
default: ''
} }
}, },
data() { data() {
@ -86,7 +81,6 @@ export default {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", //
headers: { Authorization: "Bearer " + getAccessToken() }, // headers: { Authorization: "Bearer " + getAccessToken() }, //
fileList: [], fileList: [],
fileName: ''
}; };
}, },
watch: { watch: {
@ -111,14 +105,6 @@ export default {
}, },
deep: true, deep: true,
immediate: true immediate: true
},
fName: {
handler(val) {
if (val) {
console.log('11', val)
this.fileName = val
}
}
} }
}, },
computed: { computed: {
@ -131,7 +117,6 @@ export default {
// //
handleBeforeUpload(file) { handleBeforeUpload(file) {
// //
this.fileName = file.name
if (this.fileType) { if (this.fileType) {
let fileExtension = ""; let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) { if (file.name.lastIndexOf(".") > -1) {
@ -165,7 +150,7 @@ export default {
}, },
// //
handleUploadError(err) { handleUploadError(err) {
this.$modal.msgError("上传文件失败,请重试"); this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading() this.$modal.closeLoading()
}, },
// //
@ -195,12 +180,8 @@ export default {
this.number = 0; this.number = 0;
this.$emit("input", this.listToString(this.fileList)); this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading(); this.$modal.closeLoading();
this.returnFileName()
} }
}, },
returnFileName() {
this.$emit('name', this.fileName)
},
// //
getFileName(name) { getFileName(name) {
console.log('你好', name) console.log('你好', name)

View File

@ -2,45 +2,43 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-25 18:09:05 * @LastEditTime: 2023-11-22 10:32:10
* @Description: * @Description:
--> -->
<template> <template>
<div class="dialog"> <el-form
<el-form :model="dataForm"
:model="dataForm" :rules="dataRule"
:rules="dataRule" ref="dataForm"
ref="dataForm" @keyup.enter.native="dataFormSubmit()"
@keyup.enter.native="dataFormSubmit()" label-width="80px">
label-width="80px"> <el-row :gutter="20">
<el-row :gutter="20"> <el-col :span="12">
<el-col :span="12"> <el-form-item label="部门名称" prop="name">
<el-form-item label="部门名称" prop="name"> <el-input v-model="dataForm.name" clearable placeholder="请输入部门名称" />
<el-input v-model="dataForm.name" clearable placeholder="请输入部门名称" /> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
<el-col :span="12"> <el-form-item label="部门编码" prop="code">
<el-form-item label="部门编码" prop="code"> <el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" />
<el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" /> </el-form-item>
</el-form-item> </el-col>
</el-col> </el-row>
</el-row> <el-row :gutter="20">
<el-row :gutter="20"> <el-col :span="12">
<el-col :span="12"> <el-form-item label="上级部门" prop="parentId">
<el-form-item label="上级部门" prop="parentId"> <treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门"/>
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门" /> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
<el-col :span="12"> <el-form-item label="备注" prop="remark">
<el-form-item label="备注" prop="remark"> <el-input
<el-input v-model="dataForm.remark"
v-model="dataForm.remark" placeholder="请输入备注" />
placeholder="请输入备注" /> </el-form-item>
</el-form-item> </el-col>
</el-col> </el-row>
</el-row> </el-form>
</el-form>
</div>
</template> </template>
<script> <script>
@ -70,7 +68,6 @@ export default {
}, },
departmentlList: [], departmentlList: [],
menuOptions: [], menuOptions: [],
isChoosed: false,
dataRule: { dataRule: {
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }], code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }], name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
@ -107,9 +104,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
.dialog {
min-height: 180px;
}
</style>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-25 11:25:23 * @LastEditTime: 2023-11-15 16:23:49
* @Description: * @Description:
--> -->
<template> <template>
@ -46,9 +46,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form> </el-form>
</template> </template>
@ -73,8 +70,7 @@ export default {
code: undefined, code: undefined,
name: undefined, name: undefined,
unit: undefined, unit: undefined,
dailyCost: undefined, dailyCost: undefined
remark: undefined
}, },
departmentlList: [], departmentlList: [],
menuOptions: [], menuOptions: [],

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 09:23:56 * @LastEditTime: 2023-11-15 15:41:44
* @Description: * @Description:
--> -->
<template> <template>
@ -253,8 +253,8 @@ export default {
isdetail: false, isdetail: false,
idAttrShow: false, idAttrShow: false,
dataRule: { dataRule: {
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }], code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }], name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }], materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }], productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }] processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]

View File

@ -143,6 +143,12 @@ export default {
} }
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:core-work-order:material`)
? {
type: 'material',
btnName: '预使用原料信息',
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:detail`) this.$auth.hasPermi(`base:core-work-order:detail`)
? { ? {
type: 'detail', type: 'detail',
@ -165,12 +171,6 @@ export default {
} }
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:core-work-order:material`)
? {
type: 'material',
btnName: '预使用原料信息',
}
: undefined,
{ {
type: 'active', type: 'active',
btnName: '激活', btnName: '激活',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 09:21:48 * @LastEditTime: 2023-11-22 08:55:37
* @Description: * @Description:
--> -->
<template> <template>
@ -43,9 +43,7 @@
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input-number <el-input-number
v-model="dataForm.sort" v-model="dataForm.sort"
controls-position="right" placeholder="排序" />
placeholder="排序"
style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="40%"> width="50%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>

View File

@ -2,14 +2,14 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 09:36:44 * @LastEditTime: 2023-11-22 11:22:38
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="isdetail" :wrapper-closable="false"
class="drawer" class="drawer"
size="60%"> size="60%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
@ -156,12 +156,12 @@
@pagination="getList" /> @pagination="getList" />
</div> </div>
<div v-if="!isdetail" class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button> <el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑 编辑
</el-button> --> </el-button> -->
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</div> </div>
@ -432,7 +432,7 @@ export default {
} }
.action_btn { .action_btn {
float: right; float: right;
margin: -40px 15px; margin: -35px 15px;
font-size: 14px; font-size: 14px;
} }
.add { .add {

View File

@ -13,7 +13,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="120" :width="220"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -85,25 +85,25 @@ export default {
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:material:queryAttr`)
? {
type: 'detail',
btnName: '查看属性',
}
: undefined,
this.$auth.hasPermi(`base:material:update`) this.$auth.hasPermi(`base:material:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
// this.$auth.hasPermi(`base:material:editAttr`) this.$auth.hasPermi(`base:material:queryAttr`)
// ? { ? {
// type: 'editAttr', type: 'search',
// btnName: '', btnName: '查看属性',
// } }
// : undefined, : undefined,
this.$auth.hasPermi(`base:material:delete`) this.$auth.hasPermi(`base:material:editAttr`)
? {
type: 'editAttr',
btnName: '编辑属性',
}
: undefined,
this.$auth.hasPermi(`base:material:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
@ -136,7 +136,7 @@ export default {
}, },
{ {
type: this.$auth.hasPermi('base:material:create') ? 'button' : '', type: this.$auth.hasPermi('base:material:create') ? 'button' : '',
btnName: '新增', btnName: '新增物料',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true plain: true
@ -166,7 +166,7 @@ export default {
}); });
}, },
otherMethods(val) { otherMethods(val) {
if (val.type === 'detail') { if (val.type === 'search') {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情'; this.addOrEditTitle = '详情';
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-25 19:10:12 * @LastEditTime: 2023-11-23 15:00:00
* @Description: * @Description:
--> -->
<template> <template>
@ -85,30 +85,28 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="materialId" label="物料名称*"> <el-table-column prop="materialId" label="物料名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-select
v-model="scope.row.materialId" v-model="scope.row.materialId"
filterable filterable
clearable clearable
:disabled="!scope.row.isEdit" :disabled="!scope.row.isEdit"
placeholder="请选择物料" placeholder="请选择物料"
@change="setCode(scope.row)"> @change="setCode(scope.row)">
<el-option <el-option
v-for="dict in materialList" v-for="dict in materialList"
:key="dict.id" :key="dict.id"
:label="dict.name" :label="dict.name"
:value="dict.id" /> :value="dict.id" />
</el-select> </el-select>
<span v-if="scope.row.isShow" style="color: red">物料不可为空</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="materialCode" label="物料编码" /> <el-table-column prop="materialCode" label="物料编码" />
<el-table-column prop="mUnit" label="单位" /> <el-table-column prop="mUnit" label="单位" />
<el-table-column prop="num" label="数量*"> <el-table-column prop="num" label="数量">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.number="scope.row.num" :disabled="!scope.row.isEdit" @input="changeNum(scope.row)"></el-input> <el-input v-model="scope.row.num" :disabled="!scope.row.isEdit"></el-input>
<span v-if="scope.row.isNum" style="color: red">数量不可为空</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注"> <el-table-column prop="remark" label="备注">
@ -299,35 +297,21 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
changeNum(row) {
if (row.num !== '') {
row.isNum = false
} else {
row.isNum = true
}
},
setCode(row) { setCode(row) {
if (row.materialId) { const tempM = this.materialList.filter(item => {
row.isShow = false if (row.materialId === item.id) {
const tempM = this.materialList.filter(item => { row.materialCode = item.code
if (row.materialId === item.id) {
row.materialCode = item.code
}
return row.materialId === item.id
})
if (tempM[0].unit) {
this.unitList.filter(u => {
if (tempM[0].unit === u.value) {
row.unit = u.value
row.mUnit = u.label
}
})
} else {
row.unit = null
row.mUnit = ''
} }
return row.materialId === item.id
})
if (tempM[0].unit) {
this.unitList.filter(u => {
if (tempM[0].unit === u.value) {
row.unit = u.value
row.mUnit = u.label
}
})
} else { } else {
row.isShow = true
row.unit = null row.unit = null
row.mUnit = '' row.mUnit = ''
} }
@ -338,7 +322,6 @@ export default {
row.isEdit = true row.isEdit = true
}, },
saveData(row) { saveData(row) {
if (row.materialId) {
// this.$refs['dataForm'].validate((valid) => { // this.$refs['dataForm'].validate((valid) => {
// if (valid) { // if (valid) {
// //
@ -353,16 +336,13 @@ export default {
return; return;
} }
// //
createMaterialPBDet({ createMaterialPBDet({
...row ...row
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
// this.visible = false; // this.visible = false;
this.getList(); this.getList();
}); });
} else {
this.$message.warning('请选择物料!')
}
// } // }
// }); // });
}, },

View File

@ -110,7 +110,7 @@ export default {
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '搜索',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
@ -149,27 +149,6 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
//
deleteHandle(id, name, index) {
this.$confirm(`确定确认删除工厂名称为"${name}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':

View File

@ -7,14 +7,13 @@
<template> <template>
<el-drawer <el-drawer
ref="drawer"
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="false" :wrapper-closable="false"
class="drawer" class="drawer"
size="60%"> size="60%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }} {{ isdetail ? '查看详情' : '新增' }}
</small-title> </small-title>
<el-form <el-form
ref="dataForm" ref="dataForm"
@ -94,20 +93,20 @@
:table-data="list" /> :table-data="list" />
</el-form-item> </el-form-item>
<el-form-item label="巡检详情" prop="description"> <el-form-item label="巡检详情" prop="description">
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="150"/> <editor v-model="dataForm.description" :read-only="isdetail" :min-height="380"/>
</el-form-item> </el-form-item>
<el-form-item label="附件"> <el-form-item label="附件">
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" /> <FileUpload v-model="file" :disabled="isdetail" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button> <el-button type="primary" @click="goback()">取消</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑 编辑
</el-button> --> </el-button>
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button> <el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
@ -185,7 +184,6 @@ export default {
total: 0, total: 0,
}, },
file: '', file: '',
fileName: '',
dataRule: { dataRule: {
responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }], responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }],
actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }] actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }]
@ -196,9 +194,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
setFileName(val) {
this.fileName = val
},
async getDict() { async getDict() {
const res = await getEquipmentAll() const res = await getEquipmentAll()
this.eqList = res.data this.eqList = res.data
@ -237,8 +232,6 @@ export default {
files: [] files: []
} }
this.list = [] this.list = []
this.file = ''
this.fileName = ''
}, },
init(id, isdetail) { init(id, isdetail) {
this.initData(); this.initData();
@ -246,10 +239,6 @@ export default {
this.dataForm.id = id || undefined; this.dataForm.id = id || undefined;
this.visible = true; this.visible = true;
// const scrollContainer = this.$refs.dataForm;
// const scrollPosition = scrollContainer.scrollTop;
// console.log('12', scrollPosition);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs['dataForm'].resetFields();
@ -258,11 +247,6 @@ export default {
getEqCheckLog(this.dataForm.id).then(response => { getEqCheckLog(this.dataForm.id).then(response => {
this.formLoading = false this.formLoading = false
this.dataForm = response.data; this.dataForm = response.data;
if (this.dataForm.files.length > 0) {
this.file = this.dataForm.files[0].fileUrl
this.fileName = this.dataForm.files[0].fileName
}
this.setConfig()
}); });
} else { } else {
// if (this.urlOptions.isGetCode) { // if (this.urlOptions.isGetCode) {
@ -299,9 +283,8 @@ export default {
if (this.file) { if (this.file) {
const temp = this.file.split(',') // const temp = this.file.split(',') //
let arry = [] let arry = []
temp.forEach((item, index) => { temp.forEach(item => {
arry.push({ arry.push({
fileName: this.fileName,
fileType: 2, fileType: 2,
fileUrl: item fileUrl: item
}) })

View File

@ -1,105 +0,0 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-25 16:23:13
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="配置名称" prop="name">
<el-input
v-model="dataForm.name"
placeholder="请输入配置名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配置编码" prop="code">
<el-input
v-model="dataForm.code"
placeholder="请输入配置编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备名称" prop="equipmentId">
<el-select
v-model="dataForm.equipmentId"
filterable
style="width: 100%"
placeholder="请选择设备名称"
@change="setCode">
<el-option
v-for="dict in eqList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" disabled placeholder="请输入设备编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import { getEqCheck, getCode, createCheckConfig, updateCheckConfig } from "@/api/equipment/base/inspection/settings";
import { getEquipmentAll } from '@/api/base/equipment'
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCheckConfig,
updateURL: updateCheckConfig,
infoURL: getEqCheck,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
equipmentId: undefined,
equipmentCode: undefined
},
eqList: [],
dataRule: {
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
code: [{ required: true, message: "配置编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "配置名称不能为空", trigger: "blur" }],
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
const res = await getEquipmentAll()
this.eqList = res.data
},
setCode() {
const chooseM = this.eqList.filter(item => {
return item.id === this.dataForm.equipmentId
})
this.dataForm.equipmentCode = chooseM[0].code
}
},
};
</script>

View File

@ -36,10 +36,14 @@
:dialogVisible="open" :dialogVisible="open"
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="handleConfirm"> @confirm="submitForm">
<add <DialogForm
ref="add" v-if="open"
@refreshDataList="successSubmit" /> ref="form"
v-model="form"
:disabled="mode == 'detail'"
:has-files="false"
:rows="rows" />
</base-dialog> </base-dialog>
<!-- 添加巡检查看详情 --> <!-- 添加巡检查看详情 -->
<addOrUpdata <addOrUpdata
@ -52,13 +56,12 @@
<script> <script>
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue'; import addOrUpdata from './add-or-updata.vue';
import add from './add.vue'
// import { publicFormatter } from '@/utils/dict'; // import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default { export default {
name: 'EquipmentCheckSetting', name: 'EquipmentCheckSetting',
components: { addOrUpdata, add }, components: { addOrUpdata },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
@ -203,13 +206,6 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleConfirm() {
this.$refs.add.dataFormSubmit()
},
successSubmit() {
this.cancel()
this.getList()
},
initSearchBar() { initSearchBar() {
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => { this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
this.$set( this.$set(
@ -234,10 +230,9 @@ export default {
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.$refs.add.formClear()
this.open = false; this.open = false;
this.title = '' this.mode = null;
// this.reset(); this.reset();
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
@ -262,26 +257,18 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
// this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '添加巡检设置'; this.title = '添加巡检设置';
this.$nextTick(() => {
this.$refs.add.init();
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
// this.reset(); this.reset();
// const id = row.id; const id = row.id;
// this.info({ id }).then((response) => { this.info({ id }).then((response) => {
// this.form = response.data; this.form = response.data;
// this.open = true; this.open = true;
// this.title = ''; this.title = '修改巡检设置';
// });
this.open = true;
this.title = '修改巡检设置';
this.$nextTick(() => {
this.$refs.add.init(row.id);
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -311,7 +298,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除配置名为"' + row.name + '"的数据项?') .confirm('是否确认删除该巡检记录?')
.then(() => { .then(() => {
return this.del({ id }); return this.del({ id });
}) })

View File

@ -146,7 +146,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col>
<el-form-item label="维修附件" prop="file"> <el-form-item label="维修附件" prop="file">
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" /> <FileUpload v-model="file" :disabled="disabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -206,15 +206,11 @@ export default {
visible: false, visible: false,
disabled: false, disabled: false,
dataForm: {}, dataForm: {},
file: '', file: ''
fileName: ''
}; };
}, },
mounted() {}, mounted() {},
methods: { methods: {
setFileName(val) {
this.fileName = val
},
goback() { goback() {
this.$emit('refreshDataList'); this.$emit('refreshDataList');
this.visible = false; this.visible = false;
@ -229,15 +225,12 @@ export default {
resetFields(args) { resetFields(args) {
return this.$refs.form.resetFields(args); return this.$refs.form.resetFields(args);
}, },
initData() {
this.file = ''
this.fileName = ''
},
init(row, isdetail) { init(row, isdetail) {
this.initData(); // this.initData();
this.disabled = isdetail || false; this.disabled = isdetail || false;
this.dataForm.id = row.id || undefined; this.dataForm.id = row.id || undefined;
this.visible = true; this.visible = true;
console.log('111', this.dataForm, row)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['form'].resetFields(); this.$refs['form'].resetFields();
@ -248,10 +241,6 @@ export default {
this.formLoading = false this.formLoading = false
this.dataForm = response.data; this.dataForm = response.data;
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0 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 { } else {
// if (this.urlOptions.isGetCode) { // if (this.urlOptions.isGetCode) {
@ -272,7 +261,6 @@ export default {
let arry = [] let arry = []
temp.forEach(item => { temp.forEach(item => {
arry.push({ arry.push({
fileName: this.fileName,
fileType: 2, fileType: 2,
fileUrl: item fileUrl: item
}) })