Compare commits
No commits in common. "888b5aa91f416176358a728d8196038d51151147" and "51f72ea5d24367234cb3403f3712c6b911d7d637" have entirely different histories.
888b5aa91f
...
51f72ea5d2
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-25 16:22:49
|
||||
* @LastEditTime: 2023-11-20 16:38:18
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -74,29 +74,3 @@ 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"> {{ fileName }} </span>
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<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>
|
||||
</li>
|
||||
</transition-group>
|
||||
@ -71,11 +71,6 @@ export default {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//文件名称
|
||||
fName: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -86,7 +81,6 @@ export default {
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
|
||||
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
|
||||
fileList: [],
|
||||
fileName: ''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -111,14 +105,6 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
fName: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
console.log('11', val)
|
||||
this.fileName = val
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -131,7 +117,6 @@ export default {
|
||||
// 上传前校检格式和大小
|
||||
handleBeforeUpload(file) {
|
||||
// 校检文件类型
|
||||
this.fileName = file.name
|
||||
if (this.fileType) {
|
||||
let fileExtension = "";
|
||||
if (file.name.lastIndexOf(".") > -1) {
|
||||
@ -165,7 +150,7 @@ export default {
|
||||
},
|
||||
// 上传失败
|
||||
handleUploadError(err) {
|
||||
this.$modal.msgError("上传文件失败,请重试");
|
||||
this.$modal.msgError("上传图片失败,请重试");
|
||||
this.$modal.closeLoading()
|
||||
},
|
||||
// 上传成功回调
|
||||
@ -195,12 +180,8 @@ 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,11 +2,10 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-25 18:09:05
|
||||
* @LastEditTime: 2023-11-22 10:32:10
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="dialog">
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
@ -28,7 +27,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">
|
||||
@ -40,7 +39,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -70,7 +68,6 @@ export default {
|
||||
},
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
isChoosed: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
|
||||
@ -107,9 +104,3 @@ 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-25 11:25:23
|
||||
* @LastEditTime: 2023-11-15 16:23:49
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -46,9 +46,6 @@
|
||||
</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>
|
||||
|
||||
@ -73,8 +70,7 @@ export default {
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
unit: undefined,
|
||||
dailyCost: undefined,
|
||||
remark: undefined
|
||||
dailyCost: undefined
|
||||
},
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-27 09:23:56
|
||||
* @LastEditTime: 2023-11-15 15:41:44
|
||||
* @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,6 +143,12 @@ 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',
|
||||
@ -165,12 +171,6 @@ 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-27 09:21:48
|
||||
* @LastEditTime: 2023-11-22 08:55:37
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -43,9 +43,7 @@
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="dataForm.sort"
|
||||
controls-position="right"
|
||||
placeholder="排序"
|
||||
style="width: 100%" />
|
||||
placeholder="排序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="40%">
|
||||
width="50%">
|
||||
<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-27 09:36:44
|
||||
* @LastEditTime: 2023-11-22 11:22:38
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
@ -156,12 +156,12 @@
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -432,7 +432,7 @@ export default {
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -40px 15px;
|
||||
margin: -35px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
|
@ -13,7 +13,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
:width="220"
|
||||
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:editAttr`)
|
||||
// ? {
|
||||
// type: 'editAttr',
|
||||
// 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: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 === 'detail') {
|
||||
if (val.type === 'search') {
|
||||
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-25 19:10:12
|
||||
* @LastEditTime: 2023-11-23 15:00:00
|
||||
* @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,15 +100,13 @@
|
||||
: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.number="scope.row.num" :disabled="!scope.row.isEdit" @input="changeNum(scope.row)"></el-input>
|
||||
<span v-if="scope.row.isNum" style="color: red">数量不可为空!</span>
|
||||
<el-input v-model="scope.row.num" :disabled="!scope.row.isEdit"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
@ -299,16 +297,7 @@ 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
|
||||
@ -326,11 +315,6 @@ 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
|
||||
},
|
||||
@ -338,7 +322,6 @@ export default {
|
||||
row.isEdit = true
|
||||
},
|
||||
saveData(row) {
|
||||
if (row.materialId) {
|
||||
// this.$refs['dataForm'].validate((valid) => {
|
||||
// if (valid) {
|
||||
// 修改的提交
|
||||
@ -360,9 +343,6 @@ 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,27 +149,6 @@ 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,14 +7,13 @@
|
||||
|
||||
<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 ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
{{ isdetail ? '查看详情' : '新增' }}
|
||||
</small-title>
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
@ -94,20 +93,20 @@
|
||||
:table-data="list" />
|
||||
</el-form-item>
|
||||
<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 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>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
<el-button type="primary" @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>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
@ -185,7 +184,6 @@ export default {
|
||||
total: 0,
|
||||
},
|
||||
file: '',
|
||||
fileName: '',
|
||||
dataRule: {
|
||||
responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }],
|
||||
actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }]
|
||||
@ -196,9 +194,6 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
async getDict() {
|
||||
const res = await getEquipmentAll()
|
||||
this.eqList = res.data
|
||||
@ -237,8 +232,6 @@ export default {
|
||||
files: []
|
||||
}
|
||||
this.list = []
|
||||
this.file = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
@ -246,10 +239,6 @@ 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();
|
||||
|
||||
@ -258,11 +247,6 @@ 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) {
|
||||
@ -299,9 +283,8 @@ export default {
|
||||
if (this.file) {
|
||||
const temp = this.file.split(',') // 获取文件个数
|
||||
let arry = []
|
||||
temp.forEach((item, index) => {
|
||||
temp.forEach(item => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
|
@ -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>
|
@ -36,10 +36,14 @@
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="handleConfirm">
|
||||
<add
|
||||
ref="add"
|
||||
@refreshDataList="successSubmit" />
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="false"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
<!-- 添加巡检,查看详情 -->
|
||||
<addOrUpdata
|
||||
@ -52,13 +56,12 @@
|
||||
<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, add },
|
||||
components: { addOrUpdata },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
@ -203,13 +206,6 @@ 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(
|
||||
@ -234,10 +230,9 @@ export default {
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.$refs.add.formClear()
|
||||
this.open = false;
|
||||
this.title = ''
|
||||
// this.reset();
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
@ -262,26 +257,18 @@ 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.open = true;
|
||||
// this.title = '修改巡检设置';
|
||||
// });
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改巡检设置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.add.init(row.id);
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@ -311,7 +298,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除配置名为"' + row.name + '"的数据项?')
|
||||
.confirm('是否确认删除该巡检记录?')
|
||||
.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" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
|
||||
<FileUpload v-model="file" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -206,15 +206,11 @@ export default {
|
||||
visible: false,
|
||||
disabled: false,
|
||||
dataForm: {},
|
||||
file: '',
|
||||
fileName: ''
|
||||
file: ''
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
@ -229,15 +225,12 @@ 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();
|
||||
@ -248,10 +241,6 @@ 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) {
|
||||
@ -272,7 +261,6 @@ export default {
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user