projects/mes-test #132
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-20 16:38:18
|
||||
* @LastEditTime: 2023-11-25 16:22:49
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -74,3 +74,29 @@ export function deleteCheck(id) {
|
||||
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
|
||||
})
|
||||
}
|
||||
|
@ -29,10 +29,10 @@
|
||||
<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">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
<span class="el-icon-document"> {{ fileName }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
||||
<el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
@ -71,6 +71,11 @@ export default {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//文件名称
|
||||
fName: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -81,6 +86,7 @@ export default {
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
||||
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
||||
fileList: [],
|
||||
fileName: ''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -105,6 +111,14 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
fName: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
console.log('11', val)
|
||||
this.fileName = val
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -117,6 +131,7 @@ export default {
|
||||
// 上传前校检格式和大小
|
||||
handleBeforeUpload(file) {
|
||||
// 校检文件类型
|
||||
this.fileName = file.name
|
||||
if (this.fileType) {
|
||||
let fileExtension = "";
|
||||
if (file.name.lastIndexOf(".") > -1) {
|
||||
@ -150,7 +165,7 @@ export default {
|
||||
},
|
||||
// 上传失败
|
||||
handleUploadError(err) {
|
||||
this.$modal.msgError("上传图片失败,请重试");
|
||||
this.$modal.msgError("上传文件失败,请重试");
|
||||
this.$modal.closeLoading()
|
||||
},
|
||||
// 上传成功回调
|
||||
@ -180,8 +195,12 @@ export default {
|
||||
this.number = 0;
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
this.$modal.closeLoading();
|
||||
this.returnFileName()
|
||||
}
|
||||
},
|
||||
returnFileName() {
|
||||
this.$emit('name', this.fileName)
|
||||
},
|
||||
// 获取文件名称
|
||||
getFileName(name) {
|
||||
console.log('你好', name)
|
||||
|
@ -2,10 +2,11 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 10:32:10
|
||||
* @LastEditTime: 2023-11-25 18:09:05
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="dialog">
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
@ -27,7 +28,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
@ -39,6 +40,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -68,6 +70,7 @@ export default {
|
||||
},
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
isChoosed: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
|
||||
@ -104,3 +107,9 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog {
|
||||
min-height: 180px;
|
||||
}
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-15 16:23:49
|
||||
* @LastEditTime: 2023-11-25 11:25:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -46,6 +46,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
@ -70,7 +73,8 @@ export default {
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
unit: undefined,
|
||||
dailyCost: undefined
|
||||
dailyCost: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-15 15:41:44
|
||||
* @LastEditTime: 2023-11-27 09:23:56
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -253,8 +253,8 @@ export default {
|
||||
isdetail: false,
|
||||
idAttrShow: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
|
||||
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
|
@ -143,12 +143,6 @@ export default {
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:material`)
|
||||
? {
|
||||
type: 'material',
|
||||
btnName: '预使用原料信息',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
@ -171,6 +165,12 @@ export default {
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:material`)
|
||||
? {
|
||||
type: 'material',
|
||||
btnName: '预使用原料信息',
|
||||
}
|
||||
: undefined,
|
||||
{
|
||||
type: 'active',
|
||||
btnName: '激活',
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 08:55:37
|
||||
* @LastEditTime: 2023-11-27 09:21:48
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -43,7 +43,9 @@
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="dataForm.sort"
|
||||
placeholder="排序" />
|
||||
controls-position="right"
|
||||
placeholder="排序"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
@ -2,14 +2,14 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 11:22:38
|
||||
* @LastEditTime: 2023-11-27 09:36:44
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
@ -156,12 +156,12 @@
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -432,7 +432,7 @@ export default {
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -35px 15px;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
|
@ -13,7 +13,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="220"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@ -85,24 +85,24 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:material:queryAttr`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看属性',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material:queryAttr`)
|
||||
? {
|
||||
type: 'search',
|
||||
btnName: '查看属性',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material:editAttr`)
|
||||
? {
|
||||
type: 'editAttr',
|
||||
btnName: '编辑属性',
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi(`base:material:editAttr`)
|
||||
// ? {
|
||||
// type: 'editAttr',
|
||||
// btnName: '编辑属性',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi(`base:material:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
@ -136,7 +136,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:material:create') ? 'button' : '',
|
||||
btnName: '新增物料',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
@ -166,7 +166,7 @@ export default {
|
||||
});
|
||||
},
|
||||
otherMethods(val) {
|
||||
if (val.type === 'search') {
|
||||
if (val.type === 'detail') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-23 15:00:00
|
||||
* @LastEditTime: 2023-11-25 19:10:12
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -85,7 +85,7 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialId" label="物料名称">
|
||||
<el-table-column prop="materialId" label="物料名称*">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.materialId"
|
||||
@ -100,13 +100,15 @@
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
<span v-if="scope.row.isShow" style="color: red">物料不可为空!</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialCode" label="物料编码" />
|
||||
<el-table-column prop="mUnit" label="单位" />
|
||||
<el-table-column prop="num" label="数量">
|
||||
<el-table-column prop="num" label="数量*">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.num" :disabled="!scope.row.isEdit"></el-input>
|
||||
<el-input v-model.number="scope.row.num" :disabled="!scope.row.isEdit" @input="changeNum(scope.row)"></el-input>
|
||||
<span v-if="scope.row.isNum" style="color: red">数量不可为空!</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
@ -297,7 +299,16 @@ export default {
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
changeNum(row) {
|
||||
if (row.num !== '') {
|
||||
row.isNum = false
|
||||
} else {
|
||||
row.isNum = true
|
||||
}
|
||||
},
|
||||
setCode(row) {
|
||||
if (row.materialId) {
|
||||
row.isShow = false
|
||||
const tempM = this.materialList.filter(item => {
|
||||
if (row.materialId === item.id) {
|
||||
row.materialCode = item.code
|
||||
@ -315,6 +326,11 @@ export default {
|
||||
row.unit = null
|
||||
row.mUnit = ''
|
||||
}
|
||||
} else {
|
||||
row.isShow = true
|
||||
row.unit = null
|
||||
row.mUnit = ''
|
||||
}
|
||||
// row.materialCode = tempList[0].code
|
||||
// row.unit = tempList[0].unit
|
||||
},
|
||||
@ -322,6 +338,7 @@ export default {
|
||||
row.isEdit = true
|
||||
},
|
||||
saveData(row) {
|
||||
if (row.materialId) {
|
||||
// this.$refs['dataForm'].validate((valid) => {
|
||||
// if (valid) {
|
||||
// 修改的提交
|
||||
@ -343,6 +360,9 @@ export default {
|
||||
// this.visible = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
this.$message.warning('请选择物料!')
|
||||
}
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
@ -110,7 +110,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
@ -149,6 +149,27 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
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) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
|
@ -7,13 +7,14 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
ref="drawer"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '查看详情' : '新增' }}
|
||||
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
@ -93,20 +94,20 @@
|
||||
:table-data="list" />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检详情" prop="description">
|
||||
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="380"/>
|
||||
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="150"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<FileUpload v-model="file" :disabled="isdetail" />
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">取消</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
<el-button type="primary" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-button> -->
|
||||
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
@ -184,6 +185,7 @@ export default {
|
||||
total: 0,
|
||||
},
|
||||
file: '',
|
||||
fileName: '',
|
||||
dataRule: {
|
||||
responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }],
|
||||
actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }]
|
||||
@ -194,6 +196,9 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
async getDict() {
|
||||
const res = await getEquipmentAll()
|
||||
this.eqList = res.data
|
||||
@ -232,6 +237,8 @@ export default {
|
||||
files: []
|
||||
}
|
||||
this.list = []
|
||||
this.file = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
@ -239,6 +246,10 @@ export default {
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
|
||||
// const scrollContainer = this.$refs.dataForm;
|
||||
// const scrollPosition = scrollContainer.scrollTop;
|
||||
// console.log('12', scrollPosition);
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
@ -247,6 +258,11 @@ export default {
|
||||
getEqCheckLog(this.dataForm.id).then(response => {
|
||||
this.formLoading = false
|
||||
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 {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
@ -283,8 +299,9 @@ export default {
|
||||
if (this.file) {
|
||||
const temp = this.file.split(',') // 获取文件个数
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
temp.forEach((item, index) => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
|
105
src/views/equipment/base/inspection/Settings/add.vue
Normal file
105
src/views/equipment/base/inspection/Settings/add.vue
Normal file
@ -0,0 +1,105 @@
|
||||
<!--
|
||||
* @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>
|
@ -36,14 +36,10 @@
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="false"
|
||||
:rows="rows" />
|
||||
@confirm="handleConfirm">
|
||||
<add
|
||||
ref="add"
|
||||
@refreshDataList="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 添加巡检,查看详情 -->
|
||||
<addOrUpdata
|
||||
@ -56,12 +52,13 @@
|
||||
<script>
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue'
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentCheckSetting',
|
||||
components: { addOrUpdata },
|
||||
components: { addOrUpdata, add },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
@ -206,6 +203,13 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
this.$refs.add.dataFormSubmit()
|
||||
},
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.$set(
|
||||
@ -230,9 +234,10 @@ export default {
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.$refs.add.formClear()
|
||||
this.open = false;
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
this.title = ''
|
||||
// this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
@ -257,18 +262,26 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
// this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加巡检设置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.add.init();
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
// this.reset();
|
||||
// const id = row.id;
|
||||
// this.info({ id }).then((response) => {
|
||||
// this.form = response.data;
|
||||
// this.open = true;
|
||||
// this.title = '修改巡检设置';
|
||||
// });
|
||||
this.open = true;
|
||||
this.title = '修改巡检设置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.add.init(row.id);
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@ -298,7 +311,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除该巡检记录?')
|
||||
.confirm('是否确认删除配置名为"' + row.name + '"的数据项?')
|
||||
.then(() => {
|
||||
return this.del({ id });
|
||||
})
|
||||
|
@ -146,7 +146,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修附件" prop="file">
|
||||
<FileUpload v-model="file" :disabled="disabled" />
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -206,11 +206,15 @@ export default {
|
||||
visible: false,
|
||||
disabled: false,
|
||||
dataForm: {},
|
||||
file: ''
|
||||
file: '',
|
||||
fileName: ''
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
@ -225,12 +229,15 @@ export default {
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
initData() {
|
||||
this.file = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
init(row, isdetail) {
|
||||
// this.initData();
|
||||
this.initData();
|
||||
this.disabled = isdetail || false;
|
||||
this.dataForm.id = row.id || undefined;
|
||||
this.visible = true;
|
||||
console.log('111', this.dataForm, row)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
@ -241,6 +248,10 @@ export default {
|
||||
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
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
@ -261,6 +272,7 @@ export default {
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user