This commit is contained in:
‘937886381’ 2024-08-01 16:33:56 +08:00
commit 0029af4ffa
161 changed files with 20769 additions and 10341 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-07-22 16:34:50 # @LastEditTime: 2024-07-31 14:57:31
# @LastEditors: zhp # @LastEditors: zhp
# @Description: # @Description:
### ###
@ -16,12 +16,14 @@ VUE_APP_TITLE = MES系统
# VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080' # VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082' # VUE_APP_BASE_API = 'http://192.168.1.81:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.56:48082' # VUE_APP_BASE_API = 'http://192.168.1.56:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080'
VUE_APP_BASE_API = 'http://192.168.1.64:48082' # VUE_APP_BASE_API = 'http://192.168.1.64:48082'
VUE_APP_BASE_API = 'http://192.168.1.99:48082'
# 积木报表指向地址 # 积木报表指向地址

View File

@ -48,7 +48,7 @@
"benz-amr-recorder": "^1.1.5", "benz-amr-recorder": "^1.1.5",
"bpmn-js-token-simulation": "0.10.0", "bpmn-js-token-simulation": "0.10.0",
"clipboard": "2.0.8", "clipboard": "2.0.8",
"code-brick-zj": "^1.0.2", "code-brick-zj": "^1.0.5",
"core-js": "^3.26.0", "core-js": "^3.26.0",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"diagram-js": "^12.3.0", "diagram-js": "^12.3.0",

View File

@ -0,0 +1,72 @@
import request from '@/utils/request'
// 获得集团订单分页
export function getOrderGroupPage(query) {
return request({
url: '/base/order-group/page',
method: 'get',
params: query
})
}
// 获得集团订单
export function getOrderGroup(query) {
return request({
url: '/base/order-group/get',
method: 'get',
params: query
})
}
// 更新集团订单
export function updateOrderGroup(data) {
return request({
url: '/base/order-group/update',
method: 'put',
data: data
})
}
// 创建集团订单
export function createOrderGroup(data) {
return request({
url: '/base/order-group/create',
method: 'post',
data: data
})
}
// 修改集团订单状态,结束-终止-作废用
export function groupOrderStatusSet(data) {
return request({
url: '/base/order-group/groupOrderStatusSet',
method: 'put',
data: data
})
}
// 获得集团订单详情
export function orderGroupDetail(query) {
return request({
url: '/base/order-group/getDetail',
method: 'get',
params: query
})
}
// 创建集团订单与厂务订单表关联表 一对多
export function orderConGroupOrder(data) {
return request({
url: '/base/order-con-group-order/create',
method: 'post',
data: data
})
}
// 订单监控
export function orderGroupMonitor(query) {
return request({
url: '/base/order-group/orderGroupMonitor',
method: 'get',
params: query
})
}

View File

@ -125,7 +125,7 @@ export function orderAssignmentList(query) {
// 获得所有客户列表 // 获得所有客户列表
export function customerList() { export function customerList() {
return request({ return request({
url: '/base/core-customer/listAll', url: 'base/core-customer/listAll',
method: 'get' method: 'get'
}) })
} }
@ -155,4 +155,13 @@ export function orderFinish(query) {
method: 'post', method: 'post',
params: query params: query
}) })
} }
// 作废订单
export function orderVoid(data) {
return request({
url: 'base/order/invalid',
method: 'put',
data
})
}

View File

@ -24,4 +24,14 @@ export function exportEqAnalysisExcel(query) {
params: query, params: query,
responseType: 'blob' responseType: 'blob'
}) })
}
// 导出设备状态追溯
export function exportEfficiencyExcel(query) {
return request({
url: '/analysis/equipment-analysis/export-efficiency',
method: 'get',
params: query,
responseType: 'blob'
})
} }

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-07-23 13:44:00 * @Date: 2024-07-23 13:44:00
* @LastEditTime: 2024-07-23 13:44:00 * @LastEditTime: 2024-07-31 09:34:17
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -14,7 +14,7 @@
*/ */
import request from '@/utils/request' import request from '@/utils/request'
// 删除设备保养记录
export function deleteData(id) { export function deleteData(id) {
return request({ return request({
url: '/base/equipment-check-program/delete?id=' + id, url: '/base/equipment-check-program/delete?id=' + id,

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-07-12 15:31:41 * @Date: 2024-07-12 15:31:41
* @LastEditTime: 2024-07-22 09:33:20 * @LastEditTime: 2024-07-30 16:44:47
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -19,7 +19,7 @@ export function getItemPageData(data) {
return request({ return request({
url: '/base/equipment-maintain-program/page', url: '/base/equipment-maintain-program/page',
method: 'get', method: 'get',
data params:data
}) })
} }

View File

@ -0,0 +1,104 @@
/*
* @Author: zhp
* @Date: 2024-07-30 15:46:23
* @LastEditTime: 2024-07-31 09:18:25
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得设备保养计划配置分页
export function getLogPage(query) {
return request({
url: '/base/equipment-maintain-log/page',
method: 'get',
params: query
})
}
// 创建设备保养计划
export function createLog(data) {
return request({
url: '/base/equipment-maintain-log/create',
method: 'post',
data: data
})
}
// 更新设备保养计划
export function updateLog(data) {
return request({
url: '/base/equipment-maintain-log/update',
method: 'put',
data: data
})
}
// 获得计划code
export function getCode() {
return request({
url: '/base/equipment-maintain-log/getCode',
method: 'get'
})
}
// 获得计划
export function getLog(query) {
return request({
url: '/base/equipment-maintain-log/get',
method: 'get',
params: query
})
}
// 获得设备保养计划配置详情分页
export function getLogDetPage(query) {
return request({
url: '/base/equipment-maintain-log-det/page',
method: 'get',
params: query
})
}
// 创建设备保养计划详情
export function createLogDet(data) {
return request({
url: '/base/equipment-maintain-log-det/create',
method: 'post',
data: data
})
}
// 更新设备保养计划详情
export function updateLogDet(data) {
return request({
url: '/base/equipment-maintain-log-det/update',
method: 'put',
data: data
})
}
// 获得计划详情
export function getLogDet(query) {
return request({
url: '/base/equipment-maintain-log-det/get',
method: 'get',
params: query
})
}
// 删除设备保养计划
export function deleteLog(id) {
return request({
url: '/base/equipment-maintain-log/delete?id=' + id,
method: 'delete'
})
}
// 删除设备保养计划详情
export function deleteLogDet(id) {
return request({
url: '/base/equipment-maintain-log-det/delete?id=' + id,
method: 'delete'
})
}

View File

@ -38,3 +38,11 @@ export function getInspectionData(query) {
params: query, params: query,
}) })
} }
export function getRecordInOneDay(query) {
return request({
url: '/analysis/record-in-one-day/get',
method: 'get',
params: query,
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -125,11 +125,8 @@ export default {
// start // start
this.Quill?.enable(false); this.Quill?.enable(false);
this.$nextTick(() => { this.$nextTick(() => {
this.Quill?.enable(true);
this.Quill?.blur(); this.Quill?.blur();
// if (!this.readOnly) { this.Quill?.enable(true);
// this.Quill?.enable();
// }
}); });
// //
if (this.type === 'url') { if (this.type === 'url') {

View File

@ -72,8 +72,8 @@ export default {
}, },
}, },
{ {
name: 'Order', name: 'Produce',
title: '订单管理', title: '生产管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: '',
@ -197,6 +197,7 @@ export default {
methods: { methods: {
getMsg() { getMsg() {
let menuList = this.$store.state.permission.sidebarRouters; let menuList = this.$store.state.permission.sidebarRouters;
console.log('sss', menuList);
console.log(menuList); console.log(menuList);
if (menuList.length > 0) { if (menuList.length > 0) {
for (let i = 0; i < menuList.length; i++) { for (let i = 0; i < menuList.length; i++) {

View File

@ -0,0 +1,100 @@
<!--
* @Author: zwq
* @Date: 2023-08-02 15:12:42
* @LastEditors: DY
* @LastEditTime: 2023-10-13 16:35:03
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="[{ label: '产线在制产品', type: 'title' }]"
ref="searchBarForm" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"
@emitFun="inputChange" />
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductPage } from '@/api/core/base/lineBindProduct';
import selectProduct from './selectProduct';
import { getProductPage } from '@/api/core/base/product';
const tableProps = [
{
prop: 'lineName',
label: '产线'
},
{
prop: 'productName',
label: '在制产品',
list: [],
subcomponent: selectProduct,
},
{
prop: 'recordTime',
label: '开始时间',
filter: parseTime,
},
];
export default {
mixins: [basicPage, selectProduct],
data() {
return {
urlOptions: {
getDataListURL: getLineBindProductPage,
},
tableProps,
tableData: [],
// formConfig: [
// {
// type: 'button',
// btnName: '',
// name: 'search',
// color: 'primary',
// },
// ],
};
},
components: {},
created() {
const params = {
pageSize: 100,
pageNo: 1,
};
getProductPage(params).then((response) => {
this.tableProps[1].list = response.data.list;
console.log('打印', this.tableProps[1].list)
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.getDataList();
break;
default:
console.log(val);
}
},
inputChange() {
this.getDataList();
},
},
};
</script>

View File

@ -0,0 +1,79 @@
<!--
* @Author: zwq
* @Date: 2023-08-03 14:09:18
* @LastEditors: DY
* @LastEditTime: 2023-10-13 16:47:25
* @Description:
-->
<template>
<div class="tableInner">
<el-popover
placement="top"
title="切换在制产品"
width="160"
v-model="visible">
<el-select v-model="list.string" style="margin: 5px;" filterable>
<el-option
v-for="item in injectData.list"
:key="item.id"
:label="item.name"
:value="item.id + '+' + item.name"></el-option>
</el-select>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">
取消
</el-button>
<el-button type="primary" size="mini" @click="changeInput">
确定
</el-button>
</div>
<el-button type="text" slot="reference">
<svg-icon icon-class="changelogo"/>
</el-button>
</el-popover>
<el-input readonly v-model="list.productName" style="width: 50%;margin-left: 5px" ></el-input>
</div>
</template>
<script>
import { switchLineBindProduct } from '@/api/core/base/lineBindProduct';
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
list: this.injectData,
visible: false,
};
},
mounted() {
console.log('hello', this.list)
},
methods: {
changeInput() {
const data = {
id: this.list.id,
productId: this.list.string.split('+')[0],
productName: this.list.string.split('+')[1],
};
switchLineBindProduct(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.list.productName = this.list.string.split('+')[1]
this.$emit('emitData');
});
},
},
};
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -0,0 +1,144 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData" />
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog';
import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getProductPage } from '@/api/core/base/product';
const tableProps = [
{
prop: 'productionLineName',
label: '产线'
},
{
prop: 'productName',
label: '在制产品'
},
{
prop: 'startTime',
label: '开始时间',
filter: parseTime,
},
{
prop: 'endTime',
label: '结束时间',
filter: parseTime,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getLineBindProductLogPage,
},
tableProps,
tableData: [],
optionArrUrl: [getProductionLinePage, getProductPage],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'productionLineId',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '在制产品',
selectOptions: [],
param: 'productId',
defaultSelect: '',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'startTime',
valueFormat: 'timestamp'
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: {
},
created() {
this.getArr();
},
methods: {
getArr() {
const params = {
page: 1,
limit: 500,
};
this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list;
});
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.productionLineId = val.productionLineId;
this.listQuery.productId = val.productId;
this.listQuery.startTime = val.startTime;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,448 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产品编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
:disabled="isdetail"
placeholder="请输入产品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
:disabled="isdetail"
placeholder="请输入产品名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产品类型" prop="typeDictValue">
<el-select
v-model="dataForm.typeDictValue"
style="width: 100%"
:disabled="isdetail"
placeholder="请选择产品类型">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unitDictValue">
<el-select
v-model="dataForm.unitDictValue"
style="width: 100%"
:disabled="isdetail"
placeholder="请选择单位">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="specifications">
<el-input
:disabled="isdetail"
v-model="dataForm.specifications"
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位平方数" prop="area">
<el-input
:disabled="isdetail"
v-model="dataForm.area"
placeholder="请输入单位平方数" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="完成单位产品用时" prop="processTime">
<el-input
:disabled="isdetail"
v-model="dataForm.processTime"
placeholder="请输入完成单位产品用时" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性列表
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="isdetail ? null : '添加属性'"
@emitButtonClick="addNew()"
:table-data="productAttributeList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
</div>
</div>
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<span v-if="!isdetail">
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
<el-button
v-if="dataForm.id && !isdetail"
type="primary"
@click="addNew()">
添加属性
</el-button>
</span>
</div> -->
<div 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-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:product-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import {
deleteProductAttr,
getProductAttrPage,
} from '@/api/core/base/productAttr';
import {
createProduct,
updateProduct,
getProduct,
getCode,
} from '@/api/core/base/product';
import productAttrAdd from './attr-add';
import { parseTime } from '../../mixins/code-filter';
import SmallTitle from './SmallTitle';
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'name',
label: '属性名',
},
{
prop: 'value',
label: '属性值',
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
dataForm: {
id: null,
name: '', //
code: '', //
area: 0, // (float only)
typeDictValue: null, // id
processTime: null, // (s)
specifications: '', //
unitDictValue: '', // id
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
code: [
{
required: true,
message: '产品编码不能为空',
trigger: 'blur',
},
// {
// type: 'number',
// message: '',
// trigger: 'blur',
// transfom: 'val => Number(val)',
// },
],
name: [
{
required: true,
message: '产品名称不能为空',
trigger: 'blur',
},
],
typeDictValue: [
{
required: true,
message: '产品类型不能为空',
trigger: 'blur',
},
],
area: [
{
type: 'number',
message: '请输入正确的数值',
trigger: 'change',
transform: (val) => Number(val),
},
],
processTime: [
{
required: true,
message: '完成单位产品用时不能为空',
trigger: 'blur',
},
{
type: 'number',
message: '请输入正确的数值',
trigger: 'blur',
transform: (val) => Number(val),
},
],
},
isdetail: false,
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
this.listQuery.total = 0;
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || null;
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
getProduct(id).then((response) => {
this.dataForm = response.data;
});
//
this.getList();
} else {
getCode().then((res) => {
this.dataForm.code = res.data;
});
}
});
},
getList() {
//
getProductAttrPage({
...this.listQuery,
productId: this.dataForm.id,
}).then((response) => {
this.productAttributeList = response.data.list;
this.listQuery.total = response.data.total;
});
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateProduct(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createProduct(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
</style>

View File

@ -0,0 +1,139 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="属性名" prop="name">
<el-input
v-model="dataForm.name"
placeholder="请输入属性名"
clearable />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input
v-model="dataForm.value"
placeholder="请输入属性值"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createProductAttr,
updateProductAttr,
getProductAttr,
} from '@/api/core/base/productAttr';
export default {
props: {
productId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: 0,
name: '',
value: '',
},
dataRule: {
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getProductAttr(this.dataForm.id).then((res) => {
const { name, value } = res.data;
this.dataForm.name = name;
this.dataForm.value = value;
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,200 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: DY
* @LastEditTime: 2023-10-13 10:27:00
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import unitDict from './unitDict';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
deleteProduct,
getProductPage,
exportProductExcel,
} from '@/api/core/base/product';
const tableProps = [
{
prop: 'code',
label: '产品编码'
},
{
prop: 'name',
label: '产品名称'
},
{
prop: 'specifications',
label: '规格'
},
{
prop: 'unitDictValue',
label: '单位',
subcomponent: unitDict,
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getProductPage,
deleteURL: deleteProduct,
exportURL: exportProductExcel,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:product:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:product:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
this.$auth.hasPermi(`base:product:update`)
? {
type: 'detail',
btnName: '详情',
}
: undefined,
].filter((v) => v),
tableData: [],
formConfig: [
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'code',
},
{
type: 'input',
label: '产品名称',
placeholder: '产品名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:product:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:product:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
otherMethods(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
},
},
};
</script>

View File

@ -0,0 +1,228 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="产品id,关联产品表" prop="productId">
<el-input v-model="queryParams.productId" placeholder="请输入产品id,关联产品表" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input v-model="queryParams.value" placeholder="请输入属性值" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['base:product-attr:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:product-attr:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="产品id,关联产品表" align="center" prop="productId" />
<el-table-column label="属性值" align="center" prop="value" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:product-attr:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:product-attr:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="产品id,关联产品表" prop="productId">
<el-input v-model="form.productId" placeholder="请输入产品id,关联产品表" />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input v-model="form.value" placeholder="请输入属性值" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createProductAttr, updateProductAttr, deleteProductAttr, getProductAttr, getProductAttrPage, exportProductAttrExcel } from "@/api/core/base/productAttr";
export default {
name: "ProductAttr",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
productId: null,
value: null,
createTime: [],
},
//
form: {},
//
rules: {
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
productId: [{ required: true, message: "产品id,关联产品表不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getProductAttrPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
name: undefined,
productId: undefined,
value: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加产品属性";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getProductAttr(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改产品属性";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateProductAttr(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createProductAttr(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除产品属性编号为"' + id + '"的数据项?').then(function() {
return deleteProductAttr(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有产品属性数据项?').then(() => {
this.exportLoading = true;
return exportProductAttrExcel(params);
}).then(response => {
this.$download.excel(response, '产品属性.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,153 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: DY
* @LastEditTime: 2023-09-21 15:45:07
* @Description:
-->
<template>
<el-form
class="dialog-inner__form"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="90px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产线编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入产线编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入产线名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="factoryId" label="工厂名称">
<el-select
v-model="dataForm.factoryId"
filterable
clearable
placeholder="请选择工厂">
<el-option
v-for="item in urlOptions.optionArr.arr0"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线TT值(h)" prop="tvalue">
<el-input
v-model="dataForm.tvalue"
clearable
placeholder="请输入每小时下片数量" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="额外编码" prop="externalCode">
<el-input
v-model="dataForm.externalCode"
clearable
placeholder="请输入额外编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="描述" prop="description">
<el-input
v-model="dataForm.description"
type="textarea"
placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createProductionLine,
updateProductionLine,
getProductionLine,
getCode,
} from '@/api/core/base/productionLine';
import { getFactoryPage } from '@/api/core/base/factory';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
getOption: true,
isGetCode: true,
codeURL: getCode,
createURL: createProductionLine,
updateURL: updateProductionLine,
infoURL: getProductionLine,
optionArrUrl: [getFactoryPage],
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
tvalue: undefined,
factoryId: undefined,
externalCode: undefined,
remark: undefined,
description: undefined,
},
dataRule: {
code: [
{ required: true, message: '产线编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '产线名称不能为空', trigger: 'blur' },
],
factoryId: [
{ required: true, message: '工厂不能为空', trigger: 'change' },
],
tvalue: [
{
type: 'number',
message: '请输入正确的数字',
trigger: 'change',
transform: (val) => Number(val),
},
],
},
};
},
methods: {},
};
</script>
<style scoped>
.dialog-inner__form >>> .el-select {
width: 100%;
}
</style>

View File

@ -0,0 +1,217 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import codeFilter from '../../mixins/code-filter';
import { parseTime } from '../../mixins/code-filter';
import {
deleteProductionLine,
getProductionLinePage,
exportProductionLineExcel,
getStatus,
} from '@/api/core/base/productionLine';
const tableProps = [
{
prop: 'code',
label: '产线编码'
},
{
prop: 'name',
label: '产线名称'
},
{
prop: 'factoryName',
label: '工厂'
},
{
prop: 'externalCode',
label: '额外编码'
},
{
prop: 'status',
label: '当前状态',
filter: codeFilter('lineStatus'),
},
{
prop: 'description',
label: '描述'
},
{
prop: 'remark',
label: '备注'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getProductionLinePage,
deleteURL: deleteProductionLine,
exportURL: exportProductionLineExcel,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:production-line:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:production-line:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
tableData: [],
formConfig: [
{
type: 'input',
label: '产线名称',
placeholder: '产线名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:production-line:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:production-line:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:production-line:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.listQuery.total = response.data.total;
this.getStatus(response.data.list);
this.dataListLoading = false;
});
},
getStatus(list) {
const ids = list.map((i) => {
return i.id;
});
getStatus(ids).then((response) => {
response.forEach((a) => {
list.forEach((b) => {
if (b.id === a.id) b.status = a.status;
});
});
this.tableData = list;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,271 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="产线id" prop="productionLineId">
<el-input v-model="queryParams.productionLineId" placeholder="请输入产线id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间段内上片数量" prop="inputNum">
<el-input v-model="queryParams.inputNum" placeholder="请输入上一次记录时间至该条记录时间段内上片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间段内下片数量" prop="outputNum">
<el-input v-model="queryParams.outputNum" placeholder="请输入上一次记录时间至该条记录时间段内下片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
<el-input v-model="queryParams.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
<el-input v-model="queryParams.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="合格率(%" prop="passRate">
<el-input v-model="queryParams.passRate" placeholder="请输入合格率(%" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['base:production-line-rec-day:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:production-line-rec-day:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="产线id" align="center" prop="productionLineId" />
<el-table-column label="上一次记录时间至该条记录时间段内上片数量" align="center" prop="inputNum" />
<el-table-column label="上一次记录时间至该条记录时间段内下片数量" align="center" prop="outputNum" />
<el-table-column label="该记录时间点的累计上片数量" align="center" prop="sumInputNum" />
<el-table-column label="该记录时间点的累计下片数量" align="center" prop="sumOutputNum" />
<el-table-column label="记录时间" align="center" prop="recordTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.recordTime) }}</span>
</template>
</el-table-column>
<el-table-column label="合格率(%" align="center" prop="passRate" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:production-line-rec-day:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:production-line-rec-day:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="产线id" prop="productionLineId">
<el-input v-model="form.productionLineId" placeholder="请输入产线id" />
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间段内上片数量" prop="inputNum">
<el-input v-model="form.inputNum" placeholder="请输入上一次记录时间至该条记录时间段内上片数量" />
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间段内下片数量" prop="outputNum">
<el-input v-model="form.outputNum" placeholder="请输入上一次记录时间至该条记录时间段内下片数量" />
</el-form-item>
<el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
<el-input v-model="form.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" />
</el-form-item>
<el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
<el-input v-model="form.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" />
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择记录时间" />
</el-form-item>
<el-form-item label="合格率(%" prop="passRate">
<el-input v-model="form.passRate" placeholder="请输入合格率(%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createProductionLineRecDay, updateProductionLineRecDay, deleteProductionLineRecDay, getProductionLineRecDay, getProductionLineRecDayPage, exportProductionLineRecDayExcel } from "@/api/core/base/productionLineRecDay";
export default {
name: "ProductionLineRecDay",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
// 线
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
productionLineId: null,
inputNum: null,
outputNum: null,
sumInputNum: null,
sumOutputNum: null,
recordTime: [],
passRate: null,
createTime: [],
},
//
form: {},
//
rules: {
inputNum: [{ required: true, message: "上一次记录时间至该条记录时间段内上片数量不能为空", trigger: "blur" }],
outputNum: [{ required: true, message: "上一次记录时间至该条记录时间段内下片数量不能为空", trigger: "blur" }],
sumInputNum: [{ required: true, message: "该记录时间点的累计上片数量不能为空", trigger: "blur" }],
sumOutputNum: [{ required: true, message: "该记录时间点的累计下片数量不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getProductionLineRecDayPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
productionLineId: undefined,
inputNum: undefined,
outputNum: undefined,
sumInputNum: undefined,
sumOutputNum: undefined,
recordTime: undefined,
passRate: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加产线生产定时记录表 一天添加一次数据";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getProductionLineRecDay(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改产线生产定时记录表 一天添加一次数据";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateProductionLineRecDay(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createProductionLineRecDay(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除产线生产定时记录表 一天添加一次数据编号为"' + id + '"的数据项?').then(function() {
return deleteProductionLineRecDay(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有产线生产定时记录表 一天添加一次数据数据项?').then(() => {
this.exportLoading = true;
return exportProductionLineRecDayExcel(params);
}).then(response => {
this.$download.excel(response, '产线生产定时记录表 一天添加一次数据.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,271 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="产线id" prop="productionLineId">
<el-input v-model="queryParams.productionLineId" placeholder="请输入产线id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间端内上片数量" prop="inputNum">
<el-input v-model="queryParams.inputNum" placeholder="请输入上一次记录时间至该条记录时间端内上片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间端内下片数量" prop="outputNum">
<el-input v-model="queryParams.outputNum" placeholder="请输入上一次记录时间至该条记录时间端内下片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
<el-input v-model="queryParams.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
<el-input v-model="queryParams.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="合格率(%" prop="passRate">
<el-input v-model="queryParams.passRate" placeholder="请输入合格率(%" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['base:production-line-rec-sch:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:production-line-rec-sch:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="产线id" align="center" prop="productionLineId" />
<el-table-column label="上一次记录时间至该条记录时间端内上片数量" align="center" prop="inputNum" />
<el-table-column label="上一次记录时间至该条记录时间端内下片数量" align="center" prop="outputNum" />
<el-table-column label="该记录时间点的累计上片数量" align="center" prop="sumInputNum" />
<el-table-column label="该记录时间点的累计下片数量" align="center" prop="sumOutputNum" />
<el-table-column label="记录时间" align="center" prop="recordTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.recordTime) }}</span>
</template>
</el-table-column>
<el-table-column label="合格率(%" align="center" prop="passRate" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:production-line-rec-sch:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:production-line-rec-sch:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="产线id" prop="productionLineId">
<el-input v-model="form.productionLineId" placeholder="请输入产线id" />
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间端内上片数量" prop="inputNum">
<el-input v-model="form.inputNum" placeholder="请输入上一次记录时间至该条记录时间端内上片数量" />
</el-form-item>
<el-form-item label="上一次记录时间至该条记录时间端内下片数量" prop="outputNum">
<el-input v-model="form.outputNum" placeholder="请输入上一次记录时间至该条记录时间端内下片数量" />
</el-form-item>
<el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
<el-input v-model="form.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" />
</el-form-item>
<el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
<el-input v-model="form.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" />
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择记录时间" />
</el-form-item>
<el-form-item label="合格率(%" prop="passRate">
<el-input v-model="form.passRate" placeholder="请输入合格率(%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createProductionLineRecSch, updateProductionLineRecSch, deleteProductionLineRecSch, getProductionLineRecSch, getProductionLineRecSchPage, exportProductionLineRecSchExcel } from "@/api/core/base/productionLineRecSch";
export default {
name: "ProductionLineRecSch",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
// 线
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
productionLineId: null,
inputNum: null,
outputNum: null,
sumInputNum: null,
sumOutputNum: null,
recordTime: [],
passRate: null,
createTime: [],
},
//
form: {},
//
rules: {
inputNum: [{ required: true, message: "上一次记录时间至该条记录时间端内上片数量不能为空", trigger: "blur" }],
outputNum: [{ required: true, message: "上一次记录时间至该条记录时间端内下片数量不能为空", trigger: "blur" }],
sumInputNum: [{ required: true, message: "该记录时间点的累计上片数量不能为空", trigger: "blur" }],
sumOutputNum: [{ required: true, message: "该记录时间点的累计下片数量不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getProductionLineRecSchPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
productionLineId: undefined,
inputNum: undefined,
outputNum: undefined,
sumInputNum: undefined,
sumOutputNum: undefined,
recordTime: undefined,
passRate: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加产线生产定时记录表 一小时添加一次数据 至少需要一个上片设备和下片设备才会自动添加";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getProductionLineRecSch(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改产线生产定时记录表 一小时添加一次数据 至少需要一个上片设备和下片设备才会自动添加";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateProductionLineRecSch(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createProductionLineRecSch(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除产线生产定时记录表 一小时添加一次数据 至少需要一个上片设备和下片设备才会自动添加编号为"' + id + '"的数据项?').then(function() {
return deleteProductionLineRecSch(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有产线生产定时记录表 一小时添加一次数据 至少需要一个上片设备和下片设备才会自动添加数据项?').then(() => {
this.exportLoading = true;
return exportProductionLineRecSchExcel(params);
}).then(response => {
this.$download.excel(response, '产线生产定时记录表 一小时添加一次数据 至少需要一个上片设备和下片设备才会自动添加.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,112 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: DY
* @LastEditTime: 2023-10-16 13:40:00
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="90px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工段编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入工段编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工段名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入工段名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="productionLineId" label="产线">
<el-select
v-model="dataForm.productionLineId" filterable clearable placeholder="请选择产线">
<el-option
v-for="item in urlOptions.optionArr.arr0"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排序" prop="sort">
<el-input-number v-model="dataForm.sort" :min="1" :max="100" clearable placeholder="请输入排序" />
</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>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWorkshopSection,
updateWorkshopSection,
getWorkshopSection,
getCode,
} from '@/api/core/base/workshopSection';
import {
getProductionLinePage,
} from '@/api/core/base/productionLine';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
getOption: true,
isGetCode: true,
codeURL: getCode,
createURL: createWorkshopSection,
updateURL: updateWorkshopSection,
infoURL: getWorkshopSection,
optionArrUrl: [getProductionLinePage],
},
dataForm: {
id: undefined,
code: undefined,
productionLineId: undefined,
sort: undefined,
name: undefined,
remark: undefined,
},
dataRule: {
code: [
{ required: true, message: '工段编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '工段名称不能为空', trigger: 'blur' },
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' },
],
productionLineId: [
{ required: true, message: '产线不能为空', trigger: 'change' },
],
},
};
},
methods: {
},
};
</script>

View File

@ -0,0 +1,182 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
deleteWorkshopSection,
getWorkshopSectionPage,
exportWorkshopSectionExcel
} from "@/api/core/base/workshopSection";
const tableProps = [
{
prop: 'code',
label: '工段编码'
},
{
prop: 'name',
label: '工段名称'
},
{
prop: 'productionLineName',
label: '产线'
},
{
prop: 'sort',
label: '排序'
},
{
prop: 'remark',
label: '备注'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWorkshopSectionPage,
deleteURL: deleteWorkshopSection,
exportURL: exportWorkshopSectionExcel,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:workshop-section:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:workshop-section:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工段名称',
placeholder: '工段名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:workshop-section:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
// {
// type: this.$auth.hasPermi('base:workshop-section:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:workshop-section:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -1,218 +1,215 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<!-- 搜索工作栏 --> <search-bar
<search-bar :formConfigs="formConfig"
:formConfigs="formConfig" ref="searchBarForm"
ref="searchBarForm" @headBtnClick="buttonClick" />
@headBtnClick="buttonClick" <!-- 列表 -->
/> <base-table
<!-- 列表 --> :page="queryParams.pageNo"
<base-table :limit="queryParams.pageSize"
:page="queryParams.pageNo" :table-props="tableProps"
:limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps" :max-height="tableH">
:table-data="list" <method-btn
:max-height="tableH" v-if="tableBtn.length"
> slot="handleBtn"
<method-btn :width="80"
v-if="tableBtn.length" label="操作"
slot="handleBtn" :method-list="tableBtn"
:width="80" @clickBtn="handleClick" />
label="操作" </base-table>
:method-list="tableBtn" <pagination
@clickBtn="handleClick" :page.sync="queryParams.pageNo"
/> :limit.sync="queryParams.pageSize"
</base-table> :total="total"
<pagination @pagination="getList" />
:page.sync="queryParams.pageNo" <!-- 新增 -->
:limit.sync="queryParams.pageSize" <base-dialog
:total="total" :dialogTitle="addOrEditTitle"
@pagination="getList" :dialogVisible="centervisible"
/> @cancel="handleCancel"
<!-- 新增 --> @confirm="handleConfirm"
<base-dialog :before-close="handleCancel">
:dialogTitle="addOrEditTitle" <energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
:dialogVisible="centervisible" </base-dialog>
@cancel="handleCancel" </div>
@confirm="handleConfirm"
:before-close="handleCancel"
>
<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc"; import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc';
// import { publicFormatter } from '@/utils/dict' // import { publicFormatter } from '@/utils/dict'
import EnergyPlcAdd from './components/energyPlcAdd.vue' import EnergyPlcAdd from './components/energyPlcAdd.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'plcTableName', prop: 'plcTableName',
label: '关联表名' label: '关联表名',
}, },
{ {
prop: 'code', prop: 'code',
label: '关联表编码', label: '关联表编码',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'name', prop: 'name',
label: '标识名' label: '标识名',
}, },
{ {
prop: 'enName', prop: 'enName',
label: '英文标识名' label: '英文标识名',
}, },
{ {
prop: 'collection', prop: 'collection',
label: '是否采集' label: '是否采集',
}, },
{ {
prop: 'description', prop: 'description',
label: '描述', label: '描述',
showOverflowtooltip: true showOverflowtooltip: true,
} },
] ];
export default { export default {
name: "EnergyPlc", name: 'EnergyPlc',
components: { EnergyPlcAdd }, components: { EnergyPlcAdd },
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '标识名', type: 'input',
placeholder: '标识名', label: '标识名',
param: 'name' placeholder: '标识名',
}, param: 'name',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: 'separate' {
}, type: 'separate',
{ },
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', {
btnName: '新增', type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
name: 'add', btnName: '新增',
color: 'success', name: 'add',
plain: true color: 'success',
} plain: true,
], },
tableProps, ],
tableBtn: [ tableProps,
this.$auth.hasPermi('base:energy-plc:update') tableBtn: [
? { this.$auth.hasPermi('base:energy-plc:update')
type: 'edit', ? {
btnName: '编辑' type: 'edit',
} btnName: '编辑',
: undefined, }
this.$auth.hasPermi('base:energy-plc:delete') : undefined,
? { this.$auth.hasPermi('base:energy-plc:delete')
type: 'delete', ? {
btnName: '删除' type: 'delete',
} btnName: '删除',
: undefined }
].filter((v) => v), : undefined,
tableH: this.tableHeight(260), ].filter((v) => v),
collectionList: [ collectionList: [
{value: 0,label: '否'}, { value: 0, label: '否' },
{value: 1,label: '是'} { value: 1, label: '是' },
], ],
// //
total: 0, total: 0,
// //
list: [], list: [],
// //
addOrEditTitle: "", addOrEditTitle: '',
// //
centervisible: false, centervisible: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null name: null,
} },
}; };
}, },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260) },
}) methods: {
this.getList(); buttonClick(val) {
}, switch (val.btnName) {
methods: { case 'search':
buttonClick(val) { this.queryParams.pageNo = 1;
switch (val.btnName) { this.queryParams.name = val.name;
case 'search': this.getList();
this.queryParams.pageNo = 1; break;
this.queryParams.name = val.name default:
this.getList() this.addOrEditTitle = '新增';
break this.centervisible = true;
default: this.$nextTick(() => {
this.addOrEditTitle = '新增' this.$refs.energyPlc.init();
this.centervisible = true });
this.$nextTick(() => { }
this.$refs.energyPlc.init() },
}) /** 查询列表 */
} getList() {
}, getEnergyPlcPage(this.queryParams).then((response) => {
/** 查询列表 */ let arr = response.data.list || [];
getList() { arr &&
getEnergyPlcPage(this.queryParams).then(response => { arr.map((item) => {
let arr = response.data.list || []; this.collectionList.map((i) => {
arr&&arr.map(item => { if (item.collection === i.value) {
this.collectionList.map(i => { item.collection = i.label;
if (item.collection === i.value) { }
item.collection = i.label });
} });
}) this.list = arr;
}) this.total = response.data.total;
this.list = arr });
this.total = response.data.total; },
}); handleClick(val) {
}, switch (val.type) {
handleClick(val) { case 'edit':
switch (val.type) { this.addOrEditTitle = '编辑';
case 'edit': this.$nextTick(() => {
this.addOrEditTitle = '编辑' this.$refs.energyPlc.init(val.data.id);
this.$nextTick(() => { });
this.$refs.energyPlc.init(val.data.id) this.centervisible = true;
}) break;
this.centervisible = true default:
break this.handleDelete(val.data);
default: }
this.handleDelete(val.data) },
} handleCancel() {
}, this.$refs.energyPlc.formClear();
handleCancel() { this.centervisible = false;
this.$refs.energyPlc.formClear() this.addOrEditTitle = '';
this.centervisible = false },
this.addOrEditTitle = '' handleConfirm() {
}, this.$refs.energyPlc.submitForm();
handleConfirm() { },
this.$refs.energyPlc.submitForm() successSubmit() {
}, this.handleCancel();
successSubmit() { this.getList();
this.handleCancel() },
this.getList() /** 删除按钮操作 */
}, handleDelete(row) {
/** 删除按钮操作 */ this.$modal
handleDelete(row) { .delConfirm(row.name)
this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function() { .then(function () {
return deleteEnergyPlc(row.id); return deleteEnergyPlc(row.id);
}).then(() => { })
this.queryParams.pageNo = 1; .then(() => {
this.getList(); this.queryParams.pageNo = 1;
this.$modal.msgSuccess("删除成功"); this.getList();
}).catch(() => {}); this.$modal.msgSuccess('删除成功');
} })
} .catch(() => {});
},
},
}; };
</script> </script>

View File

@ -307,7 +307,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除"' + row.sectionName + '"?') .delConfirm(row.buttonId)
.then(function () { .then(function () {
return deleteQualityInspectionBoxBtn(id); return deleteQualityInspectionBoxBtn(id);
}) })

View File

@ -288,7 +288,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除检测信息"' + row.content + '"?') .delConfirm(row.content)
.then(function () { .then(function () {
return deleteQualityInspectionDet(id); return deleteQualityInspectionDet(id);
}) })

View File

@ -273,7 +273,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除该质量检测类型?') .delConfirm(row.name)
.then(function () { .then(function () {
return deleteQualityInspectionType(id); return deleteQualityInspectionType(id);
}) })

View File

@ -0,0 +1,159 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: DY
* @LastEditTime: 2023-09-21 16:02:07
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
}
},
created() {
},
mounted() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
//改变状态
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => { });
},
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.content)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
// 删除
deleteHandle(id,name) {
this.$modal
.delConfirm(name)
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.getDataList();
this.$modal.msgSuccess('删除成功');
});
})
.catch(() => { });
},
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.xm1 = val.xm1;
this.listQuery.xm2 = val.xm2;
this.listQuery.pageNo = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
handleCancel() {
this.$refs.addOrUpdate.formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.addOrUpdate.dataFormSubmit()
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '工厂.xls');
this.exportLoading = false;
}).catch(() => { });
}
}
}

View File

@ -40,7 +40,7 @@
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import basicPage from '../../../core/mixins/basic-page'; import basicPage from './basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getQualityScrapDetPage, getQualityScrapDetPage,

View File

@ -0,0 +1,159 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: DY
* @LastEditTime: 2023-09-21 16:02:07
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
}
},
created() {
},
mounted() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
//改变状态
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => { });
},
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
// 删除
deleteHandle(id,name) {
this.$modal
.delConfirm(name)
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.getDataList();
this.$modal.msgSuccess('删除成功');
});
})
.catch(() => { });
},
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.xm1 = val.xm1;
this.listQuery.xm2 = val.xm2;
this.listQuery.pageNo = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
handleCancel() {
this.$refs.addOrUpdate.formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.addOrUpdate.dataFormSubmit()
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '工厂.xls');
this.exportLoading = false;
}).catch(() => { });
}
}
}

View File

@ -40,7 +40,7 @@
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import basicPage from '../../../core/mixins/basic-page'; import basicPage from './basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getQualityScrapTypePage, getQualityScrapTypePage,

View File

@ -1,4 +1,4 @@
<!-- <!--
filename: dialogForm.vue filename: dialogForm.vue
author: liubin author: liubin
date: 2023-09-11 15:55:13 date: 2023-09-11 15:55:13
@ -6,106 +6,59 @@
--> -->
<template> <template>
<el-form <el-form ref="form" :model="dataForm" label-width="100px" v-loading="formLoading">
ref="form" <el-row :gutter="20">
:model="dataForm" <el-col :span="12">
label-width="100px" <el-form-item label="报警编码" prop="code" :rules="[{ required: true, message: '报警编码不能为空', trigger: 'blur' }]">
v-loading="formLoading"> <el-input :disabled="disabled" v-model="dataForm.code" @change="$emit('update', dataForm)"
<el-row :gutter="20"> placeholder="请输入报警编码" />
<el-col :span="12"> </el-form-item>
<el-form-item </el-col>
label="报警编码" <el-col :span="12">
prop="code" <el-form-item label="报警类型" prop="type" :rules="[{ required: true, message: '报警类型不能为空', trigger: 'blur' }]">
:rules="[{ required: true, message: '报警编码不能为空', trigger: 'blur' }]"> <el-select :disabled="disabled" v-model="dataForm.type" placeholder="请选择报警类型" @change="handleTypeChange">
<el-input <el-option v-for="opt in [
:disabled="disabled"
v-model="dataForm.code"
@change="$emit('update', dataForm)"
placeholder="请输入报警编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="报警级别"
prop="grade"
:rules="[{ required: true, message: '报警级别不能为空', trigger: 'blur' }]">
<el-select
:disabled="disabled"
v-model="dataForm.grade"
placeholder="请选择报警级别"
@change="$emit('update', dataForm)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="参数列名"
prop="plcParamName"
:rules="[{ required: true, message: '参数列名不能为空', trigger: 'blur' }]">
<el-input
:disabled="disabled"
v-model="dataForm.plcParamName"
placeholder="请输入参数列名"
@change="$emit('update', dataForm)"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="报警内容"
prop="alarmContent"
:rules="[{ required: true, message: '报警内容不能为空', trigger: 'blur' }]">
<el-input
:disabled="disabled"
v-model="dataForm.alarmContent"
placeholder="请输入报警内容"
@change="$emit('update', dataForm)"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="报警类型"
prop="type"
:rules="[{ required: true, message: '报警类型不能为空', trigger: 'blur' }]">
<el-select
:disabled="disabled"
v-model="dataForm.type"
placeholder="请选择报警类型"
@change="handleTypeChange">
<el-option
v-for="opt in [
{ label: '布尔型', value: 2 }, { label: '布尔型', value: 2 },
{ label: '字符型', value: 1 }, { label: '字符型', value: 1 },
]" ]" :key="opt.value" :label="opt.label" :value="opt.value" />
:key="opt.value" </el-select>
:label="opt.label" </el-form-item>
:value="opt.value" /> </el-col>
</el-select> </el-row>
</el-form-item> <el-row :gutter="20">
</el-col> <el-col :span="12">
<el-form-item label="报警级别" prop="grade" :rules="[{ required: true, message: '报警级别不能为空', trigger: 'blur' }]">
<el-col :span="12"> <el-select :disabled="disabled" v-model="dataForm.grade" placeholder="请选择报警级别"
<el-form-item @change="$emit('update', dataForm)">
v-if="+dataForm.type == 1" <el-option v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)" :key="opt.value" :label="opt.label"
label="设备报警编码" :value="opt.value" />
prop="alarmCode"> </el-select>
<el-input </el-form-item>
:disabled="disabled" </el-col>
v-model="dataForm.alarmCode" <el-col :span="12">
@change="$emit('update', dataForm)" <el-form-item label="参数列名" prop="plcParamName"
placeholder="请输入设备报警编码" /> :rules="[{ required: true, message: '参数列名不能为空', trigger: 'blur' }]">
</el-form-item> <el-input :disabled="disabled" v-model="dataForm.plcParamName" placeholder="请输入参数列名"
</el-col> @change="$emit('update', dataForm)"></el-input>
</el-row> </el-form-item>
</el-form> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报警内容" prop="alarmContent"
:rules="[{ required: true, message: '报警内容不能为空', trigger: 'blur' }]">
<el-input :disabled="disabled" v-model="dataForm.alarmContent" placeholder="请输入报警内容"
@change="$emit('update', dataForm)"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="+dataForm.type == 1" label="设备报警编码" prop="alarmCode">
<el-input :disabled="disabled" v-model="dataForm.alarmCode" @change="$emit('update', dataForm)"
placeholder="请输入设备报警编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template> </template>
<script> <script>

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: zhp
* @LastEditTime: 2024-04-22 15:04:40 * @LastEditTime: 2024-07-31 09:48:36
* @Description: * @Description:
--> -->
<template> <template>
@ -339,7 +339,7 @@ export default {
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
this.$confirm( this.$confirm(
`是否确认删除巡检项目名为"${raw.data.program}"数据项?`, `是否确认删除"${raw.data.program}"数据项?`,
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -361,8 +361,8 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
} else { } else {
this.addNew(raw.data.id); this.addNew(raw.data.id)
} }
}, },
getList() { getList() {
// //
@ -458,13 +458,13 @@ export default {
data: [this.dataForm.id], data: [this.dataForm.id],
}).then(res =>{ }).then(res =>{
if (res.code == 0) { if (res.code == 0) {
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
this.$message.success('已确认'); this.$message.success('已确认');
} }
}) })
}).catch(() => { }).catch(() => {
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
this.$message.success('取消确认'); this.$message.success('取消确认');
}) })
@ -487,7 +487,7 @@ export default {
status: 1 status: 1
}).then(response => { }).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
}); });
return; return;

View File

@ -1,61 +1,42 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :width="'35%'" :append-to-body="true" :close-on-click-modal="false" class="dialog">
:visible.sync="visible" <template #title>
:width="'35%'" <slot name="title">
:append-to-body="true" <div class="titleStyle">
:close-on-click-modal="false" {{ !dataForm.id ? '新增' : '编辑' }}
class="dialog"> </div>
<template #title> </slot>
<slot name="title"> </template>
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
ref="dataForm" @keyup.enter.native="dataFormSubmit()">
:model="dataForm" <el-form-item label="设备名称" prop="equipmentId">
:rules="dataRule" <el-select @change="handleChange" v-model="dataForm.equipmentId" filterable clearable placeholder="请选择设备名称"
label-width="100px" style="width: 100%">
@keyup.enter.native="dataFormSubmit()"> <el-option v-for="dict in eqList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item label="设备名称" prop="equipmentId"> </el-select>
<el-select </el-form-item>
v-model="dataForm.equipmentId" <el-form-item label="巡检项目" prop="program">
filterable <el-select v-model="dataForm.program" filterable style="width: 100%" placeholder="请选择巡检项目"
clearable @change="handleDecChange">
placeholder="请选择设备名称" <el-option v-for="dict in programList" :key="dict.id" :label="dict.program" :value="dict.program" />
style="width: 100%"> </el-select>
<el-option </el-form-item>
v-for="dict in eqList" <el-form-item label="默认巡检结果" prop="checkResult">
:key="dict.id" <el-input v-model="dataForm.checkResult" placeholder="请输入默认巡检结果" clearable />
:label="dict.name" </el-form-item>
:value="dict.id" /> </el-form>
</el-select>
</el-form-item>
<el-form-item label="巡检项目" prop="program">
<el-input
v-model="dataForm.program"
placeholder="请输入巡检项目"
clearable />
</el-form-item>
<el-form-item label="巡检结果" prop="checkResult">
<el-input
v-model="dataForm.checkResult"
placeholder="请输入巡检结果"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { createCheckOrderDet, updateCheckOrderDet, getCheckOrderDet } from "@/api/equipment/base/inspection/settings"; import { createCheckOrderDet, updateCheckOrderDet, getCheckOrderDet } from "@/api/equipment/base/inspection/settings";
import { getItemPageData } from "@/api/equipment/base/inspection/items";
import { getEquipmentPage } from '@/api/base/equipment' import { getEquipmentPage } from '@/api/base/equipment'
export default { export default {
@ -99,7 +80,32 @@ export default {
special: false special: false
}) })
this.eqList = res.data.list this.eqList = res.data.list
}, },
handleDecChange(val) {
let checkResult = undefined
this.programList.forEach((ele) => {
if (ele.program == val) {
checkResult = ele.checkResult
}
})
this.dataForm.checkResult = checkResult
},
async handleChange(val) {
console.log(val);
let equipmentTypeId = undefined
this.eqList.forEach((ele) => {
if (ele.id == val) {
equipmentTypeId = ele.equipmentTypeId
}
})
const { code, data } = await getItemPageData({
pageNo: 1,
pageSize: 99,
equipmentTypeId: equipmentTypeId,
})
this.programList = data.list
console.log(data);
},
init(id) { init(id) {
this.dataForm.id = id || ''; this.dataForm.id = id || '';
this.visible = true; this.visible = true;

View File

@ -1,63 +1,42 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :width="'30%'" :append-to-body="true" :close-on-click-modal="false" class="dialog">
:visible.sync="visible" <template #title>
:width="'30%'" <slot name="title">
:append-to-body="true" <div class="titleStyle">
:close-on-click-modal="false" {{ !dataForm.id ? '新增' : '编辑' }}
class="dialog"> </div>
<template #title> </slot>
<slot name="title"> </template>
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
ref="dataForm" @keyup.enter.native="dataFormSubmit()">
:model="dataForm" <el-form-item label="设备名称" prop="equipmentId">
:rules="dataRule" <el-select @change="handleChange" v-model="dataForm.equipmentId" filterable clearable placeholder="请选择设备名称" style="width: 100%">
label-width="90px" <el-option v-for="dict in equipmentOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
@keyup.enter.native="dataFormSubmit()"> </el-select>
<el-form-item label="设备名称" prop="equipmentId"> </el-form-item>
<el-select <el-form-item label="巡检项目" prop="program">
v-model="dataForm.equipmentId" <el-select v-model="dataForm.program" filterable style="width: 100%" placeholder="请选择巡检项目"
filterable @change="handleDecChange">
clearable <el-option v-for="dict in programList" :key="dict.id" :label="dict.program" :value="dict.program" />
placeholder="请选择设备名称" </el-select>
style="width: 100%"> </el-form-item>
<el-option <el-form-item label="默认巡检结果" prop="checkResult">
v-for="dict in equipmentOptions" <el-input v-model="dataForm.checkResult" placeholder="请输入默认巡检结果" clearable />
:key="dict.id" </el-form-item>
:label="dict.name" </el-form>
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="巡检项目" prop="program">
<el-input
v-model="dataForm.program"
placeholder="请输入巡检项目"
clearable />
</el-form-item>
<el-form-item label="巡检结果" prop="checkResult">
<el-input
v-model="dataForm.checkResult"
placeholder="请输入巡检结果"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getCheckOrderDet, createCheckOrderDet, updateCheckOrderDet } from "@/api/equipment/base/inspection/settings"; import { getCheckOrderDet, createCheckOrderDet, updateCheckOrderDet } from "@/api/equipment/base/inspection/settings";
import { getEquipmentPage } from '@/api/base/equipment' import { getEquipmentPage } from '@/api/base/equipment'
import { getItemPageData } from "@/api/equipment/base/inspection/items";
export default { export default {
props: { props: {
orderId: { orderId: {
@ -74,7 +53,8 @@ export default {
program: null, program: null,
checkResult: null checkResult: null
}, },
equipmentOptions: [], equipmentOptions: [],
programList:[],
dataRule: { dataRule: {
equipmentId: [ equipmentId: [
{ required: true, message: '设备不能为空', trigger: 'blur' } { required: true, message: '设备不能为空', trigger: 'blur' }
@ -99,7 +79,32 @@ export default {
special: false special: false
}) })
this.equipmentOptions = res.data.list this.equipmentOptions = res.data.list
}, },
handleDecChange(val) {
let checkResult = undefined
this.programList.forEach((ele) => {
if (ele.program == val) {
checkResult = ele.checkResult
}
})
this.dataForm.checkResult = checkResult
},
async handleChange(val) {
console.log(val);
let equipmentTypeId = undefined
this.equipmentOptions.forEach((ele) => {
if (ele.id == val) {
equipmentTypeId = ele.equipmentTypeId
}
})
const { code, data } = await getItemPageData({
pageNo: 1,
pageSize: 99,
equipmentTypeId: equipmentTypeId,
})
this.programList = data.list
console.log(data);
},
init(id) { init(id) {
this.dataForm.id = id || ''; this.dataForm.id = id || '';
this.visible = true; this.visible = true;

View File

@ -1,8 +1,8 @@
<!-- <!--
filename: PlanConfig--addContent.vue filename: PlanConfig--addContent.vue
author: liubin author: liubin
date: 2024-02-04 09:40:04 date: 2024-02-04 09:40:04
description: description:
--> -->
<template> <template>

View File

@ -1,4 +1,4 @@
<!-- <!--
filename: dialogForm.vue filename: dialogForm.vue
author: liubin author: liubin
date: 2023-08-15 10:32:36 date: 2023-08-15 10:32:36
@ -152,7 +152,7 @@
label="实际保养人员" label="实际保养人员"
prop="maintainWorker" prop="maintainWorker"
:rules="[ :rules="[
{ required: true, message: '请选择实际保养人员', trigger: 'blur' }, { required: false, message: '请选择实际保养人员', trigger: 'blur' },
]"> ]">
<el-select <el-select
v-model="form.maintainWorker" v-model="form.maintainWorker"

View File

@ -1,8 +1,8 @@
<!-- <!--
filename: WaitingListUnplanned--edit.vue filename: WaitingListUnplanned--edit.vue
author: liubin author: liubin
date: 2023-08-22 14:38:56 date: 2023-08-22 14:38:56
description: description:
--> -->
<template> <template>
@ -171,7 +171,7 @@
prop="maintainWorker" prop="maintainWorker"
:rules="[ :rules="[
{ {
required: true, required: false,
message: '请选择实际保养人员', message: '请选择实际保养人员',
trigger: 'blur', trigger: 'blur',
}, },

View File

@ -1,272 +1,192 @@
<!-- <!--
filename: WaitingListUnplanned--edit.vue filename: WaitingListUnplanned--edit.vue
author: liubin author: liubin
date: 2023-08-22 14:38:56 date: 2023-08-22 14:38:56
description: description:
--> -->
<template> <template>
<el-drawer <div>
:visible="visible" <el-drawer :visible="visible" :show-close="false" :wrapper-closable="false" class="drawer" custom-class="mes-drawer"
:show-close="false" size="60%" @closed="$emit('destroy')">
:wrapper-closable="false" <SmallTitle slot="title">{{ showTable ? '编辑' : '新增' }}</SmallTitle>
class="drawer"
custom-class="mes-drawer"
size="60%"
@closed="$emit('destroy')">
<SmallTitle slot="title">{{ showTable ? '编辑' : '新增' }}</SmallTitle>
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
<div class="form-part" style="margin-bottom: 32px"> <div class="form-part" style="margin-bottom: 32px">
<!-- <el-skeleton v-if="!showForm" animated /> --> <!-- <el-skeleton v-if="!showForm" animated /> -->
<el-form <el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
class="equipment-info-form" v-loading="formLoading">
ref="form" <el-row :gutter="20">
:model="form" <el-col :span="8">
label-width="200px" <el-form-item label="保养计划单号" prop="maintainOrderNumber" :rules="[
label-position="top" {
v-loading="formLoading"> required: true,
<el-row :gutter="20"> message: '请输入保养计划单号',
<el-col :span="8"> trigger: 'blur',
<el-form-item },
label="保养计划单号" ]">
prop="maintainOrderNumber" <el-input v-model="form.maintainOrderNumber" :placeholder="`请输入保养计划单号`" />
:rules="[ </el-form-item>
{ </el-col>
required: true,
message: '请输入保养计划单号',
trigger: 'blur',
},
]">
<el-input
v-model="form.maintainOrderNumber"
:placeholder="`请输入保养计划单号`" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养计划名称" prop="name"> <el-form-item label="保养计划名称" prop="name">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="部门" prop="departmentId" :rules="[
label="部门" { required: true, message: '请选择部门', trigger: 'blur' },
prop="departmentId" ]">
:rules="[ <el-select v-model="form.departmentId" :placeholder="`请选择部门`" clearable filterable>
{ required: true, message: '请选择部门', trigger: 'blur' }, <el-option v-for="opt in departmentOptions" :key="opt.value" :label="opt.label"
]"> :value="opt.value" />
<el-select </el-select>
v-model="form.departmentId" </el-form-item>
:placeholder="`请选择部门`" </el-col>
clearable
filterable>
<el-option
v-for="opt in departmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="产线" prop="lineId" :rules="[
label="产线" { required: true, message: '请选择产线', trigger: 'blur' },
prop="lineId" ]">
:rules="[ <el-select v-model="form.lineId" :placeholder="`请选择产线`" clearable filterable>
{ required: true, message: '请选择产线', trigger: 'blur' }, <el-option v-for="opt in lineOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
]"> </el-select>
<el-select </el-form-item>
v-model="form.lineId" </el-col>
:placeholder="`请选择产线`"
clearable
filterable>
<el-option
v-for="opt in lineOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer"> <el-form-item label="计划保养人员" prop="maintainer">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="计划开始时间" prop="planStartTime"> <el-form-item label="计划开始时间" prop="planStartTime">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="计划结束时间" prop="planEndTime"> <el-form-item label="计划结束时间" prop="planEndTime">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="实际开始时间" prop="startTime" :rules="[
label="实际开始时间" {
prop="startTime" required: true,
:rules="[ message: '请选择实际开始时间',
{ trigger: 'blur',
required: true, },
message: '请选择实际开始时间', ]">
trigger: 'blur', <el-date-picker v-model="form.startTime" type="datetime" placeholder="请选择实际开始时间"
}, value-format="timestamp"></el-date-picker>
]"> </el-form-item>
<el-date-picker </el-col>
v-model="form.startTime"
type="datetime"
placeholder="请选择实际开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="实际结束时间" prop="endTime" :rules="[
label="实际结束时间" {
prop="endTime" required: true,
:rules="[ message: '请选择实际结束时间',
{ trigger: 'blur',
required: true, },
message: '请选择实际结束时间', ]">
trigger: 'blur', <el-date-picker v-model="form.endTime" type="datetime" placeholder="请选择实际结束时间"
}, value-format="timestamp"></el-date-picker>
]"> </el-form-item>
<el-date-picker </el-col>
v-model="form.endTime"
type="datetime"
placeholder="请选择实际结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
label="实际保养人员" {
prop="maintainWorker" required: false,
:rules="[ message: '请选择实际保养人员',
{ trigger: 'blur',
required: true, },
message: '请选择实际保养人员', ]">
trigger: 'blur', <el-select v-model="form.maintainWorker" :placeholder="`请选择实际保养人员`" multiple clearable filterable>
}, <el-option v-for="opt in maintainerOptions" :key="opt.value" :label="opt.label"
]"> :value="opt.value" />
<el-select </el-select>
v-model="form.maintainWorker" </el-form-item>
:placeholder="`请选择实际保养人员`" </el-col>
multiple
clearable
filterable>
<el-option
v-for="opt in maintainerOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" :placeholder="`请输入备注`" /> <el-input v-model="form.remark" :placeholder="`请输入备注`" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
<div v-if="showTable"> <div v-if="showTable">
<SmallTitle>保养内容</SmallTitle> <SmallTitle>保养内容</SmallTitle>
<div style="margin-top: 12px; position: relative"> <div style="margin-top: 12px; position: relative">
<SearchBar <SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar"
:formConfigs="searchBarFormConfig" @headBtnClick="handleSearchBarBtnClick" />
ref="attr-search-bar" </div>
@headBtnClick="handleSearchBarBtnClick" />
</div>
<div style="margin-top: 12px; position: relative"> <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"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加属性 添加属性
</el-button> </el-button>
</div> </div>
<base-table <base-table v-loading="attrListLoading" :table-props="attrTableProps"
v-loading="attrListLoading" :page="attrQuery?.params.pageNo || 1" :limit="attrQuery?.params.pageSize || 10" :table-data="attrList"
:table-props="attrTableProps" @emitFun="handleEmitFun">
:page="attrQuery?.params.pageNo || 1" <method-btn slot="handleBtn" label="操作" :method-list="tableBtn" @clickBtn="handleTableBtnClick" />
:limit="attrQuery?.params.pageSize || 10" </base-table>
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="attrTotal > 0" :total="attrTotal" :page.sync="attrQuery.params.pageNo"
v-show="attrTotal > 0" :limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" />
:total="attrTotal" </div>
:page.sync="attrQuery.params.pageNo" </div>
:limit.sync="attrQuery.params.pageSize" </div>
@pagination="getAttrList" />
</div>
</div>
</div>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<!-- 新增可确认 --> <!-- 新增可确认 -->
<el-button v-if="isAdd" type="primary" @click="addConfirm">保存</el-button> <el-button v-if="isAdd" type="primary" @click="addConfirm">保存</el-button>
<el-button v-else type="primary" @click="handleConfirm">保存</el-button> <el-button v-else type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 --> <!-- sections的第二项必须是 属性列表 -->
<!-- <el-button <!-- <el-button
v-if="sections[1].allowAdd" v-if="sections[1].allowAdd"
type="primary" type="primary"
@click="handleAddAttr"> @click="handleAddAttr">
添加属性 添加属性
</el-button> --> </el-button> -->
</div> </div>
</div> </div>
<!-- 属性对话框 --> <!-- 属性对话框 -->
<base-dialog <!-- <base-dialog :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="35%" :append-to-body="true"
:dialogTitle="attrTitle" custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm" @confirm="submitAttrForm">
:dialogVisible="attrFormVisible" <DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :rows="attrRows" />
width="35%" </base-dialog> -->
:append-to-body="true" </el-drawer>
custom-class="baseDialog" <attr-add v-if="attrFormVisible" ref="addOrUpdate" :plan-id="form.id" @refreshDataList="getAttrList" />
@close="closeAttrForm" </div>
@cancel="closeAttrForm"
@confirm="submitAttrForm">
<DialogForm
v-if="attrFormVisible"
ref="attrForm"
v-model="attrForm"
:rows="attrRows" />
</base-dialog>
</el-drawer>
</template> </template>
<script> <script>
import DialogForm from '../../../../../components/DialogForm/index.vue'; import DialogForm from '../../../../../components/DialogForm/index.vue';
import attrAdd from './attr-add';
import { deleteLogDet } from '@/api/equipment/base/maintain/logConfig';
const SmallTitle = { const SmallTitle = {
name: 'SmallTitle', name: 'SmallTitle',
props: ['size'], props: ['size'],
components: {}, components: { },
data() { data() {
return {}; return {};
}, },
@ -290,7 +210,7 @@ const SmallTitle = {
}; };
export default { export default {
components: { SmallTitle, DialogForm }, components: { SmallTitle, DialogForm, attrAdd },
props: ['dataId'], // dataId id props: ['dataId'], // dataId id
data() { data() {
return { return {
@ -334,7 +254,7 @@ export default {
select: true, select: true,
label: '设备名称', label: '设备名称',
prop: 'equipmentId', prop: 'equipmentId',
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false', url: 'base/core-equipment/listAll',
bind: { clearable: true, filterable: true }, bind: { clearable: true, filterable: true },
// method: 'post', // method: 'post',
// queryParams: { // queryParams: {
@ -349,8 +269,9 @@ export default {
], ],
[ [
{ {
input: true, select: true,
label: '保养项目', label: '保养项目',
depends:"program",
prop: 'program', prop: 'program',
}, },
], ],
@ -393,7 +314,12 @@ export default {
attrFormSubmitting: false, attrFormSubmitting: false,
attrListLoading: false, attrListLoading: false,
// syncFileListFlag: null, // syncFileListFlag: null,
tableBtn: [], tableBtn: [
{
type: 'delete',
btnName: '删除',
}
].filter((v) => v),
row: {}, row: {},
}; };
}, },
@ -445,9 +371,9 @@ export default {
}, },
handleTableBtnClick({ type, data }) { handleTableBtnClick({ type, data }) {
switch (type) { switch (type) {
case 'edit': // case 'edit':
this.handleEditAttr(data.id); // this.handleEditAttr(data.id);
break; // break;
case 'delete': case 'delete':
this.handleDeleteAttr(data.id); this.handleDeleteAttr(data.id);
break; break;
@ -470,13 +396,13 @@ export default {
data: [this.form.id], data: [this.form.id],
}).then(res =>{ }).then(res =>{
if (res.code == 0) { if (res.code == 0) {
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
this.$message.success('已确认'); this.$message.success('已确认');
} }
}) })
}).catch(() => { }).catch(() => {
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
this.$message.success('取消确认'); this.$message.success('取消确认');
}) })
@ -494,7 +420,7 @@ export default {
this.btnLoading = true; this.btnLoading = true;
// this.$nextTick(async () => { // this.$nextTick(async () => {
// const { code, data } = await this.$axios({ // const { code, data } = await this.$axios({
// url: '/base/equipment-maintain-log/update', // url: '/base/equipment-maintain-log/update',
// method: 'put', // method: 'put',
// data: { // data: {
// ...this.form, // ...this.form,
@ -515,7 +441,7 @@ export default {
// //
if (this.form.id != null) { if (this.form.id != null) {
this.$axios({ this.$axios({
url: '/base/equipment-maintain-log/update', url: '/base/equipment-maintain-log/update',
method: 'put', method: 'put',
data: { data: {
...this.form, ...this.form,
@ -534,7 +460,7 @@ export default {
// //
this.$axios({ this.$axios({
url: '/base/equipment-maintain-log/create', url: '/base/equipment-maintain-log/create',
method: 'post', method: 'post',
data: { data: {
...this.form, ...this.form,
@ -650,51 +576,58 @@ export default {
this.visible = false; this.visible = false;
}, },
resetAttrform() { // resetAttrform() {
this.attrForm = { // this.attrForm = {
id: null, // id: null,
logId: this.row.id, // logId: this.row.id,
maintenanceDes: '', // maintenanceDes: '',
program: null, // program: null,
remark: null, // remark: null,
}; // };
}, // },
// //
handleAddAttr() { handleAddAttr() {
if (!this.row.id) return this.$message.error('请先选中保养记录'); if (!this.row.id) return this.$message.error('请先选中保养记录');
this.resetAttrform(); // this.resetAttrform();
this.attrTitle = '添加设备属性'; this.attrTitle = '添加设备属性';
this.attrFormVisible = true; this.attrFormVisible = true;
let obj = {
id: undefined,
logId: this.form.id
}
this.$nextTick(() => {
this.$refs.addOrUpdate.init(obj)
})
}, },
// //
async handleEditAttr(attrId) { // async handleEditAttr(attrId) {
const res = await this.$axios({ // const res = await this.$axios({
url: '/base/equipment-maintain-log-det/get', // url: '/base/equipment-maintain-log-det/get',
method: 'get', // method: 'get',
params: { id: attrId }, // params: { id: attrId },
}); // });
if (res.code == 0) { // if (res.code == 0) {
this.attrForm = res.data; // this.attrForm = res.data;
this.attrTitle = '编辑设备属性'; // this.attrTitle = '';
this.attrFormVisible = true; // this.attrFormVisible = true;
} // }
}, // },
// //
handleDeleteAttr(attrId) { handleDeleteAttr(id) {
console.log(11111);
this.$confirm('确定删除该属性?', '提示', { this.$confirm('确定删除该属性?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
.then(async () => { .then(async () => {
const res = await this.$axios({ const res = await this.$axios({
url: 'url delete', // this.sections[1].urlDelete, url: '/base/equipment-maintain-log-det/delete?id=' + id,
method: 'delete', method: 'delete',
params: { id: attrId }, });
});
if (res.code == 0) { if (res.code == 0) {
this.$message({ this.$message({
message: '删除成功', message: '删除成功',
@ -710,82 +643,6 @@ export default {
}, },
// //
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;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
}, },
}; };
</script> </script>

View File

@ -0,0 +1,186 @@
<!--
* @Author: zhp
* @Date: 2024-07-30 14:55:14
* @LastEditTime: 2024-07-31 09:31:22
* @LastEditors: zhp
* @Description:
-->
<template>
<el-dialog :visible.sync="visible" :width="'35%'" :append-to-body="true" :close-on-click-modal="false" class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="设备名称" prop="equipmentId">
<el-select v-model="dataForm.equipmentId" filterable style="width: 100%" placeholder="请选择设备"
@change="handleChange">
<el-option v-for="dict in eqList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="保养项目" prop="program">
<el-select v-model="dataForm.program" filterable style="width: 100%" placeholder="请选择保养项目"
@change="handleDecChange">
<el-option v-for="dict in programList" :key="dict.id" :label="dict.program" :value="dict.program" />
</el-select>
</el-form-item>
<el-form-item label="默认保养结果" prop="maintenanceDes">
<el-input v-model="dataForm.maintenanceDes" placeholder="请输入默认保养结果" clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import { createLogDet, updateLogDet, getLogDet } from '@/api/equipment/base/maintain/logConfig';
import { getItemPageData } from '@/api/equipment/base/maintain/items';
import { getEquipmentPage } from '@/api/base/equipment'
export default {
props: {
planId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
eqList: [],
programList:[],
dataForm: {
id: undefined,
logId:undefined,
equipmentId: '',
program: '',
maintenanceDes: ''
},
dataRule: {
equipmentId: [{ required: true, message: '设备不能为空', trigger: 'change' }],
program: [{ required: true, message: '保养项目不能为空', trigger: 'blur' }],
maintenanceDes: [{ required: true, message: '保养描述不能为空', trigger: 'blur' }]
},
};
},
created() {
this.getDict()
},
methods: {
async getDict() {
const res = await getEquipmentPage({
pageNo: 1,
pageSize: 100,
special: false
})
this.eqList = res.data.list
},
handleDecChange(val) {
let maintenanceDes =undefined
this.programList.forEach((ele) => {
if (ele.program == val) {
console.log(1111);
maintenanceDes = ele.maintainResult
}
})
this.dataForm.maintenanceDes = maintenanceDes
},
async handleChange(val) {
console.log(val);
let equipmentTypeId = undefined
this.eqList.forEach((ele) => {
if (ele.id == val) {
equipmentTypeId = ele.equipmentTypeId
}
})
const { code, data } = await getItemPageData({
pageNo: 1,
pageSize: 99,
equipmentTypeId: equipmentTypeId,
})
this.programList = data.list
console.log(data);
},
init(obj) {
this.dataForm.id = obj.id || '';
this.dataForm.logId = obj.logId || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getLogDet({
id: this.dataForm.id
}).then((res) => {
const { equipmentId, program, maintenanceDes } = res.data;
this.dataForm.equipmentId = equipmentId;
this.dataForm.program = program;
this.dataForm.maintenanceDes = maintenanceDes;
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateLogDet({
...this.dataForm,
// planId: this.planId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createLogDet({
...this.dataForm,
// planId: this.planId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-07-23 10:11:24 * @LastEditTime: 2024-07-31 14:07:11
* @Description: * @Description:
--> -->
<template> <template>
@ -181,7 +181,8 @@ export default {
getPlanDetPage({ getPlanDetPage({
...this.listQuery, ...this.listQuery,
planId: this.dataForm.id, planId: this.dataForm.id,
}).then((response) => { }).then((response) => {
console.log(response.data);
this.planList = response.data.list; this.planList = response.data.list;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
}); });

View File

@ -1,61 +1,43 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :width="'35%'" :append-to-body="true" :close-on-click-modal="false" class="dialog">
:visible.sync="visible" <template #title>
:width="'35%'" <slot name="title">
:append-to-body="true" <div class="titleStyle">
:close-on-click-modal="false" {{ !dataForm.id ? '新增' : '编辑' }}
class="dialog"> </div>
<template #title> </slot>
<slot name="title"> </template>
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
ref="dataForm" @keyup.enter.native="dataFormSubmit()">
:model="dataForm" <el-form-item label="设备名称" prop="equipmentId">
:rules="dataRule" <el-select v-model="dataForm.equipmentId" filterable style="width: 100%" placeholder="请选择设备"
label-width="100px" @change="handleChange">
@keyup.enter.native="dataFormSubmit()"> <el-option v-for="dict in eqList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-form-item label="设备名称" prop="equipmentId"> </el-select>
<el-select </el-form-item>
v-model="dataForm.equipmentId" <el-form-item label="保养项目" prop="program">
filterable <el-select v-model="dataForm.program" filterable style="width: 100%" placeholder="请选择保养项目"
style="width: 100%" @change="handleDecChange">
placeholder="请选择设备"> <el-option v-for="dict in programList" :key="dict.id" :label="dict.program" :value="dict.program" />
<el-option </el-select>
v-for="dict in eqList" </el-form-item>
:key="dict.id" <el-form-item label="默认保养结果" prop="maintenanceDes">
:label="dict.name" <el-input v-model="dataForm.maintenanceDes" placeholder="请输入默认保养结果" clearable />
:value="dict.id" /> </el-form-item>
</el-select> </el-form>
</el-form-item>
<el-form-item label="保养项目" prop="program">
<el-input
v-model="dataForm.program"
placeholder="请输入保养项目"
clearable />
</el-form-item>
<el-form-item label="保养描述" prop="maintenanceDes">
<el-input
v-model="dataForm.maintenanceDes"
placeholder="请输入保养描述"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig'; import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig';
import { getEquipmentPage } from '@/api/base/equipment' import { getEquipmentPage } from '@/api/base/equipment'
import { getItemPageData } from '@/api/equipment/base/maintain/items';
export default { export default {
props: { props: {
@ -73,7 +55,8 @@ export default {
equipmentId: '', equipmentId: '',
program: '', program: '',
maintenanceDes: '' maintenanceDes: ''
}, },
programList:[],
dataRule: { dataRule: {
equipmentId: [{ required: true, message: '设备不能为空', trigger: 'change' }], equipmentId: [{ required: true, message: '设备不能为空', trigger: 'change' }],
program: [{ required: true, message: '保养项目不能为空', trigger: 'blur' }], program: [{ required: true, message: '保养项目不能为空', trigger: 'blur' }],
@ -109,7 +92,33 @@ export default {
}); });
} }
}); });
}, },
async handleChange(val) {
console.log(val);
let equipmentTypeId = undefined
this.eqList.forEach((ele) => {
if (ele.id == val) {
equipmentTypeId = ele.equipmentTypeId
}
})
const { code, data } = await getItemPageData({
pageNo: 1,
pageSize: 99,
equipmentTypeId: equipmentTypeId,
})
this.programList = data.list
console.log(data);
},
handleDecChange(val) {
let maintenanceDes = undefined
this.programList.forEach((ele) => {
if (ele.program == val) {
console.log(1111);
maintenanceDes = ele.maintainResult
}
})
this.dataForm.maintenanceDes = maintenanceDes
},
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {

View File

@ -40,7 +40,7 @@ export default {
const t = new Date(); const t = new Date();
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()]; const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
return { return {
searchBarKeys: ['equipmentName', 'createTime'], searchBarKeys: ['equipmentTypeId'],
equipmentTypeList:[], equipmentTypeList:[],
tableBtn: [ tableBtn: [
{ {
@ -77,6 +77,7 @@ export default {
label: '设备类型', label: '设备类型',
placeholder: '请输入设备类型', placeholder: '请输入设备类型',
param: 'equipmentTypeId', param: 'equipmentTypeId',
filterable: true,
}, },
{ {
type: 'button', type: 'button',
@ -114,7 +115,7 @@ export default {
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
equipmentTypeId: null, equipmentTypeId: undefined,
}, },
showDetailVisible:false, showDetailVisible:false,
// //
@ -153,7 +154,9 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
console.log(this.queryParams)
// this.queryParams.pageNo = 1
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */

View File

@ -0,0 +1,105 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-22 10:27:50
* @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="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入客户编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入客户名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="contact">
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="telephone">
<el-input
v-model="dataForm.telephone"
maxlength="11"
placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="地址" prop="address">
<el-input
v-model="dataForm.address"
placeholder="请输入地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCustomer, updateCustomer, getCustomer, getCode } from "@/api/base/coreCustomer";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCustomer,
updateURL: updateCustomer,
infoURL: getCustomer
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
telephone: undefined,
contact: undefined,
address: undefined,
remark: undefined
},
dataRule: {
code: [{ required: true, message: "客户编号不能为空", trigger: "blur" }],
name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
callback(new Error("手机号格式错误"));
} else {
callback();
}
} else {
callback();
}
}, trigger: "blur"
}
]
}
};
},
mounted() {},
methods: {}
};
</script>

View File

@ -0,0 +1,176 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCustomerPage,
deleteCustomer
} from '@/api/base/coreCustomer';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '客户名称'
},
{
prop: 'code',
label: '客户编码'
},
{
prop: 'contact',
label: '联系人'
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCustomerPage,
deleteURL: deleteCustomer
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-customer:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-customer:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '客户名称',
placeholder: '客户名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-customer:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,130 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-22 10:27:43
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="供应商编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入供应商编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入供应商名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="contact">
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="telephone">
<el-input
v-model="dataForm.telephone"
maxlength="11"
placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="地址" prop="address">
<el-input
v-model="dataForm.address"
placeholder="请输入地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreSupplier, updateCoreSupplier, getCoreSupplier, getCode } from "@/api/base/coreSupplier";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreSupplier,
updateURL: updateCoreSupplier,
infoURL: getCoreSupplier
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
telephone: undefined,
contact: undefined,
address: undefined,
remark: undefined
},
dataRule: {
code: [{ required: true, message: "供应商编号不能为空", trigger: "blur" }],
name: [{ required: true, message: "供应商名称不能为空", trigger: "blur" }],
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
callback(new Error("手机号格式错误"));
} else {
callback();
}
} else {
callback();
}
}, trigger: "blur"
}
]
}
};
},
mounted() {},
methods: {
//
dataFormSubmit() {
console.log('你好', this.dataForm)
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
//
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");
});
});
},
}
};
</script>

View File

@ -0,0 +1,176 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreSupplierPage,
deleteCoreSupplier
} from '@/api/base/coreSupplier';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '供应商编码'
},
{
prop: 'name',
label: '供应商名称'
},
{
prop: 'contact',
label: '联系人'
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreSupplierPage,
deleteURL: deleteCoreSupplier
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-supplier:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-supplier:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '供应商',
placeholder: '供应商名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-supplier:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

Some files were not shown because too many files have changed in this diff Show More