设备
This commit is contained in:
commit
0029af4ffa
8
.env.dev
8
.env.dev
@ -1,7 +1,7 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2024-07-22 16:34:50
|
||||
# @LastEditTime: 2024-07-31 14:57:31
|
||||
# @LastEditors: zhp
|
||||
# @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.4.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.4.159:48080'
|
||||
# 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.1.64:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.64:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.1.99:48082'
|
||||
|
||||
|
||||
|
||||
# 积木报表指向地址
|
||||
|
@ -48,7 +48,7 @@
|
||||
"benz-amr-recorder": "^1.1.5",
|
||||
"bpmn-js-token-simulation": "0.10.0",
|
||||
"clipboard": "2.0.8",
|
||||
"code-brick-zj": "^1.0.2",
|
||||
"code-brick-zj": "^1.0.5",
|
||||
"core-js": "^3.26.0",
|
||||
"crypto-js": "^4.0.0",
|
||||
"diagram-js": "^12.3.0",
|
||||
|
72
src/api/base/orderGroup.js
Normal file
72
src/api/base/orderGroup.js
Normal 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
|
||||
})
|
||||
}
|
@ -125,7 +125,7 @@ export function orderAssignmentList(query) {
|
||||
// 获得所有客户列表
|
||||
export function customerList() {
|
||||
return request({
|
||||
url: '/base/core-customer/listAll',
|
||||
url: 'base/core-customer/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -156,3 +156,12 @@ export function orderFinish(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 作废订单
|
||||
export function orderVoid(data) {
|
||||
return request({
|
||||
url: 'base/order/invalid',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
@ -25,3 +25,13 @@ export function exportEqAnalysisExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出设备状态追溯
|
||||
export function exportEfficiencyExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-analysis/export-efficiency',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2024-07-23 13:44:00
|
||||
* @LastEditTime: 2024-07-23 13:44:00
|
||||
* @LastEditTime: 2024-07-31 09:34:17
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -14,7 +14,7 @@
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 删除设备保养记录
|
||||
|
||||
export function deleteData(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check-program/delete?id=' + id,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2024-07-12 15:31:41
|
||||
* @LastEditTime: 2024-07-22 09:33:20
|
||||
* @LastEditTime: 2024-07-30 16:44:47
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -19,7 +19,7 @@ export function getItemPageData(data) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-program/page',
|
||||
method: 'get',
|
||||
data
|
||||
params:data
|
||||
})
|
||||
}
|
||||
|
||||
|
104
src/api/equipment/base/maintain/logConfig.js
Normal file
104
src/api/equipment/base/maintain/logConfig.js
Normal 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'
|
||||
})
|
||||
}
|
@ -38,3 +38,11 @@ export function getInspectionData(query) {
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function getRecordInOneDay(query) {
|
||||
return request({
|
||||
url: '/analysis/record-in-one-day/get',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
BIN
src/assets/images/choicepart/Produce.png
Normal file
BIN
src/assets/images/choicepart/Produce.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
@ -125,11 +125,8 @@ export default {
|
||||
// 取消自动聚焦 start
|
||||
this.Quill?.enable(false);
|
||||
this.$nextTick(() => {
|
||||
this.Quill?.enable(true);
|
||||
this.Quill?.blur();
|
||||
// if (!this.readOnly) {
|
||||
// this.Quill?.enable();
|
||||
// }
|
||||
this.Quill?.enable(true);
|
||||
});
|
||||
// 如果设置了上传地址则自定义图片上传事件
|
||||
if (this.type === 'url') {
|
||||
|
@ -72,8 +72,8 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Order',
|
||||
title: '订单管理',
|
||||
name: 'Produce',
|
||||
title: '生产管理',
|
||||
visible: false,
|
||||
meta: {
|
||||
title: '',
|
||||
@ -197,6 +197,7 @@ export default {
|
||||
methods: {
|
||||
getMsg() {
|
||||
let menuList = this.$store.state.permission.sidebarRouters;
|
||||
console.log('sss', menuList);
|
||||
console.log(menuList);
|
||||
if (menuList.length > 0) {
|
||||
for (let i = 0; i < menuList.length; i++) {
|
||||
|
100
src/views/core/oldBase/lineBindProduct/index.vue
Normal file
100
src/views/core/oldBase/lineBindProduct/index.vue
Normal 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>
|
79
src/views/core/oldBase/lineBindProduct/selectProduct.vue
Normal file
79
src/views/core/oldBase/lineBindProduct/selectProduct.vue
Normal 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>
|
144
src/views/core/oldBase/lineBindProductLog/index.vue
Normal file
144
src/views/core/oldBase/lineBindProductLog/index.vue
Normal 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>
|
448
src/views/core/oldBase/product/add-or-updata.vue
Normal file
448
src/views/core/oldBase/product/add-or-updata.vue
Normal 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>
|
139
src/views/core/oldBase/product/attr-add.vue
Normal file
139
src/views/core/oldBase/product/attr-add.vue
Normal 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>
|
200
src/views/core/oldBase/product/index.vue
Normal file
200
src/views/core/oldBase/product/index.vue
Normal 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>
|
228
src/views/core/oldBase/productAttr/index.vue
Normal file
228
src/views/core/oldBase/productAttr/index.vue
Normal 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>
|
153
src/views/core/oldBase/productionLine/add-or-updata.vue
Normal file
153
src/views/core/oldBase/productionLine/add-or-updata.vue
Normal 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>
|
217
src/views/core/oldBase/productionLine/index.vue
Normal file
217
src/views/core/oldBase/productionLine/index.vue
Normal 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>
|
271
src/views/core/oldBase/productionLineRecDay/index.vue
Normal file
271
src/views/core/oldBase/productionLineRecDay/index.vue
Normal 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>
|
271
src/views/core/oldBase/productionLineRecSch/index.vue
Normal file
271
src/views/core/oldBase/productionLineRecSch/index.vue
Normal 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>
|
112
src/views/core/oldBase/workshopSection/add-or-updata.vue
Normal file
112
src/views/core/oldBase/workshopSection/add-or-updata.vue
Normal 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>
|
182
src/views/core/oldBase/workshopSection/index.vue
Normal file
182
src/views/core/oldBase/workshopSection/index.vue
Normal 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>
|
@ -1,218 +1,215 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel">
|
||||
<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc";
|
||||
import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc';
|
||||
// import { publicFormatter } from '@/utils/dict'
|
||||
import EnergyPlcAdd from './components/energyPlcAdd.vue'
|
||||
import EnergyPlcAdd from './components/energyPlcAdd.vue';
|
||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'plcTableName',
|
||||
label: '关联表名'
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '关联表编码',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '标识名'
|
||||
},
|
||||
{
|
||||
prop: 'enName',
|
||||
label: '英文标识名'
|
||||
},
|
||||
{
|
||||
prop: 'collection',
|
||||
label: '是否采集'
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述',
|
||||
showOverflowtooltip: true
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'plcTableName',
|
||||
label: '关联表名',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '关联表编码',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '标识名',
|
||||
},
|
||||
{
|
||||
prop: 'enName',
|
||||
label: '英文标识名',
|
||||
},
|
||||
{
|
||||
prop: 'collection',
|
||||
label: '是否采集',
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "EnergyPlc",
|
||||
components: { EnergyPlcAdd },
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '标识名',
|
||||
placeholder: '标识名',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-plc:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-plc:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
tableH: this.tableHeight(260),
|
||||
collectionList: [
|
||||
{value: 0,label: '否'},
|
||||
{value: 1,label: '是'}
|
||||
],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
addOrEditTitle: "",
|
||||
// 是否显示弹出层
|
||||
centervisible: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.name = val.name
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyPlc.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getEnergyPlcPage(this.queryParams).then(response => {
|
||||
let arr = response.data.list || [];
|
||||
arr&&arr.map(item => {
|
||||
this.collectionList.map(i => {
|
||||
if (item.collection === i.value) {
|
||||
item.collection = i.label
|
||||
}
|
||||
})
|
||||
})
|
||||
this.list = arr
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyPlc.init(val.data.id)
|
||||
})
|
||||
this.centervisible = true
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.energyPlc.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.energyPlc.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function() {
|
||||
return deleteEnergyPlc(row.id);
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
name: 'EnergyPlc',
|
||||
components: { EnergyPlcAdd },
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '标识名',
|
||||
placeholder: '标识名',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-plc:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-plc:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
collectionList: [
|
||||
{ value: 0, label: '否' },
|
||||
{ value: 1, label: '是' },
|
||||
],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
addOrEditTitle: '',
|
||||
// 是否显示弹出层
|
||||
centervisible: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.name = val.name;
|
||||
this.getList();
|
||||
break;
|
||||
default:
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyPlc.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getEnergyPlcPage(this.queryParams).then((response) => {
|
||||
let arr = response.data.list || [];
|
||||
arr &&
|
||||
arr.map((item) => {
|
||||
this.collectionList.map((i) => {
|
||||
if (item.collection === i.value) {
|
||||
item.collection = i.label;
|
||||
}
|
||||
});
|
||||
});
|
||||
this.list = arr;
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyPlc.init(val.data.id);
|
||||
});
|
||||
this.centervisible = true;
|
||||
break;
|
||||
default:
|
||||
this.handleDelete(val.data);
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.energyPlc.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.energyPlc.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.delConfirm(row.name)
|
||||
.then(function () {
|
||||
return deleteEnergyPlc(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -307,7 +307,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除"' + row.sectionName + '"?')
|
||||
.delConfirm(row.buttonId)
|
||||
.then(function () {
|
||||
return deleteQualityInspectionBoxBtn(id);
|
||||
})
|
||||
|
@ -288,7 +288,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除检测信息"' + row.content + '"?')
|
||||
.delConfirm(row.content)
|
||||
.then(function () {
|
||||
return deleteQualityInspectionDet(id);
|
||||
})
|
||||
|
@ -273,7 +273,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除该质量检测类型?')
|
||||
.delConfirm(row.name)
|
||||
.then(function () {
|
||||
return deleteQualityInspectionType(id);
|
||||
})
|
||||
|
159
src/views/devConfig/quality/qualityScrapDet/basic-page.js
Normal file
159
src/views/devConfig/quality/qualityScrapDet/basic-page.js
Normal 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(() => { });
|
||||
}
|
||||
}
|
||||
}
|
@ -40,7 +40,7 @@
|
||||
|
||||
<script>
|
||||
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 {
|
||||
getQualityScrapDetPage,
|
||||
|
159
src/views/devConfig/quality/qualityScrapType/basic-page.js
Normal file
159
src/views/devConfig/quality/qualityScrapType/basic-page.js
Normal 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(() => { });
|
||||
}
|
||||
}
|
||||
}
|
@ -40,7 +40,7 @@
|
||||
|
||||
<script>
|
||||
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 {
|
||||
getQualityScrapTypePage,
|
||||
|
@ -6,106 +6,59 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="dataForm"
|
||||
label-width="100px"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="报警编码"
|
||||
prop="code"
|
||||
:rules="[{ required: true, message: '报警编码不能为空', trigger: 'blur' }]">
|
||||
<el-input
|
||||
: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 [
|
||||
<el-form ref="form" :model="dataForm" label-width="100px" v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报警编码" prop="code" :rules="[{ required: true, message: '报警编码不能为空', trigger: 'blur' }]">
|
||||
<el-input :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="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: 1 },
|
||||
]"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</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>
|
||||
]" :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="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-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-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>
|
||||
|
||||
<script>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-04-22 15:04:40
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-07-31 09:48:36
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -339,7 +339,7 @@ export default {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`是否确认删除巡检项目名为"${raw.data.program}"的数据项?`,
|
||||
`是否确认删除"${raw.data.program}"数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
@ -361,7 +361,7 @@ export default {
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
this.addNew(raw.data.id)
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
|
@ -1,61 +1,42 @@
|
||||
<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-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
|
||||
clearable
|
||||
placeholder="请选择设备名称"
|
||||
style="width: 100%">
|
||||
<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-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-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select @change="handleChange" v-model="dataForm.equipmentId" filterable clearable placeholder="请选择设备名称"
|
||||
style="width: 100%">
|
||||
<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="checkResult">
|
||||
<el-input v-model="dataForm.checkResult" 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>
|
||||
<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 { createCheckOrderDet, updateCheckOrderDet, getCheckOrderDet } from "@/api/equipment/base/inspection/settings";
|
||||
import { getItemPageData } from "@/api/equipment/base/inspection/items";
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
|
||||
export default {
|
||||
@ -99,7 +80,32 @@ export default {
|
||||
special: false
|
||||
})
|
||||
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) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
|
@ -1,63 +1,42 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:width="'30%'"
|
||||
: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-dialog :visible.sync="visible" :width="'30%'" :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="90px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择设备名称"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in equipmentOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
: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-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select @change="handleChange" v-model="dataForm.equipmentId" filterable clearable placeholder="请选择设备名称" style="width: 100%">
|
||||
<el-option v-for="dict in equipmentOptions" :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="checkResult">
|
||||
<el-input v-model="dataForm.checkResult" 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>
|
||||
<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 { getCheckOrderDet, createCheckOrderDet, updateCheckOrderDet } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
|
||||
import { getItemPageData } from "@/api/equipment/base/inspection/items";
|
||||
export default {
|
||||
props: {
|
||||
orderId: {
|
||||
@ -74,7 +53,8 @@ export default {
|
||||
program: null,
|
||||
checkResult: null
|
||||
},
|
||||
equipmentOptions: [],
|
||||
equipmentOptions: [],
|
||||
programList:[],
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' }
|
||||
@ -99,7 +79,32 @@ export default {
|
||||
special: false
|
||||
})
|
||||
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) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
|
@ -152,7 +152,7 @@
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择实际保养人员', trigger: 'blur' },
|
||||
{ required: false, message: '请选择实际保养人员', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.maintainWorker"
|
||||
|
@ -171,7 +171,7 @@
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
required: false,
|
||||
message: '请选择实际保养人员',
|
||||
trigger: 'blur',
|
||||
},
|
||||
|
@ -6,267 +6,187 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">{{ showTable ? '编辑' : '新增' }}</SmallTitle>
|
||||
<div>
|
||||
<el-drawer :visible="visible" :show-close="false" :wrapper-closable="false" 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__content">
|
||||
<div class="form-part" style="margin-bottom: 32px">
|
||||
<!-- <el-skeleton v-if="!showForm" animated /> -->
|
||||
<el-form
|
||||
class="equipment-info-form"
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-width="200px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="保养计划单号"
|
||||
prop="maintainOrderNumber"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入保养计划单号',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.maintainOrderNumber"
|
||||
:placeholder="`请输入保养计划单号`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<div class="form-part" style="margin-bottom: 32px">
|
||||
<!-- <el-skeleton v-if="!showForm" animated /> -->
|
||||
<el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保养计划单号" prop="maintainOrderNumber" :rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入保养计划单号',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.maintainOrderNumber" :placeholder="`请输入保养计划单号`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保养计划名称" prop="name">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保养计划名称" prop="name">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择部门', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
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-form-item label="部门" prop="departmentId" :rules="[
|
||||
{ required: true, message: '请选择部门', trigger: 'blur' },
|
||||
]">
|
||||
<el-select v-model="form.departmentId" :placeholder="`请选择部门`" 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-form-item
|
||||
label="产线"
|
||||
prop="lineId"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择产线', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.lineId"
|
||||
: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-form-item label="产线" prop="lineId" :rules="[
|
||||
{ required: true, message: '请选择产线', trigger: 'blur' },
|
||||
]">
|
||||
<el-select v-model="form.lineId" :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-form-item label="计划保养人员" prop="maintainer">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划保养人员" prop="maintainer">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际开始时间"
|
||||
prop="startTime"
|
||||
:rules="[
|
||||
{
|
||||
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-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际开始时间" prop="startTime" :rules="[
|
||||
{
|
||||
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-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际结束时间"
|
||||
prop="endTime"
|
||||
:rules="[
|
||||
{
|
||||
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-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际结束时间" prop="endTime" :rules="[
|
||||
{
|
||||
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-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{
|
||||
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-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
|
||||
{
|
||||
required: false,
|
||||
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-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" :placeholder="`请输入备注`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" :placeholder="`请输入备注`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div v-if="showTable">
|
||||
<SmallTitle>保养内容</SmallTitle>
|
||||
<div v-if="showTable">
|
||||
<SmallTitle>保养内容</SmallTitle>
|
||||
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="attr-search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
</div>
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<div style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
</el-button>
|
||||
</div>
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="attrTableProps"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="attrList"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<div style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
</el-button>
|
||||
</div>
|
||||
<base-table v-loading="attrListLoading" :table-props="attrTableProps"
|
||||
:page="attrQuery?.params.pageNo || 1" :limit="attrQuery?.params.pageSize || 10" :table-data="attrList"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn slot="handleBtn" label="操作" :method-list="tableBtn" @clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="attrTotal > 0"
|
||||
:total="attrTotal"
|
||||
:page.sync="attrQuery.params.pageNo"
|
||||
:limit.sync="attrQuery.params.pageSize"
|
||||
@pagination="getAttrList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="attrTotal > 0" :total="attrTotal" :page.sync="attrQuery.params.pageNo"
|
||||
:limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<!-- 新增可确认 -->
|
||||
<el-button v-if="isAdd" type="primary" @click="addConfirm">保存</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<!-- 新增可确认 -->
|
||||
<el-button v-if="isAdd" type="primary" @click="addConfirm">保存</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
type="primary"
|
||||
@click="handleAddAttr">
|
||||
添加属性
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog
|
||||
:dialogTitle="attrTitle"
|
||||
:dialogVisible="attrFormVisible"
|
||||
width="35%"
|
||||
:append-to-body="true"
|
||||
custom-class="baseDialog"
|
||||
@close="closeAttrForm"
|
||||
@cancel="closeAttrForm"
|
||||
@confirm="submitAttrForm">
|
||||
<DialogForm
|
||||
v-if="attrFormVisible"
|
||||
ref="attrForm"
|
||||
v-model="attrForm"
|
||||
:rows="attrRows" />
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
<!-- 属性对话框 -->
|
||||
<!-- <base-dialog :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="35%" :append-to-body="true"
|
||||
custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm" @confirm="submitAttrForm">
|
||||
<DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :rows="attrRows" />
|
||||
</base-dialog> -->
|
||||
</el-drawer>
|
||||
<attr-add v-if="attrFormVisible" ref="addOrUpdate" :plan-id="form.id" @refreshDataList="getAttrList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogForm from '../../../../../components/DialogForm/index.vue';
|
||||
import attrAdd from './attr-add';
|
||||
import { deleteLogDet } from '@/api/equipment/base/maintain/logConfig';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
components: { },
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
@ -290,7 +210,7 @@ const SmallTitle = {
|
||||
};
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm },
|
||||
components: { SmallTitle, DialogForm, attrAdd },
|
||||
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
@ -334,7 +254,7 @@ export default {
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
url: 'base/core-equipment/listAll',
|
||||
bind: { clearable: true, filterable: true },
|
||||
// method: 'post',
|
||||
// queryParams: {
|
||||
@ -349,8 +269,9 @@ export default {
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养项目',
|
||||
select: true,
|
||||
label: '保养项目',
|
||||
depends:"program",
|
||||
prop: 'program',
|
||||
},
|
||||
],
|
||||
@ -393,7 +314,12 @@ export default {
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
// syncFileListFlag: null,
|
||||
tableBtn: [],
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
].filter((v) => v),
|
||||
row: {},
|
||||
};
|
||||
},
|
||||
@ -445,9 +371,9 @@ export default {
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleEditAttr(data.id);
|
||||
break;
|
||||
// case 'edit':
|
||||
// this.handleEditAttr(data.id);
|
||||
// break;
|
||||
case 'delete':
|
||||
this.handleDeleteAttr(data.id);
|
||||
break;
|
||||
@ -650,51 +576,58 @@ export default {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
resetAttrform() {
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
logId: this.row.id,
|
||||
maintenanceDes: '',
|
||||
program: null,
|
||||
remark: null,
|
||||
};
|
||||
},
|
||||
// resetAttrform() {
|
||||
// this.attrForm = {
|
||||
// id: null,
|
||||
// logId: this.row.id,
|
||||
// maintenanceDes: '',
|
||||
// program: null,
|
||||
// remark: null,
|
||||
// };
|
||||
// },
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.row.id) return this.$message.error('请先选中保养记录');
|
||||
this.resetAttrform();
|
||||
// this.resetAttrform();
|
||||
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) {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/get',
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑设备属性';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
// async handleEditAttr(attrId) {
|
||||
// const res = await this.$axios({
|
||||
// url: '/base/equipment-maintain-log-det/get',
|
||||
// method: 'get',
|
||||
// params: { id: attrId },
|
||||
// });
|
||||
// if (res.code == 0) {
|
||||
// this.attrForm = res.data;
|
||||
// this.attrTitle = '编辑设备属性';
|
||||
// this.attrFormVisible = true;
|
||||
// }
|
||||
// },
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
handleDeleteAttr(id) {
|
||||
console.log(11111);
|
||||
this.$confirm('确定删除该属性?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios({
|
||||
url: 'url delete', // this.sections[1].urlDelete,
|
||||
method: 'delete',
|
||||
params: { id: attrId },
|
||||
});
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/delete?id=' + id,
|
||||
method: 'delete',
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$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>
|
||||
|
186
src/views/equipment/base/maintain/Confirm/attr-add.vue
Normal file
186
src/views/equipment/base/maintain/Confirm/attr-add.vue
Normal 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>
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-07-23 10:11:24
|
||||
* @LastEditTime: 2024-07-31 14:07:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -181,7 +181,8 @@ export default {
|
||||
getPlanDetPage({
|
||||
...this.listQuery,
|
||||
planId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
}).then((response) => {
|
||||
console.log(response.data);
|
||||
this.planList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
|
@ -1,61 +1,43 @@
|
||||
<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-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="请选择设备">
|
||||
<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-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-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
|
||||
@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>
|
||||
<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 { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig';
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
import { getItemPageData } from '@/api/equipment/base/maintain/items';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -73,7 +55,8 @@ export default {
|
||||
equipmentId: '',
|
||||
program: '',
|
||||
maintenanceDes: ''
|
||||
},
|
||||
},
|
||||
programList:[],
|
||||
dataRule: {
|
||||
equipmentId: [{ required: true, message: '设备不能为空', trigger: 'change' }],
|
||||
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() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
|
@ -40,7 +40,7 @@ export default {
|
||||
const t = new Date();
|
||||
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
|
||||
return {
|
||||
searchBarKeys: ['equipmentName', 'createTime'],
|
||||
searchBarKeys: ['equipmentTypeId'],
|
||||
equipmentTypeList:[],
|
||||
tableBtn: [
|
||||
{
|
||||
@ -77,6 +77,7 @@ export default {
|
||||
label: '设备类型',
|
||||
placeholder: '请输入设备类型',
|
||||
param: 'equipmentTypeId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -114,7 +115,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentTypeId: null,
|
||||
equipmentTypeId: undefined,
|
||||
},
|
||||
showDetailVisible:false,
|
||||
// 表单参数
|
||||
@ -153,7 +154,9 @@ export default {
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.pageNo = 1
|
||||
console.log(this.queryParams)
|
||||
// this.queryParams.pageNo = 1
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
|
105
src/views/oldBase/coreCustomer/add-or-updata.vue
Normal file
105
src/views/oldBase/coreCustomer/add-or-updata.vue
Normal 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>
|
176
src/views/oldBase/coreCustomer/index.vue
Normal file
176
src/views/oldBase/coreCustomer/index.vue
Normal 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>
|
130
src/views/oldBase/coreSupplier/add-or-updata.vue
Normal file
130
src/views/oldBase/coreSupplier/add-or-updata.vue
Normal 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>
|
176
src/views/oldBase/coreSupplier/index.vue
Normal file
176
src/views/oldBase/coreSupplier/index.vue
Normal 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
Loading…
Reference in New Issue
Block a user