Compare commits

...

13 Commits

17 changed files with 1207 additions and 284 deletions

View File

@ -1,72 +1,79 @@
<!--
* @Author: zhp
* @Date: 2023-10-17 16:50:19
* @LastEditTime: 2023-12-01 16:48:53
* @LastEditTime: 2024-02-28 10:07:29
* @LastEditors: zhp
* @Description:
-->
<template>
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%" show-close="true">
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%"
show-close="true">
<small-title slot="title" :no-padding="true">
{{ !dataForm.id ? '新增' : '编辑' }}
</small-title>
<!--
<!--
<div class="content">
<div class="visual-part"> -->
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="包装流水号" prop="packagingCode">
<el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" clearable placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属工单" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable>
<el-option v-for="dict in workOrderList" :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="customerId">
<el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable>
<el-option v-for="dict in customerList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="标签模板" prop="modelId">
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable>
<el-option v-for="dict in modelList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="包装流水号" prop="packagingCode">
<el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" clearable placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属工单" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable>
<el-option v-for="dict in workOrderList" :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="customerId">
<el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable>
<el-option v-for="dict in customerList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="包装条码" prop="packagingBarCode">
<el-input v-model="dataForm.packagingBarCode" clearable placeholder="请输入包装条码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="标签模板" prop="modelId">
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable>
<el-option v-for="dict in modelList" :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="area">
<el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
</el-form-item>
</el-col> -->
</el-row>
<!-- <el-row :gutter="20">
</el-row>
<!-- <el-row :gutter="20">
<el-col :span="24">
<el-form-item label="完成单位产品用时" prop="processTime">
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
</el-form-item>
</el-col>
</el-row> -->
</el-form>
</el-form>
<!-- <small-title
<!-- <small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性列表
@ -96,7 +103,7 @@
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
@ -186,6 +193,7 @@ export default {
workOrderId: null, // (s)
customerId: '', //
content: '', // id
packagingBarCode: null
},
listQuery: {
pageSize: 10,

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-11-24 09:13:50
* @LastEditTime: 2024-02-28 10:38:34
* @Description:
-->
<template>
@ -55,7 +55,11 @@ const tableProps = [
{
prop: 'packagingCode',
label: '包装流水号'
},
},
{
prop: 'packagingBarCode',
label: '包装条码'
},
{
prop: 'workOrderName',
label: '所属工单'

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-27 09:41:00
* @LastEditTime: 2024-02-28 14:45:58
* @Description:
-->
<template>
@ -27,13 +27,14 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="巡检单名称" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" />
<el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" prop="departmentId">
<el-select
v-model="dataForm.departmentId"
:disabled="isdetail"
:placeholder="`请选择部门`">
<el-option
v-for="opt in departmentOptions"
@ -50,7 +51,7 @@
filterable
clearable
multiple
:disabled="isedit"
:disabled="isdetail"
style="width: 100%"
placeholder="请选择班次">
<el-option
@ -70,7 +71,7 @@
:placeholder="`请选择巡检人`"
multiple
clearable
:disabled="isedit"
:disabled="isdetail"
filterable>
<el-option
v-for="opt in inspectorOptions"
@ -85,7 +86,7 @@
<el-date-picker
v-model="dataForm.planCheckTime"
type="datetime"
:disabled="isedit"
:disabled="isdetail"
placeholder="请选择巡检时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
@ -142,7 +143,8 @@
<div v-if="!isdetail" class="drawer-body__footer">
<el-button @click="goback()">取消</el-button>
<!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> -->
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button>
</div>
<attr-add
@ -205,6 +207,7 @@ export default {
tableProps,
topBtnConfig,
addOrUpdateVisible: false,
isshowConfirm: false,
urlOptions: {
isGetCode: false,
createURL: createCheckOrder,
@ -398,6 +401,34 @@ export default {
this.$refs.addOrUpdate.init(id);
});
},
getConfirmed() {
return this.$confirm('是否直接确认巡检记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
},
async confirmIns() {
await this.getConfirmed().then(confirm => {
this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId,
method: 'put',
data: [this.dataForm.id],
}).then(res =>{
if (res.code == 0) {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('已确认');
}
}).catch(() => {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('取消确认');
})
})
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
@ -429,6 +460,7 @@ export default {
}).then(response => {
this.$modal.msgSuccess("新增成功");
this.idAttrShow = true
this.isshowConfirm = true
this.dataForm.id = response.data
// this.visible = false;
this.$emit("refreshDataList");

View File

@ -172,24 +172,27 @@ export default {
async searchBarClicked(btn) {
switch (btn.btnName) {
case 'batchConfirm':
const ids = this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
)
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
this.$message.warning('请选择待确认的设备巡检单');
return;
}
const res = await this.$axios({
url: '/base/equipment-check-order/confirm?confirmPerson=' + this.$store.getters.userId + '&ids=' + ids,
method: 'put',
// data: this.$refs['waiting-list-table'].selectedPlan.map(
// (item) => item.id
// ),
});
if (res.code == 0) {
this.$message.success('确认成功');
this.getList();
}
this.$modal
.confirm('是否确认所有选中保养单"?')
.then(() => {
return this.$axios({
url: '/base/equipment-check-order/confirm?confirmPerson=' + this.$store.getters.userId,
method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
});
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
break;
}
},
@ -328,7 +331,7 @@ export default {
// },
getConfirmed() {
return this.$confirm('是否直接确认保养记录', '提示', {
return this.$confirm('是否直接确认巡检记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
@ -388,17 +391,16 @@ export default {
},
/** 确认 */
async handleConfirm(row) {
console.log('111', this.$store.getters.userId)
this.$modal
.confirm('是否确认巡检单"' + row.name + '"?')
.then(() => {
return this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId + '&ids=' + [row.id],
this.$store.getters.userId,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put',
// data: [row.id],
data: [row.id],
});
})
.then((res) => {

View File

@ -14,7 +14,7 @@
custom-class="mes-drawer"
size="60%"
@closed="$emit('destroy')">
<SmallTitle slot="title">编辑</SmallTitle>
<SmallTitle slot="title">{{ showTable ? '编辑' : '新增' }}</SmallTitle>
<div class="drawer-body flex">
<div class="drawer-body__content">
@ -184,49 +184,53 @@
</el-form>
</div>
<SmallTitle>保养内容</SmallTitle>
<div v-if="showTable">
<SmallTitle>保养内容</SmallTitle>
<div style="margin-top: 12px; position: relative">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" />
</div>
<div style="margin-top: 12px; position: relative">
<div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
<div style="margin-top: 12px; position: relative">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" />
</div>
<base-table
v-loading="attrListLoading"
:table-props="attrTableProps"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="attrTotal > 0"
:total="attrTotal"
:page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
<div style="margin-top: 12px; position: relative">
<div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
</div>
<base-table
v-loading="attrListLoading"
:table-props="attrTableProps"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="attrTotal > 0"
:total="attrTotal"
:page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
</div>
</div>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">保存</el-button>
<!-- 新增可确认 -->
<el-button v-if="isAdd" type="primary" @click="addConfirm">保存</el-button>
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
@ -292,6 +296,8 @@ export default {
return {
visible: false,
btnLoading: false,
showTable: false,
isAdd: false,
form: {},
formLoading: false,
lineList: [],
@ -387,7 +393,7 @@ export default {
attrListLoading: false,
// syncFileListFlag: null,
tableBtn: [],
row: null,
row: {},
};
},
computed: {
@ -438,23 +444,106 @@ export default {
break;
}
},
async addConfirm() {
console.log('11', this.showTable)
this.$refs['form'].validate((valid) => {
if (!valid) {
return;
}
this.$nextTick(() => {
this.getConfirmed().then(confirm => {
console.log('111', confirm)
this.$axios({
url:
'/base/equipment-maintain-log/confirm?confirmPerson=' +
this.$store.getters.userId,
method: 'put',
data: [this.form.id],
}).then(res =>{
if (res.code == 0) {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('已确认');
}
})
}).catch(() => {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('取消确认');
})
})
});
},
getConfirmed() {
return this.$confirm('是否直接确认保养记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
},
async handleConfirm() {
this.btnLoading = true;
this.$nextTick(async () => {
const { code, data } = await this.$axios({
url: '/base/equipment-maintain-log/update',
method: 'put',
// this.$nextTick(async () => {
// const { code, data } = await this.$axios({
// url: '/base/equipment-maintain-log/update',
// method: 'put',
// data: {
// ...this.form,
// maintainWorker: this.form.maintainWorker.join(',')
// },
// });
// if (code == 0) {
// this.$modal.msgSuccess('');
// }
// this.btnLoading = false;
// this.$emit('refreshDataList');
// this.handleCancel();
// });
this.$refs['form'].validate((valid) => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
this.$axios({
url: '/base/equipment-maintain-log/update',
method: 'put',
data: {
...this.form,
maintainWorker: this.form.maintainWorker.join(','),
special: false,
relatePlan: 2
}
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
});
return;
}
//
this.$axios({
url: '/base/equipment-maintain-log/create',
method: 'post',
data: {
...this.form,
maintainWorker: this.form.maintainWorker.join(',')
},
maintainWorker: this.form.maintainWorker.join(','),
special: false,
relatePlan: 2,
confirmed: false,
}
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.btnLoading = false;
this.form.id = response.data
this.row.id = response.data
this.showTable = true
this.isAdd = true
this.$emit('refreshDataList');
// this.handleCancel();
});
if (code == 0) {
this.$modal.msgSuccess('更新成功');
}
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
});
},
@ -464,15 +553,22 @@ export default {
init(row) {
this.visible = true;
this.row = row;
this.getInfo(row);
this.getAttrList(row);
if (row) {
this.row = row;
this.showTable = row ? true : false;
this.$nextTick(() => {
if (row.id) {
this.getInfo(row.id);
this.getAttrList(row.id);
}
})
}
},
async getInfo(row) {
async getInfo(id) {
this.formLoading = true;
const res = await this.$axios(
'/base/equipment-maintain-log/get?id=' + row.id
'/base/equipment-maintain-log/get?id=' + id
);
if (res.code == 0) {
this.form = res.data;
@ -482,15 +578,15 @@ export default {
this.formLoading = false;
},
async getAttrList(row, condition = {}) {
if (!row) row = this.row;
async getAttrList(id, condition = {}) {
if (!id) id = this.row.id;
this.attrListLoading = true;
const res = await this.$axios({
url: '/base/equipment-maintain-log-det/page',
method: 'get',
params: {
...this.attrQuery.params,
logId: row.id,
logId: id,
...condition,
},
});

View File

@ -258,17 +258,27 @@ export default {
this.$message.warning('请选择待确认的设备保养记录');
return;
}
const res = await this.$axios({
url: '/base/equipment-maintain-log/confirm',
method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
});
if (res.code == 0) {
this.$message.success('确认成功');
this.getList();
}
this.$modal
.confirm('是否确认所有选中保养单"?')
.then(() => {
return this.$axios({
url: '/base/equipment-maintain-log/confirm',
method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
});
// if (res.code == 0) {
// this.$message.success('');
// this.getList();
// }
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
break;
}
},
@ -412,9 +422,13 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = '添加待确认保养记录';
// this.reset();
// this.open = true;
// this.title = '';
this.openUnplannedDrawer = true;
this.$nextTick(() => {
this.$refs.unplanned.init();
});
},
getConfirmed() {
@ -478,15 +492,25 @@ export default {
},
/** 确认 */
async handleConfirm(row) {
const res = await this.$axios({
url: '/base/equipment-maintain-log/confirm',
method: 'put',
data: [row.id],
});
if (res.code == 0) {
this.$message.success('确认成功');
this.getList();
}
this.$modal
.confirm('是否确认保养单"' + row.maintainOrderNumber + '"?')
.then(() => {
return this.$axios({
url: '/base/equipment-maintain-log/confirm',
method: 'put',
data: [row.id],
});
// if (res.code == 0) {
// this.$message.success('');
// this.getList();
// }
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
},
/** 编辑 */
async handleEdit(row) {

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-02-18 14:07:08
* @LastEditTime: 2024-02-28 09:58:34
* @LastEditors: zhp
* @Description:
-->
@ -15,35 +15,11 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组" prop="teamId">
<el-select v-model="dataForm.teamId" placeholder="请选择班组">
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="num">
<el-input v-model="dataForm.num" placeholder="请输入数量" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线">
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因">
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
@ -54,12 +30,28 @@
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="来源" prop="source">
<el-select v-model="dataForm.source" placeholder="请选择来源">
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工段" prop="sectionId">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段">
<el-option v-for="dict in sectionList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" multiple>
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" />
@ -76,7 +68,7 @@
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import basicAdd from './basic-add';
import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
@ -99,6 +91,7 @@ export default {
workOrderList: [],
detList:[],
teamList: [],
sectionList:[],
sourceList: [
{
id: 1,
@ -117,6 +110,7 @@ export default {
workOrderId: null,
teamId: undefined,
num: undefined,
sectionId:undefined,
lineId:undefined,
description:undefined,
// description: undefined,
@ -137,6 +131,7 @@ export default {
this.getDict()
console.log('我看看', this.dataForm)
this.getCurrentTime()
this.getWorksectionById()
},
methods: {
getCurrentTime() {
@ -197,7 +192,43 @@ export default {
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
},
async getWorksectionById(lineId) {
if (lineId) {
const { code, data } = await this.$axios({
url: '/base/core-workshop-section/listByParentId',
method: 'get',
params: {
id: lineId,
},
});
if (code == 0) {
console.log(data)
this.sectionList = data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
}
} else {
this.$axios({
url: '/base/core-workshop-section/listAll',
method: 'get',
// params: {
// id: lineId,
// },
}).then((res) => {
// console.log(data)
this.sectionList = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
})
}
},
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId

View File

@ -0,0 +1,106 @@
/*
* @Author: zhp
* @Date: 2024-02-28 09:51:25
* @LastEditTime: 2024-02-28 10:05:00
* @LastEditors: zhp
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
createURL: '',
updateURL: '',
infoURL: '',
codeURL: '',
getOption: false,
isGetCode: false,
optionArrUrl: [],
optionArr: {}
},
visible: false,
setData: false
}
},
created() {
},
activated() {
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
console.log(response)
this.dataForm = response.data
this.dataForm.detId = response.data.detIdList
this.dataForm.logTime = new Date(response.data.createTime)
// if (this.setData) {
// this.setDataForm()
// }
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
getCode() {
this.urlOptions.codeURL()
.then(({ data: res }) => {
this.dataForm.code = res;
})
.catch(() => {});
},
getArr() {
const params = {
pageSize: 100,
pageNo: 1,
}
this.urlOptions.optionArrUrl.forEach((item, index) => {
item(params).then(({ data: res }) => {
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
})
.catch(() => {
});
});
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
let str = this.dataForm.detId.join(',')
this.dataForm.detId = str
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
formClear() {
this.$refs.dataForm.resetFields()
}
}
}

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-12-01 10:58:25
* @LastEditTime: 2024-02-28 10:13:10
* @LastEditors: zhp
* @Description:
-->
@ -15,43 +15,19 @@
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="工单号" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号" disabled>
<el-select disabled v-model="dataForm.workOrderId" placeholder="请选择工单号">
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组" prop="teamId">
<el-select v-model="dataForm.teamId" placeholder="请选择班组" disabled>
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
<el-form-item label="数量" prop="num">
<el-input disabled v-model="dataForm.num" placeholder="请输入数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="sum">
<el-input v-model="dataForm.sum" placeholder="请输入数量" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线" disabled>
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" disabled>
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" disabled
<el-date-picker disabled v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
@ -59,12 +35,28 @@
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="来源" prop="source">
<el-select v-model="dataForm.source" placeholder="请选择来源" disabled>
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item label="产线" prop="lineId">
<el-select disabled v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工段" prop="sectionId">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段" disabled>
<el-option v-for="dict in sectionList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" multiple disabled>
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" disabled />
@ -147,6 +139,7 @@ export default {
this.getDict()
console.log('我看看', this.dataForm)
this.getCurrentTime()
// this.getWorksectionById()
},
methods: {
// init() {
@ -198,6 +191,7 @@ export default {
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
getTeamList().then((res) => {
console.log(res);
// console.log(response);
@ -207,16 +201,46 @@ export default {
id: item.id
}
})
this.$axios({
url: '/base/core-workshop-section/listAll',
method: 'get',
// params: {
// id: lineId,
// },
}).then((res) => {
// console.log(data)
this.sectionList = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
})
// if (code == 0) {
// }
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
setMaterialCode() {
const chooseM = this.materialList.filter(item => {
return item.id === this.dataForm.materialId
})
this.dataForm.materialCode = chooseM[0].code
}
},
async getWorksectionById(lineId) {
const { code, data } = await this.$axios({
url: '/base/core-workshop-section/listByParentId',
method: 'get',
params: {
id: lineId,
},
});
if (code == 0) {
console.log(data)
this.sectionList = data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
}
}
},
};
</script>

View File

@ -30,32 +30,41 @@ import {
} from '@/api/base/qualityScrapLog';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
// {
// prop: 'createTime',
// label: '',
// filter: parseTime
// },
{
prop: 'logTime',
label: '报废时间',
filter: parseTime
},
{
prop: 'lineName',
label: '产线名称'
},
{
prop: 'sectionName',
label: '工段'
},
{
prop: 'workOrderName',
label: '工单'
label: '工单名称'
},
{
prop: 'teamName',
label: '班组'
prop: 'num',
label: '数量'
},
{
prop: 'detContent',
label: '报废原因'
},
{
prop: 'logTime',
label: '报废时间',
filter: parseTime
},
{
prop: 'num',
label: '数量'
},
{
prop: 'source',
label: '来源',
filter: (val) => val == 1 ? '平板端' : '网页端'
},
];
export default {

View File

@ -286,6 +286,7 @@ export default {
// this.searchBarFormConfig[0].defaultSelect = [];
// }
this.getList()
this.getDict()
},
methods: {
/** 获取搜索栏的产线列表 */
@ -320,7 +321,7 @@ export default {
// },
getList() {
this.getDataList()
this.getDict()
// this.getDict()
},
/** 查询列表 */
async getDataList() {
@ -330,7 +331,7 @@ export default {
const {
data: { data, otherList, otherMap, nameData },
} = await getStatisticalDataPage(this.queryParams)
console.log(this.queryParams);
// console.log(this.queryParams);
this.dynamicProps = this.filterNameData(nameData)
this.list = this.filterData(data);
},
@ -373,7 +374,7 @@ export default {
this.getList()
}
console.log(val);
// console.log(val);
}
/** 搜索按钮操作 */
// handleQuery() {

View File

@ -269,7 +269,7 @@ export default {
},
getConfirmed() {
return this.$confirm('是否直接确认保养记录', '提示', {
return this.$confirm('是否直接确认巡检记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',

View File

@ -281,7 +281,7 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.open = true;
this.title = '新巡检单';
this.title = '新巡检单';
this.$nextTick(() => {
this.$refs.add.init();
});

View File

@ -76,6 +76,7 @@
v-if="openUnplannedDrawer"
@refreshDataList="getList"
@destroy="openUnplannedDrawer = false" />
<PlannedEditDrawer
ref="planned"
v-if="openPlannedDrawer"
@ -86,6 +87,12 @@
v-if="recordDetailVisible"
ref="recordDetailDrawer"
@closed="recordDetailVisible = false" />
<UnplannedAddDet
ref="unplanned-det"
v-if="openUnplannedDetDrawer"
@refreshDataList="getList"
@destroy="openUnplannedDetDrawer = false" />
</div>
</template>
@ -95,8 +102,8 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import DialogFormUnplanned from './WaitingList--add--unplanned.vue';
import UnplannedEditDrawer from './WaitingListUnplanned--edit.vue';
import PlannedEditDrawer from './WaitingListPlanned--edit.vue';
import UnplannedAddDet from './WaitingListUnplanned--add_detail.vue';
import {
deleteEqMaintainLog,
exportMaintainLogExcel,
} from '@/api/equipment/base/maintain/record';
import WaitingListTable from './WaitingListTable.vue';
@ -134,7 +141,8 @@ export default {
WaitingListTable,
RecordDetail,
UnplannedEditDrawer,
PlannedEditDrawer
UnplannedAddDet,
PlannedEditDrawer,
},
mixins: [basicPageMixin],
data() {
@ -461,7 +469,7 @@ export default {
allSpecialEquipments: [],
openPlannedDrawer: false,
openUnplannedDrawer: false,
openPlannedDrawer: false,
openUnplannedDetDrawer: false,
};
},
watch: {
@ -681,7 +689,6 @@ export default {
if (!valid) {
return;
}
//
if (this.form.id != null) {
this.put({
...this.form,
@ -694,36 +701,51 @@ export default {
this.getList();
});
return;
} else {
this.post({
...this.form,
maintainWorker: this.form.maintainWorker.join(','),
special: true,
relatePlan: 2,
confirmed: false,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
setTimeout(() => {
this.handleAddDet(response.data);
}, 450);
});
}
//
this.getConfirmed()
.then((confirmed) => {
this.post({
...this.form,
maintainWorker: this.form.maintainWorker.join(','),
special: true,
relatePlan: 2,
confirmed: true,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
})
.catch((err) => {
this.post({
...this.form,
maintainWorker: this.form.maintainWorker.join(','),
special: true,
relatePlan: 2,
confirmed: false,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
});
// this.getConfirmed()
// .then((confirmed) => {
// this.post({
// ...this.form,
// maintainWorker: this.form.maintainWorker.join(','),
// special: true,
// relatePlan: 2,
// confirmed: true,
// }).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// })
// .catch((err) => {
// this.post({
// ...this.form,
// maintainWorker: this.form.maintainWorker.join(','),
// special: true,
// relatePlan: 2,
// confirmed: false,
// }).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// });
});
},
/** 确认 */
@ -757,6 +779,15 @@ export default {
});
}
},
/** 新增后添加内容 */
handleAddDet(id) {
this.openUnplannedDetDrawer = true;
this.$nextTick(() => {
this.$refs['unplanned-det'].init({ id });
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal

View File

@ -209,12 +209,12 @@
</div>
<div style="margin-top: 12px; position: relative">
<div style="position: absolute; top: -40px; right: 0">
<!-- <div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
</div>
</div> -->
<base-table
v-loading="attrListLoading"
:table-props="attrTableProps"
@ -222,11 +222,11 @@
:limit="attrQuery?.params.pageSize || 10"
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
<!-- <method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
@clickBtn="handleTableBtnClick" /> -->
</base-table>
<!-- 分页组件 -->
@ -324,6 +324,45 @@ export default {
{
prop: 'maintenanceDes',
label: '保养描述',
subcomponent: {
name: 'TableCellInput',
props: ['injectData'],
data() {
return {
inputvalue: null,
};
},
mounted() {
this.inputvalue = this.injectData.maintenanceDes;
},
methods: {
async handleValueChange(maintenanceDes) {
document.body.style.cursor = 'wait';
await this.$axios({
url: '/base/equipment-maintain-log-det/update',
method: 'put',
data: {
logId: this.injectData.logId,
remark: this.injectData.remark,
program: this.injectData.program,
id: this.injectData.id,
maintenanceDes: maintenanceDes,
},
});
document.body.style.cursor = 'default';
},
},
render: function (h) {
return (
<el-input
size="small"
key={this.injectData.id}
v-model={this.inputvalue}
onChange={this.handleValueChange}
/>
);
},
},
},
],
attrList: [],
@ -584,7 +623,7 @@ export default {
handleAddAttr() {
if (!this.row.id) return this.$message.error('请先选中保养记录');
this.resetAttrform();
this.attrTitle = '添加设备属性';
this.attrTitle = '添加保养项目';
this.attrFormVisible = true;
},
@ -597,14 +636,14 @@ export default {
});
if (res.code == 0) {
this.attrForm = res.data;
this.attrTitle = '编辑设备属性';
this.attrTitle = '编辑保养项目';
this.attrFormVisible = true;
}
},
//
handleDeleteAttr(attrId) {
this.$confirm('确定删除该保养内容?', '提示', {
this.$confirm('确定删除该保养项目?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',

View File

@ -0,0 +1,516 @@
<!--
filename: WaitingListUnplanned--edit.vue
author: liubin
date: 2023-08-22 14:38:56
description:
-->
<template>
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
custom-class="mes-drawer"
size="60%"
@closed="$emit('destroy')">
<SmallTitle slot="title">添加保养项目</SmallTitle>
<div class="drawer-body flex">
<div class="drawer-body__content">
<SmallTitle>保养内容</SmallTitle>
<div style="margin-top: 12px; position: relative">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" />
</div>
<div style="margin-top: 12px; position: relative">
<div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加项目
</el-button>
</div>
<base-table
v-loading="attrListLoading"
:table-props="attrTableProps"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="attrTotal > 0"
:total="attrTotal"
:page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
</div>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
type="primary"
@click="handleAddAttr">
添加属性
</el-button> -->
</div>
</div>
<!-- 属性对话框 -->
<base-dialog
:dialogTitle="attrTitle"
:dialogVisible="attrFormVisible"
width="35%"
:append-to-body="true"
custom-class="baseDialog"
@close="closeAttrForm"
@cancel="closeAttrForm"
@confirm="submitAttrForm">
<DialogForm
v-if="attrFormVisible"
ref="attrForm"
v-model="attrForm"
:rows="attrRows" />
</base-dialog>
</el-drawer>
</template>
<script>
import DialogForm from '../../../components/DialogForm/index.vue';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
export default {
components: { SmallTitle, DialogForm },
props: ['dataId'], // dataId id
data() {
return {
visible: false,
btnLoading: false,
form: {},
formLoading: false,
lineList: [],
maintainerList: [],
departmentList: [],
attrTableProps: [
{
prop: 'equipmentName',
label: '设备名称',
},
{
prop: 'program',
label: '保养项目',
},
{
prop: 'maintenanceDes',
label: '保养描述',
},
],
attrList: [],
attrTotal: 0,
attrTitle: '',
attrForm: {
id: null,
logId: null,
program: null,
maintenanceDes: null,
remark: null,
},
attrFormVisible: false,
attrRows: [
[
{
select: true,
label: '设备名称',
prop: 'equipmentId',
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=true',
// method: 'post',
// queryParams: {
// pageNo: 1,
// pageSize: 100,
// special: true,
// },
rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' },
],
},
],
[
{
input: true,
label: '保养项目',
prop: 'program',
},
],
[
{
input: true,
label: '保养描述',
prop: 'maintenanceDes',
},
],
[
{
input: true,
label: '备注',
prop: 'remark',
},
],
],
attrQuery: {
params: {
pageNo: 1,
pageSize: 10,
equipmentName: null,
},
}, //
searchBarFormConfig: [
{
type: 'input',
label: '设备',
placeholder: '请输入设备名称',
param: 'equipmentName',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
attrFormSubmitting: false,
attrListLoading: false,
// syncFileListFlag: null,
tableBtn: [],
row: null,
};
},
computed: {
departmentOptions() {
return (this.departmentList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.id,
}));
},
lineOptions() {
return (this.lineList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.id,
}));
},
maintainerOptions() {
return (this.maintainerList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.name,
}));
},
},
mounted() {
// this.getList('maintainer');
// this.getList('department');
// this.getList('line');
},
methods: {
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':
this.attrQuery.params.equipmentName = btn.equipmentName;
this.getAttrList();
break;
}
},
handleTableBtnClick({ type, data }) {
switch (type) {
case 'edit':
this.handleEditAttr(data.id);
break;
case 'delete':
this.handleDeleteAttr(data.id);
break;
}
},
getConfirmed() {
return this.$confirm('是否直接确认保养记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
},
async handleConfirm() {
if (this.attrList.length == 0) {
return this.$message.error('请添加保养项目');
}
let confirmed = false;
try {
confirmed = await this.getConfirmed();
} catch (err) {
confirmed = false;
}
if (confirmed) {
const res = await this.$axios({
url: '/base/equipment-maintain-log/confirm',
method: 'put',
data: [this.row.id],
});
if (res.code == 0) {
this.$message.success('已确认');
}
}
// this.btnLoading = true;
// this.$nextTick(async () => {
// const { code, data } = await this.$axios({
// url: '/base/equipment-maintain-log/update',
// method: 'put',
// data: {
// ...this.form,
// maintainWorker: this.form.maintainWorker.join(','),
// },
// });
// if (code == 0) {
// this.$modal.msgSuccess('');
// }
// this.btnLoading = false;
// this.$emit('refreshDataList');
// this.handleCancel();
// });
this.$emit('refreshDataList');
this.handleCancel();
},
handleEmitFun(val) {
console.log('handleEmitFun', val);
},
init(row) {
this.visible = true;
this.row = row;
this.getAttrList(row);
},
async getAttrList(row, condition = {}) {
if (!row) row = this.row;
this.attrListLoading = true;
const res = await this.$axios({
url: '/base/equipment-maintain-log-det/page',
method: 'get',
params: {
...this.attrQuery.params,
logId: row.id,
...condition,
},
});
if (res.code == 0) {
this.attrList = res.data.list;
this.attrTotal = res.data.total;
}
this.attrListLoading = false;
},
handleCancel() {
if (!this.attrList.length) {
return this.$message.error('请添加保养项目');
}
this.visible = false;
},
resetAttrform() {
this.attrForm = {
id: null,
logId: this.row.id,
maintenanceDes: '',
program: null,
remark: null,
};
},
//
handleAddAttr() {
if (!this.row.id) return this.$message.error('请先选中保养记录');
this.resetAttrform();
this.attrTitle = '添加保养项目';
this.attrFormVisible = true;
},
//
async handleEditAttr(attrId) {
const res = await this.$axios({
url: '/base/equipment-maintain-log-det/get',
method: 'get',
params: { id: attrId },
});
if (res.code == 0) {
this.attrForm = res.data;
this.attrTitle = '编辑保养项目';
this.attrFormVisible = true;
}
},
//
handleDeleteAttr(attrId) {
this.$confirm('确定删除该保养项目?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const res = await this.$axios({
url: 'url delete', // this.sections[1].urlDelete,
method: 'delete',
params: { id: attrId },
});
if (res.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
});
}
})
.catch(() => {});
},
//
submitAttrForm() {
this.$refs['attrForm'].validate(async (valid) => {
if (!valid) {
return;
}
try {
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
const res = await this.$axios({
url: isEdit
? '/base/equipment-maintain-log-det/update'
: '/base/equipment-maintain-log-det/create',
method: isEdit ? 'put' : 'post',
data: this.attrForm,
});
if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
});
}
this.attrFormSubmitting = false;
} catch (err) {
this.$message({
message: err,
type: 'error',
duration: 1500,
});
this.attrFormSubmitting = false;
}
});
},
closeAttrForm() {
this.attrFormVisible = false;
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-date-editor,
.drawer >>> .el-select {
width: 100%;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 0px;
}
.small-title::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: 22px;
border-radius: 1px;
margin-right: 8px;
background-color: #0b58ff;
}
.drawer-body {
display: flex;
flex-direction: column;
height: 100%;
}
.drawer-body__content {
flex: 1;
/* background: #eee; */
padding: 20px 30px;
overflow-y: auto;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
</style>

View File

@ -559,7 +559,7 @@ export default {
handleAddAttr() {
if (!this.row.id) return this.$message.error('请先选中保养记录');
this.resetAttrform();
this.attrTitle = '添加设备属性';
this.attrTitle = '添加保养项目';
this.attrFormVisible = true;
},
@ -572,14 +572,14 @@ export default {
});
if (res.code == 0) {
this.attrForm = res.data;
this.attrTitle = '编辑设备属性';
this.attrTitle = '编辑保养项目';
this.attrFormVisible = true;
}
},
//
handleDeleteAttr(attrId) {
this.$confirm('确定删除该属性?', '提示', {
this.$confirm('确定删除该保养项目?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',