Compare commits
11 Commits
projects/m
...
d44c366a19
| Author | SHA1 | Date | |
|---|---|---|---|
| d44c366a19 | |||
| c2defa2da6 | |||
| 6aabe6dd90 | |||
| 506f12d405 | |||
| 587985e3c6 | |||
| b3623d29c5 | |||
| f043a6a0a2 | |||
| 0f70fe85c8 | |||
| 9bcb4d42fa | |||
| c9fe2ba296 | |||
| e28cd67e20 |
6
.env.dev
6
.env.dev
@@ -13,10 +13,10 @@ VUE_APP_TITLE = MES系统
|
|||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.164:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
|
VUE_APP_BASE_API = 'http://192.168.1.81:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
|
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
|
||||||
|
|||||||
@@ -24,4 +24,14 @@ export function exportEqAnalysisExcel(query) {
|
|||||||
params: query,
|
params: query,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出设备状态追溯
|
||||||
|
export function exportEfficiencyExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/analysis/equipment-analysis/export-efficiency',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@@ -38,3 +38,11 @@ export function getInspectionData(query) {
|
|||||||
params: query,
|
params: query,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getRecordInOneDay(query) {
|
||||||
|
return request({
|
||||||
|
url: '/analysis/record-in-one-day/get',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
BIN
src/assets/images/choicepart/Devconfig.png
Normal file
BIN
src/assets/images/choicepart/Devconfig.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.8 KiB |
20
src/mixins/tableHeightMixin.js
Normal file
20
src/mixins/tableHeightMixin.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableH: this.tableHeight(260),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||||
|
window.addEventListener('resize', this._setTableHeight);
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
window.removeEventListener('resize', this._setTableHeight);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
_setTableHeight() {
|
||||||
|
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||||
|
// this.tableH = this.tableHeight(260);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -59,6 +59,33 @@ export default {
|
|||||||
type: "warning",
|
type: "warning",
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 删除确认窗体(UI规范)
|
||||||
|
delConfirm(title) {
|
||||||
|
return MessageBox.confirm("确定删除后不可恢复该数据", `是否确认删除 【${title}】 数据项?`, {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
showClose:false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 关闭页面确认窗体(UI规范)
|
||||||
|
closeConfirm() {
|
||||||
|
return MessageBox.confirm("确定关闭将不保留编辑内容", "是否确认要关闭页面?", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
showClose:false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 确认窗体(UI规范)
|
||||||
|
newConfirm(content,title) {
|
||||||
|
return MessageBox.confirm(content, title, {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
showClose:false
|
||||||
|
})
|
||||||
|
},
|
||||||
// 提交内容
|
// 提交内容
|
||||||
prompt(content) {
|
prompt(content) {
|
||||||
return MessageBox.prompt(content, "系统提示", {
|
return MessageBox.prompt(content, "系统提示", {
|
||||||
|
|||||||
@@ -200,4 +200,35 @@ input, textarea{
|
|||||||
// 弹出框,上下分布,去掉label的padding-bottom
|
// 弹出框,上下分布,去掉label的padding-bottom
|
||||||
.el-form--label-top .el-form-item__label {
|
.el-form--label-top .el-form-item__label {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 确认弹窗(UI样式修改和原样式有区别--start)
|
||||||
|
.el-message-box__status+.el-message-box__message {
|
||||||
|
padding-left: 58px;
|
||||||
|
}
|
||||||
|
.el-message-box {
|
||||||
|
width: auto;
|
||||||
|
min-width: 424px;
|
||||||
|
.el-message-box__header {
|
||||||
|
padding:32px 32px 0px 72px;
|
||||||
|
.el-message-box__title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: rgba(0,0,0,0.85);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-message-box__content {
|
||||||
|
padding-bottom: 24px;
|
||||||
|
.el-message-box__status {
|
||||||
|
top:-72%;
|
||||||
|
left:20px;
|
||||||
|
font-size:21px !important
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-message-box__btns {
|
||||||
|
padding-right: 32px;
|
||||||
|
padding-bottom:14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认弹窗(UI样式修改和原样式有区别--end)
|
||||||
@@ -1,324 +1,349 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="choicepart-container">
|
<div class="choicepart-container">
|
||||||
<navbar />
|
<navbar />
|
||||||
<div class="choicepart-wrapper">
|
<div class="choicepart-wrapper">
|
||||||
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem">
|
<div
|
||||||
<div class="choicepart-line1">
|
class="choicepart-box"
|
||||||
<div
|
id="choicepartBox"
|
||||||
v-for="(item, index) in menuArr1"
|
:style="'transform:scale(' + scale + ');width:1574px;height:538px;'"
|
||||||
:key="index"
|
v-show="showItem">
|
||||||
class="choicepart-item"
|
<div class="choicepart-line1">
|
||||||
@click="handelClick(item, item.choicepart)"
|
<div
|
||||||
:style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
|
v-for="(item, index) in menuArr1"
|
||||||
>
|
:key="index"
|
||||||
<div>
|
class="choicepart-item"
|
||||||
<img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
|
@click="handelClick(item, item.choicepart)"
|
||||||
</div>
|
:style="{
|
||||||
<div class="choicepart-item-title">{{item.meta.title}}</div>
|
opacity: item.visible ? 1 : 0.4,
|
||||||
</div>
|
pointerEvents: item.visible ? 'auto' : 'none',
|
||||||
</div>
|
}">
|
||||||
<div class="choicepart-line2">
|
<div>
|
||||||
<div
|
<img
|
||||||
v-for="(item, index) in menuArr2"
|
:src="
|
||||||
:key="index"
|
require(`../../assets/images/choicepart/${item.name}.png`)
|
||||||
class="choicepart-item"
|
"
|
||||||
@click="handelClick(item, item.choicepart)"
|
alt="" />
|
||||||
:style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
|
</div>
|
||||||
>
|
<div class="choicepart-item-title">{{ item.meta.title }}</div>
|
||||||
<div>
|
</div>
|
||||||
<img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
|
</div>
|
||||||
</div>
|
<div class="choicepart-line2">
|
||||||
<div class="choicepart-item-title">{{item.meta.title}}</div>
|
<div
|
||||||
</div>
|
v-for="(item, index) in menuArr2"
|
||||||
</div>
|
:key="index"
|
||||||
</div>
|
class="choicepart-item"
|
||||||
</div>
|
@click="handelClick(item, item.choicepart)"
|
||||||
<div class="choicepart-footer">© 中建材智能自动化研究院有限公司</div>
|
:style="{
|
||||||
</div>
|
opacity: item.visible ? 1 : 0.4,
|
||||||
|
pointerEvents: item.visible ? 'auto' : 'none',
|
||||||
|
}">
|
||||||
|
<div>
|
||||||
|
<img
|
||||||
|
:src="
|
||||||
|
require(`../../assets/images/choicepart/${item.name}.png`)
|
||||||
|
"
|
||||||
|
alt="" />
|
||||||
|
</div>
|
||||||
|
<div class="choicepart-item-title">{{ item.meta.title }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="choicepart-footer">© 中建材智能自动化研究院有限公司</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Navbar from './components/Navbar'
|
import Navbar from './components/Navbar';
|
||||||
import { debounce } from '@/utils/debounce'
|
import { debounce } from '@/utils/debounce';
|
||||||
export default {
|
export default {
|
||||||
components: { Navbar },
|
components: { Navbar },
|
||||||
name: 'choicePart',
|
name: 'choicePart',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
boxReset: '',
|
boxReset: '',
|
||||||
scale: 1,
|
scale: 1,
|
||||||
menuArr1: [
|
menuArr1: [
|
||||||
{
|
{
|
||||||
name: 'Core',
|
name: 'Core',
|
||||||
title: '基础核心',
|
title: '基础核心',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Order',
|
name: 'Order',
|
||||||
title: '订单管理',
|
title: '订单管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Equipment',
|
name: 'Equipment',
|
||||||
title: '设备管理',
|
title: '设备管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Group',
|
name: 'Group',
|
||||||
title: '班组管理',
|
title: '班组管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Quality',
|
name: 'Quality',
|
||||||
title: '质量管理',
|
title: '质量管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Warehouse',
|
name: 'Warehouse',
|
||||||
title: '仓库管理',
|
title: '仓库管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Energy',
|
name: 'Energy',
|
||||||
title: '能源管理',
|
title: '能源管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
menuArr2: [
|
menuArr2: [
|
||||||
{
|
{
|
||||||
name: 'Packaging',
|
name: 'Packaging',
|
||||||
title: '包装管理',
|
title: '包装管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Material',
|
name: 'Material',
|
||||||
title: '物料管理',
|
title: '物料管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Extend',
|
name: 'Extend',
|
||||||
title: '工艺管理',
|
title: '工艺管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Delivery',
|
name: 'Delivery',
|
||||||
title: '成品发货',
|
title: '成品发货',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Report',
|
name: 'Report',
|
||||||
title: '报表管理',
|
title: '报表管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'System',
|
name: 'System',
|
||||||
title: '系统管理',
|
title: '系统管理',
|
||||||
visible: false,
|
visible: false,
|
||||||
meta: {
|
meta: {
|
||||||
title: ''
|
title: '',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
showItem: false
|
name: 'Devconfig',
|
||||||
}
|
title: '开发配置',
|
||||||
},
|
visible: false,
|
||||||
// computed:{
|
meta: {
|
||||||
// ...mapGetters(['sidebarRouters'])
|
title: '',
|
||||||
// },
|
},
|
||||||
mounted() {
|
},
|
||||||
this.getMsg()
|
],
|
||||||
this.boxReset = debounce(() => {
|
showItem: false,
|
||||||
this.resetSize()
|
};
|
||||||
}, 300)
|
},
|
||||||
this.boxReset()
|
// computed:{
|
||||||
window.addEventListener('resize', () => {
|
// ...mapGetters(['sidebarRouters'])
|
||||||
this.boxReset()
|
// },
|
||||||
})
|
mounted() {
|
||||||
},
|
this.getMsg();
|
||||||
methods: {
|
this.boxReset = debounce(() => {
|
||||||
getMsg() {
|
this.resetSize();
|
||||||
let menuList = this.$store.state.permission.sidebarRouters
|
}, 300);
|
||||||
console.log(menuList)
|
this.boxReset();
|
||||||
if (menuList.length > 0) {
|
window.addEventListener('resize', () => {
|
||||||
for (let i = 0; i < menuList.length; i ++) {
|
this.boxReset();
|
||||||
for (let k = 0; k < 7; k++) {
|
});
|
||||||
if (menuList[i].name === this.menuArr1[k].name) {
|
},
|
||||||
this.menuArr1[k].visible = true
|
methods: {
|
||||||
this.menuArr1[k].id = menuList[i].id
|
getMsg() {
|
||||||
this.menuArr1[k].choicepart = i
|
let menuList = this.$store.state.permission.sidebarRouters;
|
||||||
this.menuArr1[k].children = menuList[i].children
|
console.log(menuList);
|
||||||
this.menuArr1[k].meta = menuList[i].meta
|
if (menuList.length > 0) {
|
||||||
}
|
for (let i = 0; i < menuList.length; i++) {
|
||||||
}
|
for (let k = 0; k < 7; k++) {
|
||||||
for (let j = 0; j < 6; j++) {
|
if (menuList[i].name === this.menuArr1[k].name) {
|
||||||
if (menuList[i].name === this.menuArr2[j].name) {
|
this.menuArr1[k].visible = true;
|
||||||
this.menuArr2[j].visible = true
|
this.menuArr1[k].id = menuList[i].id;
|
||||||
this.menuArr2[j].id = menuList[i].id
|
this.menuArr1[k].choicepart = i;
|
||||||
this.menuArr2[j].choicepart = i
|
this.menuArr1[k].children = menuList[i].children;
|
||||||
this.menuArr2[j].children = menuList[i].children
|
this.menuArr1[k].meta = menuList[i].meta;
|
||||||
this.menuArr2[j].meta = menuList[i].meta
|
}
|
||||||
}
|
}
|
||||||
}
|
for (let j = 0; j < 7; j++) {
|
||||||
}
|
if (menuList[i].name === this.menuArr2[j].name) {
|
||||||
}
|
this.menuArr2[j].visible = true;
|
||||||
console.log(this.menuArr1)
|
this.menuArr2[j].id = menuList[i].id;
|
||||||
console.log(this.menuArr2)
|
this.menuArr2[j].choicepart = i;
|
||||||
},
|
this.menuArr2[j].children = menuList[i].children;
|
||||||
handelClick(item, index) {
|
this.menuArr2[j].meta = menuList[i].meta;
|
||||||
// this.$router.push({name: 'SystemUser'})
|
}
|
||||||
this.$store.dispatch('app/setChoicepart', index)
|
}
|
||||||
this.toRouter(item)
|
}
|
||||||
// if (item.meta.unuse) {
|
}
|
||||||
// this.$message.warning(this.$t('暂无数据'))
|
console.log(this.menuArr1);
|
||||||
// } else {
|
console.log(this.menuArr2);
|
||||||
// this.toRouter(item)
|
},
|
||||||
// }
|
handelClick(item, index) {
|
||||||
},
|
// this.$router.push({name: 'SystemUser'})
|
||||||
toRouter(item) {
|
this.$store.dispatch('app/setChoicepart', index);
|
||||||
console.log(item)
|
this.toRouter(item);
|
||||||
if (item.children) {
|
// if (item.meta.unuse) {
|
||||||
this.toRouter(item.children[0])
|
// this.$message.warning(this.$t('暂无数据'))
|
||||||
} else {
|
// } else {
|
||||||
this.$router.push({ name: item.name })
|
// this.toRouter(item)
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
resetSize() {
|
toRouter(item) {
|
||||||
let _this = this
|
console.log(item);
|
||||||
_this.showItem = false
|
if (item.children) {
|
||||||
_this.loading = true
|
this.toRouter(item.children[0]);
|
||||||
let choicepartBox = document.querySelector('#choicepartBox')
|
} else {
|
||||||
let rw = parseFloat(window.innerWidth)
|
this.$router.push({ name: item.name });
|
||||||
let rh = parseFloat(window.innerHeight)
|
}
|
||||||
let bw = parseFloat(choicepartBox.style.width)
|
},
|
||||||
let bh = parseFloat(choicepartBox.style.height)
|
resetSize() {
|
||||||
let wx = 0.82/(bw / rw)
|
let _this = this;
|
||||||
let hx = 0.56/(bh / rh)
|
_this.showItem = false;
|
||||||
_this.scale = wx > hx ? hx : wx
|
_this.loading = true;
|
||||||
setTimeout(_this.showItemFun, 700)
|
let choicepartBox = document.querySelector('#choicepartBox');
|
||||||
},
|
let rw = parseFloat(window.innerWidth);
|
||||||
showItemFun() {
|
let rh = parseFloat(window.innerHeight);
|
||||||
this.loading = false
|
let bw = parseFloat(choicepartBox.style.width);
|
||||||
this.showItem = true
|
let bh = parseFloat(choicepartBox.style.height);
|
||||||
}
|
let wx = 0.82 / (bw / rw);
|
||||||
},
|
let hx = 0.56 / (bh / rh);
|
||||||
beforeDestroy() {
|
_this.scale = wx > hx ? hx : wx;
|
||||||
this.showItem = false
|
setTimeout(_this.showItemFun, 700);
|
||||||
}
|
},
|
||||||
}
|
showItemFun() {
|
||||||
|
this.loading = false;
|
||||||
|
this.showItem = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.showItem = false;
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
<style lang="scss" scoped>
|
||||||
.choicepart-container {
|
.choicepart-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: url('../../assets/images/choicepart/choicepart-back.png') repeat;
|
background: url('../../assets/images/choicepart/choicepart-back.png') repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
.choicepart-wrapper {
|
.choicepart-wrapper {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: calc(100vh - 94px);
|
height: calc(100vh - 94px);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.choicepart-box {
|
.choicepart-box {
|
||||||
// transition: all 0.3s linear;
|
// transition: all 0.3s linear;
|
||||||
.choicepart-line1 {
|
.choicepart-line1 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 80px;
|
margin-bottom: 80px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
}
|
}
|
||||||
.choicepart-line2 {
|
.choicepart-line2 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.choicepart-item {
|
.choicepart-item {
|
||||||
width: 184px;
|
width: 184px;
|
||||||
height: 224px;
|
height: 224px;
|
||||||
background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat;
|
background: url('../../assets/images/choicepart/choice-item-back.png')
|
||||||
background-size: 100% 100%;
|
no-repeat;
|
||||||
border-radius: 5px;
|
background-size: 100% 100%;
|
||||||
overflow: hidden;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
overflow: hidden;
|
||||||
position: relative;
|
cursor: pointer;
|
||||||
margin: 0 20px;
|
position: relative;
|
||||||
img {
|
margin: 0 20px;
|
||||||
width: 184px;
|
img {
|
||||||
height: 224px;
|
width: 184px;
|
||||||
}
|
height: 224px;
|
||||||
.choicepart-item-title {
|
}
|
||||||
overflow: hidden;
|
.choicepart-item-title {
|
||||||
padding: 0 10px;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
padding: 0 10px;
|
||||||
white-space: nowrap;
|
text-overflow: ellipsis;
|
||||||
position: absolute;
|
white-space: nowrap;
|
||||||
bottom: 0;
|
position: absolute;
|
||||||
left: 2px;
|
bottom: 0;
|
||||||
right: 2px;
|
left: 2px;
|
||||||
text-align: center;
|
right: 2px;
|
||||||
color: #fff;
|
text-align: center;
|
||||||
font-size: 16px;
|
color: #fff;
|
||||||
line-height: 40px;
|
font-size: 16px;
|
||||||
height: 40px;
|
line-height: 40px;
|
||||||
letter-spacing: 2px;
|
height: 40px;
|
||||||
background-color: rgba($color: #0b58ff, $alpha: 0.45);
|
letter-spacing: 2px;
|
||||||
}
|
background-color: rgba($color: #0b58ff, $alpha: 0.45);
|
||||||
}
|
}
|
||||||
.choicepart-item:hover {
|
}
|
||||||
.choicepart-item-title {
|
.choicepart-item:hover {
|
||||||
background-color: rgba($color: #0b58ff, $alpha: 1);
|
.choicepart-item-title {
|
||||||
}
|
background-color: rgba($color: #0b58ff, $alpha: 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.choicepart-footer {
|
}
|
||||||
position: absolute;
|
.choicepart-footer {
|
||||||
width: 100%;
|
position: absolute;
|
||||||
color: #C7C7C7;
|
width: 100%;
|
||||||
user-select: none;
|
color: #c7c7c7;
|
||||||
font-size: 12px;
|
user-select: none;
|
||||||
letter-spacing: 1px;
|
font-size: 12px;
|
||||||
height: 30px;
|
letter-spacing: 1px;
|
||||||
display: grid;
|
height: 30px;
|
||||||
place-content: center;
|
display: grid;
|
||||||
bottom: 0;
|
place-content: center;
|
||||||
opacity: 0.5;
|
bottom: 0;
|
||||||
}
|
opacity: 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
215
src/views/devConfig/energy/energyPlc/index.vue
Normal file
215
src/views/devConfig/energy/energyPlc/index.vue
Normal file
@@ -0,0 +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>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc';
|
||||||
|
// import { publicFormatter } from '@/utils/dict'
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
export default {
|
||||||
|
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>
|
||||||
@@ -6,37 +6,67 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="form" :model="dataForm" label-width="120px" v-loading="formLoading">
|
<el-form
|
||||||
<el-row :gutter="20">
|
ref="form"
|
||||||
<el-col :span="12">
|
:model="dataForm"
|
||||||
<el-form-item label="产线" prop="productionLineId"
|
label-width="110px"
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
v-loading="formLoading">
|
||||||
<el-select v-model="dataForm.productionLineId" placeholder="请选择产线" filterable
|
<el-row :gutter="20">
|
||||||
@change="handleProductlineChange">
|
<el-col :span="12">
|
||||||
<el-option v-for="opt in productionLineList" :key="opt.value" :label="opt.label" :value="opt.value" />
|
<el-form-item
|
||||||
</el-select>
|
label="产线"
|
||||||
</el-form-item>
|
prop="productionLineId"
|
||||||
</el-col>
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
<el-col :span="12">
|
<el-select
|
||||||
<el-form-item label="工段" prop="sectionId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
v-model="dataForm.productionLineId"
|
||||||
<el-select v-model="dataForm.sectionId" placeholder="请选择工段" filterable @change="$emit('update', dataForm)">
|
placeholder="请选择产线"
|
||||||
<el-option v-for="opt in workshopSectionList" :key="opt.value" :label="opt.label" :value="opt.value" />
|
filterable
|
||||||
</el-select>
|
@change="handleProductlineChange">
|
||||||
</el-form-item>
|
<el-option
|
||||||
</el-col>
|
v-for="opt in productionLineList"
|
||||||
|
: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="sectionId"
|
||||||
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.sectionId"
|
||||||
|
placeholder="请选择工段"
|
||||||
|
filterable
|
||||||
|
@change="$emit('update', dataForm)">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in workshopSectionList"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="按钮盒识别码" prop="buttonId" :rules="[
|
<el-form-item
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
label="按钮盒识别码"
|
||||||
{
|
prop="buttonId"
|
||||||
type: 'number',
|
:rules="[
|
||||||
message: '请输入整数',
|
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||||
trigger: 'blur',
|
{
|
||||||
transform: (val) => Number.isInteger(Number(val)) && Number(val),
|
type: 'number',
|
||||||
},
|
message: '请输入整数',
|
||||||
]">
|
trigger: 'blur',
|
||||||
<el-input v-model="dataForm.buttonId" @change="$emit('update', dataForm)" placeholder="请输入整数" />
|
transform: (val) => Number.isInteger(Number(val)) && Number(val),
|
||||||
</el-form-item>
|
},
|
||||||
|
]">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.buttonId"
|
||||||
|
@change="$emit('update', dataForm)"
|
||||||
|
placeholder="请输入整数" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="产线"
|
label="产线"
|
||||||
prop="productionLineId"
|
prop="productionLineId"
|
||||||
@@ -101,35 +131,50 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="按钮值" prop="keyValue" :rules="[
|
<el-form-item
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
label="按钮值"
|
||||||
{
|
prop="keyValue"
|
||||||
type: 'number',
|
:rules="[
|
||||||
message: '请输入100以内的整数',
|
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||||
trigger: 'blur',
|
{
|
||||||
transform: (val) =>
|
type: 'number',
|
||||||
Number.isInteger(+val) &&
|
message: '请输入100以内的整数',
|
||||||
Number(val) >= 0 &&
|
trigger: 'blur',
|
||||||
Number(val) <= 100 &&
|
transform: (val) =>
|
||||||
Number(val),
|
Number.isInteger(+val) &&
|
||||||
},
|
Number(val) >= 0 &&
|
||||||
]">
|
Number(val) <= 100 &&
|
||||||
<el-input v-model="dataForm.keyValue" type="number" min="0" max="100" @change="$emit('update', dataForm)"
|
Number(val),
|
||||||
placeholder="请输入按钮盒模式" />
|
},
|
||||||
</el-form-item>
|
]">
|
||||||
</el-col>
|
<el-input
|
||||||
|
v-model="dataForm.keyValue"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
@change="$emit('update', dataForm)"
|
||||||
|
placeholder="请输入按钮盒模式" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="检测内容" prop="inspectionDetId">
|
<el-form-item label="检测内容" prop="inspectionDetId">
|
||||||
<el-select v-model="dataForm.inspectionDetId" placeholder="请选择检测内容" filterable
|
<el-select
|
||||||
@change="$emit('update', dataForm)">
|
v-model="dataForm.inspectionDetId"
|
||||||
<el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" />
|
placeholder="请选择检测内容"
|
||||||
</el-select>
|
filterable
|
||||||
</el-form-item>
|
@change="$emit('update', dataForm)">
|
||||||
</el-col>
|
<el-option
|
||||||
</el-row>
|
v-for="opt in inspectionDetList"
|
||||||
</el-form>
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -150,14 +195,14 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formLoading: true,
|
formLoading: true,
|
||||||
productionLineList: [],
|
productionLineList: [],
|
||||||
inspectionDetList:[],
|
inspectionDetList: [],
|
||||||
workshopSectionList: [],
|
workshopSectionList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getProductionLineList()
|
this.getProductionLineList();
|
||||||
this.getQualityInspectionDetList()
|
this.getQualityInspectionDetList();
|
||||||
// this.getWorksectionList();
|
// this.getWorksectionList();
|
||||||
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
|
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
|
||||||
// this.formLoading = false;
|
// this.formLoading = false;
|
||||||
@@ -197,20 +242,20 @@ export default {
|
|||||||
}
|
}
|
||||||
this.formLoading = false;
|
this.formLoading = false;
|
||||||
},
|
},
|
||||||
async getQualityInspectionDetList() {
|
async getQualityInspectionDetList() {
|
||||||
this.formLoading = true;
|
this.formLoading = true;
|
||||||
const res = await this.$axios({
|
const res = await this.$axios({
|
||||||
url: '/base/quality-inspection-det/listAll',
|
url: '/base/quality-inspection-det/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.inspectionDetList = res.data.map((item) => ({
|
this.inspectionDetList = res.data.map((item) => ({
|
||||||
label: item.content,
|
label: item.content,
|
||||||
value: item.id,
|
value: item.id,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
this.formLoading = false;
|
this.formLoading = false;
|
||||||
},
|
},
|
||||||
async getWorksectionList(id) {
|
async getWorksectionList(id) {
|
||||||
this.formLoading = true;
|
this.formLoading = true;
|
||||||
const res = await this.$axios({
|
const res = await this.$axios({
|
||||||
@@ -12,12 +12,13 @@
|
|||||||
:page="queryParams.pageNo"
|
:page="queryParams.pageNo"
|
||||||
:limit="queryParams.pageSize"
|
:limit="queryParams.pageSize"
|
||||||
:table-data="list"
|
:table-data="list"
|
||||||
@emitFun="handleEmitFun">
|
@emitFun="handleEmitFun"
|
||||||
|
:max-height="tableH">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
label="操作"
|
label="操作"
|
||||||
:width="120"
|
:width="80"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleTableBtnClick" />
|
@clickBtn="handleTableBtnClick" />
|
||||||
@@ -56,10 +57,11 @@ import {
|
|||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import DialogForm from './dialogForm.vue';
|
import DialogForm from './dialogForm.vue';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'QualityInspectionBoxBtn',
|
name: 'QualityInspectionBoxBtn',
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin, tableHeightMixin],
|
||||||
components: { DialogForm },
|
components: { DialogForm },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -70,7 +72,9 @@ export default {
|
|||||||
label: '产线',
|
label: '产线',
|
||||||
url: '/base/production-line/listAll',
|
url: '/base/production-line/listAll',
|
||||||
prop: 'productionId',
|
prop: 'productionId',
|
||||||
rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
|
{ required: true, message: '产线不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
@@ -80,7 +84,9 @@ export default {
|
|||||||
label: '工段',
|
label: '工段',
|
||||||
url: '/base/workshop-section/listAll',
|
url: '/base/workshop-section/listAll',
|
||||||
prop: 'sectionId',
|
prop: 'sectionId',
|
||||||
rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
|
{ required: true, message: '工段不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
@@ -118,17 +124,17 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
bind: { type: 'number', min: 0, max: 100 },
|
bind: { type: 'number', min: 0, max: 100 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
select: true,
|
select: true,
|
||||||
label: '检测内容',
|
label: '检测内容',
|
||||||
url: '/base/quality-inspection-det/listAll',
|
url: '/base/quality-inspection-det/listAll',
|
||||||
prop: 'inspectionDetId',
|
prop: 'inspectionDetId',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
@@ -180,41 +186,42 @@ export default {
|
|||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productionLineName',
|
prop: 'productionLineName',
|
||||||
label: '产线',
|
label: '产线',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'sectionName',
|
prop: 'sectionName',
|
||||||
label: '工段',
|
label: '工段',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'inspectionDetContent',
|
prop: 'inspectionDetContent',
|
||||||
label: '检测内容',
|
label: '检测内容',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: 160,
|
width: 160,
|
||||||
prop: 'buttonId',
|
prop: 'buttonId',
|
||||||
label: '按钮盒识别码',
|
label: '按钮盒识别码',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// width: 256,
|
width: 90,
|
||||||
// prop: 'productionId',
|
prop: 'keyValue',
|
||||||
// label: '按钮盒所在产线ID',
|
label: '按钮值',
|
||||||
// ,
|
showOverflowtooltip: true,
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// width: 256,
|
width: 128,
|
||||||
// prop: 'sectionId',
|
prop: 'model',
|
||||||
// label: '按钮盒所在工段ID',
|
label: '按钮盒模式',
|
||||||
// ,
|
showOverflowtooltip: true,
|
||||||
// },
|
},
|
||||||
{ width: 90, prop: 'keyValue', label: '按钮值' },
|
|
||||||
{ width: 128, prop: 'model', label: '按钮盒模式' },
|
|
||||||
],
|
],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
inspectionDetContent: null,
|
inspectionDetContent: null,
|
||||||
},
|
},
|
||||||
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
||||||
@@ -222,8 +229,8 @@ export default {
|
|||||||
form: {
|
form: {
|
||||||
id: null,
|
id: null,
|
||||||
buttonId: null,
|
buttonId: null,
|
||||||
inspectionDetId: null,
|
inspectionDetId: null,
|
||||||
productionLineId: null,
|
productionLineId: null,
|
||||||
sectionId: null,
|
sectionId: null,
|
||||||
model: null,
|
model: null,
|
||||||
keyValue: null,
|
keyValue: null,
|
||||||
@@ -261,7 +268,7 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加安灯按钮16键对应';
|
this.title = '新增';
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@@ -270,7 +277,7 @@ export default {
|
|||||||
getQualityInspectionBoxBtn(id).then((response) => {
|
getQualityInspectionBoxBtn(id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改安灯按钮16键对应';
|
this.title = '编辑';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@@ -300,7 +307,7 @@ export default {
|
|||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除"' + row.sectionName + '"?')
|
.delConfirm(row.buttonId)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return deleteQualityInspectionBoxBtn(id);
|
return deleteQualityInspectionBoxBtn(id);
|
||||||
})
|
})
|
||||||
@@ -1,53 +1,93 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
|
<base-table
|
||||||
@emitFun="handleEmitFun">
|
:table-props="tableProps"
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
|
:page="queryParams.pageNo"
|
||||||
@clickBtn="handleTableBtnClick" />
|
:limit="queryParams.pageSize"
|
||||||
</base-table>
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun"
|
||||||
|
:max-height="tableH">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:width="80"
|
||||||
|
fixed="right"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
<pagination
|
||||||
@pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<base-dialog :dialogTitle="title" :dialogVisible="open" width="40%" @close="cancel" @cancel="cancel"
|
<base-dialog
|
||||||
@confirm="submitForm">
|
:dialogTitle="title"
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="[
|
:dialogVisible="open"
|
||||||
[
|
width="40%"
|
||||||
{
|
@close="cancel"
|
||||||
select: true,
|
@cancel="cancel"
|
||||||
label: '检测类型',
|
@confirm="submitForm">
|
||||||
prop: 'typeId',
|
<DialogForm
|
||||||
url: '/base/quality-inspection-type/listAll',
|
v-if="open"
|
||||||
rules: [{ required: true, message: '检测类型不能为空', trigger: 'blur' }],
|
ref="form"
|
||||||
bind: {
|
v-model="form"
|
||||||
filterable: true,
|
:rows="[
|
||||||
},
|
[
|
||||||
},
|
{
|
||||||
{
|
select: true,
|
||||||
input: true,
|
label: '检测类型',
|
||||||
label: '检测内容',
|
prop: 'typeId',
|
||||||
prop: 'content',
|
url: '/base/quality-inspection-type/listAll',
|
||||||
rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
},
|
{
|
||||||
],
|
required: true,
|
||||||
|
message: '检测类型不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
bind: {
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '检测内容',
|
||||||
|
prop: 'content',
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '检测内容不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '内容编码',
|
label: '内容编码',
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
url: '/base/quality-inspection-det/getCode',
|
url: '/base/quality-inspection-det/getCode',
|
||||||
},
|
},
|
||||||
{ input: true, label: '备注', prop: 'remark' }],
|
{ input: true, label: '备注', prop: 'remark' },
|
||||||
]" />
|
],
|
||||||
</base-dialog>
|
]" />
|
||||||
</div>
|
</base-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -63,10 +103,11 @@ import {
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'QualityInspectionDet',
|
name: 'QualityInspectionDet',
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin, tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
typeList: [], // 检测类型列表
|
typeList: [], // 检测类型列表
|
||||||
@@ -141,19 +182,18 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
fixed: true,
|
width: 160,
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
{ prop: 'typeName', label: '类型名称', },
|
{ prop: 'typeName', label: '检测类型', showOverflowtooltip: true },
|
||||||
{ prop: 'content', label: '检测内容', },
|
{ prop: 'content', label: '检测内容', showOverflowtooltip: true },
|
||||||
{ prop: 'code', label: '检测编码', },
|
{ prop: 'code', label: '检测编码', showOverflowtooltip: true },
|
||||||
{ prop: 'remark', label: '备注', },
|
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
|
||||||
],
|
],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
content: null,
|
content: null,
|
||||||
createTime: [],
|
createTime: [],
|
||||||
},
|
},
|
||||||
@@ -248,7 +288,7 @@ export default {
|
|||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除检测信息"' + row.content + '"?')
|
.delConfirm(row.content)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return deleteQualityInspectionDet(id);
|
return deleteQualityInspectionDet(id);
|
||||||
})
|
})
|
||||||
@@ -1,52 +1,78 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
|
<base-table
|
||||||
@emitFun="handleEmitFun">
|
:table-props="tableProps"
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
|
:page="queryParams.pageNo"
|
||||||
@clickBtn="handleTableBtnClick" />
|
:limit="queryParams.pageSize"
|
||||||
</base-table>
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun"
|
||||||
|
:max-height="tableH">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:width="80"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
<pagination
|
||||||
@pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" width="30%" @cancel="cancel"
|
<base-dialog
|
||||||
@confirm="submitForm">
|
:dialogTitle="title"
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="[
|
:dialogVisible="open"
|
||||||
[
|
@close="cancel"
|
||||||
{
|
width="40%"
|
||||||
input: true,
|
@cancel="cancel"
|
||||||
label: '检测类型名称',
|
@confirm="submitForm">
|
||||||
prop: 'name',
|
<DialogForm
|
||||||
rules: [
|
v-if="open"
|
||||||
{
|
ref="form"
|
||||||
required: true,
|
v-model="form"
|
||||||
message: '检测类型名称不能为空',
|
:rows="[
|
||||||
trigger: 'blur',
|
[
|
||||||
},
|
{
|
||||||
],
|
input: true,
|
||||||
// bind: {
|
label: '检测类型',
|
||||||
// disabled: true, // some condition, like detail mode...
|
prop: 'name',
|
||||||
// }
|
rules: [
|
||||||
},
|
{
|
||||||
],
|
required: true,
|
||||||
[
|
message: '检测类型不能为空',
|
||||||
{
|
trigger: 'blur',
|
||||||
input: true,
|
},
|
||||||
label: '检测类型编码',
|
],
|
||||||
prop: 'code',
|
// bind: {
|
||||||
url: '/base/quality-inspection-type/getCode',
|
// disabled: true, // some condition, like detail mode...
|
||||||
},
|
// }
|
||||||
],
|
},
|
||||||
[{ input: true, label: '备注', prop: 'remark' }],
|
],
|
||||||
]" />
|
[
|
||||||
</base-dialog>
|
{
|
||||||
</div>
|
input: true,
|
||||||
|
label: '检测类型编码',
|
||||||
|
prop: 'code',
|
||||||
|
url: '/base/quality-inspection-type/getCode',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[{ input: true, label: '备注', prop: 'remark' }],
|
||||||
|
]" />
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -61,10 +87,11 @@ import {
|
|||||||
exportQualityInspectionTypeExcel,
|
exportQualityInspectionTypeExcel,
|
||||||
} from '@/api/base/qualityInspectionType';
|
} from '@/api/base/qualityInspectionType';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'QualityInspectionType',
|
name: 'QualityInspectionType',
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin, tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
@@ -85,45 +112,12 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
fixed: true,
|
width: 160,
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
{ prop: 'name', label: '检测类型名称' },
|
{ prop: 'name', label: '检测类型', showOverflowtooltip: true },
|
||||||
{ prop: 'code', label: '检测类型编码' },
|
{ prop: 'code', label: '类型编码', showOverflowtooltip: true },
|
||||||
{ prop: 'remark', label: '备注' },
|
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
|
||||||
// {
|
|
||||||
// label: '操作',
|
|
||||||
// alignt: 'center',
|
|
||||||
// subcomponent: {
|
|
||||||
// render: function (h) {
|
|
||||||
// return h('div', null, [
|
|
||||||
// h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: {
|
|
||||||
// icon: 'el-icon-edit',
|
|
||||||
// size: 'mini',
|
|
||||||
// type: 'text',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// ' 修改'
|
|
||||||
// ),
|
|
||||||
// h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: {
|
|
||||||
// icon: 'el-icon-edit',
|
|
||||||
// size: 'mini',
|
|
||||||
// type: 'text',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// ' 修改'
|
|
||||||
// ),
|
|
||||||
// ]);
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
//
|
//
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
@@ -139,11 +133,6 @@ export default {
|
|||||||
name: 'search',
|
name: 'search',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// type: 'button',
|
|
||||||
// btnName: '重置',
|
|
||||||
// name: 'reset',
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
type: 'separate',
|
type: 'separate',
|
||||||
},
|
},
|
||||||
@@ -162,7 +151,7 @@ export default {
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
name: null,
|
name: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
@@ -242,7 +231,7 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加质量检测类型基础';
|
this.title = '新增';
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@@ -251,7 +240,7 @@ export default {
|
|||||||
getQualityInspectionType(id).then((response) => {
|
getQualityInspectionType(id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改质量检测类型基础';
|
this.title = '编辑';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@@ -284,7 +273,7 @@ export default {
|
|||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除该质量检测类型?')
|
.delConfirm(row.name)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return deleteQualityInspectionType(id);
|
return deleteQualityInspectionType(id);
|
||||||
})
|
})
|
||||||
104
src/views/devConfig/quality/qualityScrapDet/add-or-updata.vue
Normal file
104
src/views/devConfig/quality/qualityScrapDet/add-or-updata.vue
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-06 15:15:30
|
||||||
|
* @LastEditTime: 2023-11-20 15:23:59
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="auto">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报废原因编码" prop="code">
|
||||||
|
<el-input v-model="dataForm.code" placeholder="请输入报废原因编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报废原因" prop="content">
|
||||||
|
<el-input v-model="dataForm.content" placeholder="请输入报废原因" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报废类型" prop="typeId">
|
||||||
|
<el-select v-model="dataForm.typeId" placeholder="请选择报废类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in typeList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.remark"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '../../../core/mixins/basic-add';
|
||||||
|
import {
|
||||||
|
createQualityScrapDet,
|
||||||
|
updateQualityScrapDet,
|
||||||
|
getQualityScrapDet,
|
||||||
|
getCode,
|
||||||
|
} from '@/api/base/qualityScrapDet';
|
||||||
|
import { getList } from '@/api/base/qualityScrapType';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
isGetCode: true,
|
||||||
|
codeURL: getCode,
|
||||||
|
createURL: createQualityScrapDet,
|
||||||
|
updateURL: updateQualityScrapDet,
|
||||||
|
infoURL: getQualityScrapDet,
|
||||||
|
},
|
||||||
|
typeList: [],
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
content: undefined,
|
||||||
|
typeId: null,
|
||||||
|
remark: undefined,
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
code: [
|
||||||
|
{ required: true, message: '报废原因编码不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
content: [
|
||||||
|
{ required: true, message: '报废原因不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
typeId: [
|
||||||
|
{ required: true, message: '报废类型不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
// 报废类型
|
||||||
|
const res = await getList();
|
||||||
|
this.typeList = res.data;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
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(() => { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,11 +9,12 @@
|
|||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
:page="listQuery.pageNo"
|
:page="listQuery.pageNo"
|
||||||
:limit="listQuery.pageSize"
|
:limit="listQuery.pageSize"
|
||||||
:table-data="tableData">
|
:table-data="tableData"
|
||||||
|
:max-height="tableH">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
:width="120"
|
:width="80"
|
||||||
label="操作"
|
label="操作"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleClick" />
|
@clickBtn="handleClick" />
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
<pagination
|
<pagination
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:total="listQuery.total"
|
:total="total"
|
||||||
@pagination="getDataList" />
|
@pagination="getDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
@@ -29,7 +30,7 @@
|
|||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
@confirm="handleConfirm"
|
@confirm="handleConfirm"
|
||||||
:before-close="handleCancel"
|
:before-close="handleCancel"
|
||||||
width="30%">
|
width="50%">
|
||||||
<add-or-update
|
<add-or-update
|
||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
@refreshDataList="successSubmit"></add-or-update>
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
@@ -39,77 +40,84 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './add-or-updata';
|
import AddOrUpdate from './add-or-updata';
|
||||||
import basicPage from '../../../core/mixins/basic-page';
|
import basicPage from './basic-page';
|
||||||
import { parseTime } from '../../../core/mixins/code-filter';
|
import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getQualityScrapDetPage,
|
getQualityScrapDetPage,
|
||||||
deleteQualityScrapDet,
|
deleteQualityScrapDet,
|
||||||
} from '@/api/base/qualityScrapDet';
|
} from '@/api/base/qualityScrapDet';
|
||||||
import { getList, } from "@/api/base/qualityScrapType";
|
import { getList } from '@/api/base/qualityScrapType';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
filter: parseTime
|
filter: parseTime,
|
||||||
},
|
width: 160,
|
||||||
{
|
},
|
||||||
prop: 'content',
|
{
|
||||||
label: '报废原因'
|
prop: 'content',
|
||||||
},
|
label: '报废原因',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '报废原因编码'
|
label: '报废原因编码',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'typeName',
|
prop: 'typeName',
|
||||||
label: '报废类型'
|
label: '报废类型',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注'
|
label: '备注',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [basicPage],
|
mixins: [basicPage, tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
getDataListURL: getQualityScrapDetPage,
|
getDataListURL: getQualityScrapDetPage,
|
||||||
deleteURL: deleteQualityScrapDet,
|
deleteURL: deleteQualityScrapDet,
|
||||||
// exportURL: exportFactoryExcel,
|
// exportURL: exportFactoryExcel,
|
||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`base:quality-inspection-det:update`)
|
this.$auth.hasPermi(`base:quality-inspection-det:update`)
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi(`base:quality-inspection-det:delete`)
|
this.$auth.hasPermi(`base:quality-inspection-det:delete`)
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
].filter((v)=>v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: '报废原因',
|
label: '报废原因',
|
||||||
placeholder: '报废原因',
|
placeholder: '报废原因',
|
||||||
param: 'content',
|
param: 'content',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '报废类型',
|
label: '报废类型',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
labelField: 'name',
|
labelField: 'name',
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
param: 'typeId',
|
param: 'typeId',
|
||||||
},
|
filterable: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
btnName: '查询',
|
btnName: '查询',
|
||||||
@@ -120,53 +128,50 @@ export default {
|
|||||||
type: 'separate',
|
type: 'separate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
|
type: this.$auth.hasPermi('base:quality-scrap-det:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
color: 'success',
|
color: 'success',
|
||||||
plain: true
|
plain: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
},
|
},
|
||||||
created() { },
|
created() {},
|
||||||
mounted () {
|
mounted() {
|
||||||
this.getDict();
|
this.getDict();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||||
this.tableData = response.data.list;
|
this.tableData = response.data.list;
|
||||||
this.listQuery.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getDict() {
|
async getDict() {
|
||||||
// 物料列表
|
// 物料列表
|
||||||
const res = await getList();
|
const res = await getList();
|
||||||
this.formConfig[1].selectOptions = res.data;
|
this.formConfig[1].selectOptions = res.data;
|
||||||
},
|
},
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.content = val.content ? val.content : undefined;
|
||||||
this.listQuery.content = val.content ? val.content : undefined;
|
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
||||||
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
case 'reset':
|
|
||||||
this.$refs.searchBarForm.resetForm();
|
|
||||||
this.listQuery = {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 1,
|
|
||||||
};
|
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'add':
|
case 'add':
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-06 15:15:30
|
||||||
|
* @LastEditTime: 2023-11-24 08:42:18
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报废类型编码" prop="code" label-width="120px">
|
||||||
|
<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报废类型" prop="name" label-width="90px">
|
||||||
|
<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item
|
||||||
|
label="报废类型描述"
|
||||||
|
prop="description"
|
||||||
|
label-width="120px">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.description"
|
||||||
|
clearable
|
||||||
|
placeholder="报废类型描述" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark" label-width="90px">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.remark"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '../../../core/mixins/basic-add';
|
||||||
|
import {
|
||||||
|
createQualityScrapType,
|
||||||
|
updateQualityScrapType,
|
||||||
|
getQualityScrapType,
|
||||||
|
getCode,
|
||||||
|
} from '@/api/base/qualityScrapType';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
isGetCode: true,
|
||||||
|
codeURL: getCode,
|
||||||
|
createURL: createQualityScrapType,
|
||||||
|
updateURL: updateQualityScrapType,
|
||||||
|
infoURL: getQualityScrapType,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
description: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
code: [
|
||||||
|
{ required: true, message: '报废类型编码不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '报废类型不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
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(() => { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,11 +9,12 @@
|
|||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
:page="listQuery.pageNo"
|
:page="listQuery.pageNo"
|
||||||
:limit="listQuery.pageSize"
|
:limit="listQuery.pageSize"
|
||||||
:table-data="tableData">
|
:table-data="tableData"
|
||||||
|
:max-height="tableH">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
:width="120"
|
:width="80"
|
||||||
label="操作"
|
label="操作"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleClick" />
|
@clickBtn="handleClick" />
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
<pagination
|
<pagination
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:total="listQuery.total"
|
:total="total"
|
||||||
@pagination="getDataList" />
|
@pagination="getDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
@@ -29,7 +30,7 @@
|
|||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
@confirm="handleConfirm"
|
@confirm="handleConfirm"
|
||||||
:before-close="handleCancel"
|
:before-close="handleCancel"
|
||||||
width="30%">
|
width="50%">
|
||||||
<add-or-update
|
<add-or-update
|
||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
@refreshDataList="successSubmit"></add-or-update>
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
@@ -39,39 +40,45 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './add-or-updata';
|
import AddOrUpdate from './add-or-updata';
|
||||||
import basicPage from '../../../core/mixins/basic-page';
|
import basicPage from './basic-page';
|
||||||
import { parseTime } from '../../../core/mixins/code-filter';
|
import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getQualityScrapTypePage,
|
getQualityScrapTypePage,
|
||||||
deleteQualityScrapType
|
deleteQualityScrapType,
|
||||||
} from '@/api/base/qualityScrapType';
|
} from '@/api/base/qualityScrapType';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
filter: parseTime
|
filter: parseTime,
|
||||||
},
|
width: 160,
|
||||||
{
|
},
|
||||||
prop: 'name',
|
{
|
||||||
label: '报废类型'
|
prop: 'name',
|
||||||
},
|
label: '报废类型',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '报废类型编码'
|
label: '报废类型编码',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'description',
|
prop: 'description',
|
||||||
label: '描述信息'
|
label: '描述信息',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注'
|
label: '备注',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [basicPage],
|
mixins: [basicPage, tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
@@ -81,25 +88,25 @@ export default {
|
|||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`base:quality-scrap-type:update`)
|
this.$auth.hasPermi(`base:quality-scrap-type:update`)
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi(`base:quality-scrap-type:delete`)
|
this.$auth.hasPermi(`base:quality-scrap-type:delete`)
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
].filter((v)=>v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: '报废类型',
|
label: '报废类型',
|
||||||
placeholder: '报废类型',
|
placeholder: '报废类型',
|
||||||
param: 'name',
|
param: 'name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,13 +119,20 @@ export default {
|
|||||||
type: 'separate',
|
type: 'separate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:quality-scrap-type:create') ? 'button' : '',
|
type: this.$auth.hasPermi('base:quality-scrap-type:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
color: 'success',
|
color: 'success',
|
||||||
plain: true
|
plain: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -127,31 +141,21 @@ export default {
|
|||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||||
this.tableData = response.data.list;
|
this.tableData = response.data.list;
|
||||||
this.listQuery.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.name = val.name ? val.name : undefined;
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'reset':
|
|
||||||
this.$refs.searchBarForm.resetForm();
|
|
||||||
this.listQuery = {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 1,
|
|
||||||
};
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
case 'add':
|
case 'add':
|
||||||
this.addOrEditTitle = '新增';
|
this.addOrEditTitle = '新增';
|
||||||
this.addOrUpdateVisible = true;
|
this.addOrUpdateVisible = true;
|
||||||
@@ -1,218 +0,0 @@
|
|||||||
<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>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc";
|
|
||||||
// import { publicFormatter } from '@/utils/dict'
|
|
||||||
import EnergyPlcAdd from './components/energyPlcAdd.vue'
|
|
||||||
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
|
|
||||||
}
|
|
||||||
]
|
|
||||||
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(() => {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-11-06 15:15:30
|
|
||||||
* @LastEditTime: 2023-11-20 15:23:59
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="报废原因编码" prop="code">
|
|
||||||
<el-input v-model="dataForm.code" placeholder="请输入报废原因编码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="报废原因" prop="content">
|
|
||||||
<el-input v-model="dataForm.content" placeholder="请输入报废原因" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="报废类型" prop="typeId">
|
|
||||||
<el-select v-model="dataForm.typeId" placeholder="请选择报废类型">
|
|
||||||
<el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicAdd from '../../../core/mixins/basic-add';
|
|
||||||
import { createQualityScrapDet, updateQualityScrapDet, getQualityScrapDet, getCode } from "@/api/base/qualityScrapDet";
|
|
||||||
import { getList,} from "@/api/base/qualityScrapType";
|
|
||||||
|
|
||||||
// import { getMaterialList } from "@/api/base/material";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicAdd],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
isGetCode: true,
|
|
||||||
codeURL: getCode,
|
|
||||||
createURL: createQualityScrapDet,
|
|
||||||
updateURL: updateQualityScrapDet,
|
|
||||||
infoURL: getQualityScrapDet,
|
|
||||||
},
|
|
||||||
typeList:[],
|
|
||||||
dataForm: {
|
|
||||||
id: undefined,
|
|
||||||
code: undefined,
|
|
||||||
content: undefined,
|
|
||||||
typeId:null,
|
|
||||||
// description: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
},
|
|
||||||
// materialList: [],
|
|
||||||
dataRule: {
|
|
||||||
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
|
||||||
code: [{ required: true, message: "报废原因编码不能为空", trigger: "blur" }],
|
|
||||||
content: [{ required: true, message: "报废原因不能为空", trigger: "blur" }],
|
|
||||||
typeId: [{ required: true, message: "报废类型不能为空", trigger: "change" }],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getDict()
|
|
||||||
console.log('我看看', this.dataForm)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async getDict() {
|
|
||||||
// 物料列表
|
|
||||||
const res = await getList();
|
|
||||||
this.typeList = res.data;
|
|
||||||
},
|
|
||||||
// setMaterialCode() {
|
|
||||||
// const chooseM = this.materialList.filter(item => {
|
|
||||||
// return item.id === this.dataForm.materialId
|
|
||||||
// })
|
|
||||||
// this.dataForm.materialCode = chooseM[0].code
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,209 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-11-06 15:15:30
|
|
||||||
* @LastEditTime: 2023-11-21 14:11:18
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
|
|
||||||
<el-row :gutter="24">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="工单号" prop="workOrderId">
|
|
||||||
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号">
|
|
||||||
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="班组" prop="teamId">
|
|
||||||
<el-select v-model="dataForm.teamId" placeholder="请选择班组">
|
|
||||||
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="数量" prop="num">
|
|
||||||
<el-input v-model="dataForm.num" placeholder="请输入数量" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="产线" prop="lineId">
|
|
||||||
<el-select v-model="dataForm.lineId" placeholder="请选择产线">
|
|
||||||
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="报废原因" prop="detId">
|
|
||||||
<el-select v-model="dataForm.detId" placeholder="请选择报废原因">
|
|
||||||
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="报废时间" prop="logTime">
|
|
||||||
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
placeholder="选择日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="来源" prop="source">
|
|
||||||
<el-select v-model="dataForm.source" placeholder="请选择来源">
|
|
||||||
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="描述" prop="description">
|
|
||||||
<el-input v-model="dataForm.description" placeholder="请输入描述" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="dataForm.remark" placeholder="备注" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicAdd from '../../../core/mixins/basic-add';
|
|
||||||
import {
|
|
||||||
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
|
|
||||||
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
|
|
||||||
import { getList,} from "@/api/base/qualityScrapType";
|
|
||||||
// import { getMaterialList } from "@/api/base/material";
|
|
||||||
import moment from 'moment';
|
|
||||||
export default {
|
|
||||||
mixins: [basicAdd],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
isGetCode: false,
|
|
||||||
// codeURL: getCode,
|
|
||||||
createURL: createQualityScrapLog,
|
|
||||||
updateURL: updateQualityScrapLog,
|
|
||||||
infoURL: getQualityScrapLog,
|
|
||||||
},
|
|
||||||
lineList:[],
|
|
||||||
typeList: [],
|
|
||||||
workOrderList: [],
|
|
||||||
detList:[],
|
|
||||||
teamList: [],
|
|
||||||
sourceList: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '手动',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: '自动',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
dataForm: {
|
|
||||||
id: undefined,
|
|
||||||
logTime: undefined,
|
|
||||||
source:1,
|
|
||||||
detId: undefined,
|
|
||||||
workOrderId: null,
|
|
||||||
teamId: undefined,
|
|
||||||
num: undefined,
|
|
||||||
lineId:undefined,
|
|
||||||
description:undefined,
|
|
||||||
// description: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
},
|
|
||||||
// materialList: [],
|
|
||||||
dataRule: {
|
|
||||||
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
|
||||||
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
|
||||||
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
|
||||||
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
|
||||||
|
|
||||||
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getDict()
|
|
||||||
console.log('我看看', this.dataForm)
|
|
||||||
this.getCurrentTime()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getCurrentTime() {
|
|
||||||
// new Date().Format("yyyy-MM-dd HH:mm:ss")
|
|
||||||
this.dataForm.logTime = new Date()
|
|
||||||
// this.dataForm.logTime = year + "-" + month + "-" + day;
|
|
||||||
console.log(this.dataForm.logTime);
|
|
||||||
},
|
|
||||||
async getDict() {
|
|
||||||
// 物料列表
|
|
||||||
const res = await getList()
|
|
||||||
this.typeList = res.data
|
|
||||||
getWorkOrderList().then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
// console.log(response);
|
|
||||||
this.workOrderList = res.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
getLineList().then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
// console.log(response);
|
|
||||||
this.lineList = res.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
getDetList().then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
// console.log(response);
|
|
||||||
this.detList = res.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.content,
|
|
||||||
id: item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
getTeamList().then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
// console.log(response);
|
|
||||||
this.teamList = res.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// setMaterialCode() {
|
|
||||||
// const chooseM = this.materialList.filter(item => {
|
|
||||||
// return item.id === this.dataForm.materialId
|
|
||||||
// })
|
|
||||||
// this.dataForm.materialCode = chooseM[0].code
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,222 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-11-06 15:15:30
|
|
||||||
* @LastEditTime: 2023-11-07 19:38:13
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-dialog :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
|
|
||||||
<small-title slot="title" :no-padding="true">
|
|
||||||
{{ '详情' }}
|
|
||||||
</small-title>
|
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
|
||||||
label-width="auto">
|
|
||||||
<el-row :gutter="24">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="工单号" prop="workOrderId">
|
|
||||||
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号" disabled>
|
|
||||||
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="班组" prop="teamId">
|
|
||||||
<el-select v-model="dataForm.teamId" placeholder="请选择班组" disabled>
|
|
||||||
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="数量" prop="sum">
|
|
||||||
<el-input v-model="dataForm.sum" placeholder="请输入数量" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="产线" prop="lineId">
|
|
||||||
<el-select v-model="dataForm.lineId" placeholder="请选择产线" disabled>
|
|
||||||
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="报废原因" prop="detId">
|
|
||||||
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" disabled>
|
|
||||||
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="报废时间" prop="logTime">
|
|
||||||
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" disabled
|
|
||||||
placeholder="选择日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="来源" prop="source">
|
|
||||||
<el-select v-model="dataForm.source" placeholder="请选择来源" disabled>
|
|
||||||
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="描述" prop="description">
|
|
||||||
<el-input v-model="dataForm.description" placeholder="请输入描述" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="dataForm.remark" placeholder="备注" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicAdd from '../../../core/mixins/basic-add';
|
|
||||||
import {
|
|
||||||
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
|
|
||||||
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
|
|
||||||
import { getList,} from "@/api/base/qualityScrapType";
|
|
||||||
import SmallTitle from './SmallTitle';
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
SmallTitle,
|
|
||||||
},
|
|
||||||
mixins: [basicAdd],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
isGetCode: false,
|
|
||||||
// codeURL: getCode,
|
|
||||||
createURL: createQualityScrapLog,
|
|
||||||
updateURL: updateQualityScrapLog,
|
|
||||||
infoURL: getQualityScrapLog,
|
|
||||||
},
|
|
||||||
lineList:[],
|
|
||||||
typeList: [],
|
|
||||||
workOrderList: [],
|
|
||||||
detList:[],
|
|
||||||
teamList: [],
|
|
||||||
sourceList: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '手动',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: '自动',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
dialogVisible:false,
|
|
||||||
dataForm: {
|
|
||||||
id: undefined,
|
|
||||||
logTime: undefined,
|
|
||||||
source:1,
|
|
||||||
detId: undefined,
|
|
||||||
workOrderId: null,
|
|
||||||
teamId: undefined,
|
|
||||||
num: undefined,
|
|
||||||
lineId:undefined,
|
|
||||||
description:undefined,
|
|
||||||
// description: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
},
|
|
||||||
// materialList: [],
|
|
||||||
dataRule: {
|
|
||||||
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
|
||||||
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
|
||||||
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
|
||||||
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
|
||||||
|
|
||||||
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// this.getDict()
|
|
||||||
console.log('我看看', this.dataForm)
|
|
||||||
this.getCurrentTime()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
this.dialogVisible = true
|
|
||||||
},
|
|
||||||
getCurrentTime() {
|
|
||||||
// new Date().Format("yyyy-MM-dd HH:mm:ss")
|
|
||||||
this.dataForm.logTime = new Date()
|
|
||||||
// this.dataForm.logTime = year + "-" + month + "-" + day;
|
|
||||||
console.log(this.dataForm.logTime);
|
|
||||||
},
|
|
||||||
// async getDict() {
|
|
||||||
// // 物料列表
|
|
||||||
// const res = await getList()
|
|
||||||
// this.typeList = res.data
|
|
||||||
// getWorkOrderList().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// // console.log(response);
|
|
||||||
// this.workOrderList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getLineList().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// // console.log(response);
|
|
||||||
// this.lineList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getDetList().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// // console.log(response);
|
|
||||||
// this.workOrderList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getTeamList().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// // console.log(response);
|
|
||||||
// this.teamList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// setMaterialCode() {
|
|
||||||
// const chooseM = this.materialList.filter(item => {
|
|
||||||
// return item.id === this.dataForm.materialId
|
|
||||||
// })
|
|
||||||
// this.dataForm.materialCode = chooseM[0].code
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
<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>
|
|
||||||
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import AddOrUpdate from './add-or-updata';
|
|
||||||
import DetailOrUpdate from './detail-or-updata';
|
|
||||||
|
|
||||||
import basicPage from '../../../core/mixins/basic-page';
|
|
||||||
import { parseTime } from '../../../core/mixins/code-filter';
|
|
||||||
import {
|
|
||||||
getQualityScrapLogPage,
|
|
||||||
deleteQualityScrapLog,
|
|
||||||
getWorkOrderList,
|
|
||||||
getTeamList
|
|
||||||
} from '@/api/base/qualityScrapLog';
|
|
||||||
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
filter: parseTime
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'workOrderName',
|
|
||||||
label: '工单'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'teamId',
|
|
||||||
label: '班组'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'detContent',
|
|
||||||
label: '报废原因'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'logTime',
|
|
||||||
label: '报废时间',
|
|
||||||
filter: parseTime
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'num',
|
|
||||||
label: '数量'
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicPage],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
getDataListURL: getQualityScrapLogPage,
|
|
||||||
deleteURL: deleteQualityScrapLog,
|
|
||||||
// exportURL: exportFactoryExcel,
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi(`base:quality-scrap-log:update`)
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi(`base:quality-scrap-log:detail`)
|
|
||||||
? {
|
|
||||||
type: 'detail',
|
|
||||||
btnName: '详情',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi(`base:quality-scrap-log:delete`)
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v)=>v),
|
|
||||||
tableData: [],
|
|
||||||
detailOrUpdateVisible:false,
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '工单',
|
|
||||||
selectOptions: [],
|
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'id',
|
|
||||||
param: 'workOrderId',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '班组',
|
|
||||||
selectOptions: [],
|
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'id',
|
|
||||||
param: 'teamId',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
AddOrUpdate,
|
|
||||||
DetailOrUpdate
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getDict()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
otherMethods(val) {
|
|
||||||
if (val.type === 'detail') {
|
|
||||||
this.detailOrUpdateVisible = true;
|
|
||||||
// this.addOrEditTitle = "详情";
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.detailOrUpdate.init(val.data.id, true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 获取数据列表
|
|
||||||
getDict() {
|
|
||||||
getWorkOrderList().then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
// console.log(response);
|
|
||||||
this.formConfig[0].selectOptions = res.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
getTeamList().then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
// console.log(response);
|
|
||||||
this.formConfig[1].selectOptions = res.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
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.workOrderId = val.workOrderId ? val.workOrderId : undefined;
|
|
||||||
this.listQuery.teamId = val.teamId ? val.teamId : 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>
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-11-06 15:15:30
|
|
||||||
* @LastEditTime: 2023-11-24 08:42:18
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()">
|
|
||||||
<el-row :gutter="24">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="报废类型编码" prop="code">
|
|
||||||
<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="报废类型" prop="name">
|
|
||||||
<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="24">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="描述类型" prop="description">
|
|
||||||
<el-input v-model="dataForm.description" 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-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicAdd from '../../../core/mixins/basic-add';
|
|
||||||
import { createQualityScrapType, updateQualityScrapType, getQualityScrapType, getCode } from "@/api/base/qualityScrapType";
|
|
||||||
// import { getMaterialList } from "@/api/base/material";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicAdd],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
isGetCode: true,
|
|
||||||
codeURL: getCode,
|
|
||||||
createURL: createQualityScrapType,
|
|
||||||
updateURL: updateQualityScrapType,
|
|
||||||
infoURL: getQualityScrapType,
|
|
||||||
},
|
|
||||||
dataForm: {
|
|
||||||
id: undefined,
|
|
||||||
code: undefined,
|
|
||||||
name: undefined,
|
|
||||||
description: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
},
|
|
||||||
// materialList: [],
|
|
||||||
dataRule: {
|
|
||||||
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
|
||||||
code: [{ required: true, message: "报废类型编码不能为空", trigger: "blur" }],
|
|
||||||
name: [{ required: true, message: "报废类型不能为空", trigger: "blur" }],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// this.getDict()
|
|
||||||
console.log('我看看', this.dataForm)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// async getDict() {
|
|
||||||
// // 物料列表
|
|
||||||
// const res = await getMaterialList();
|
|
||||||
// this.materialList = res.data;
|
|
||||||
// },
|
|
||||||
// setMaterialCode() {
|
|
||||||
// const chooseM = this.materialList.filter(item => {
|
|
||||||
// return item.id === this.dataForm.materialId
|
|
||||||
// })
|
|
||||||
// this.dataForm.materialCode = chooseM[0].code
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
128
src/views/quality/currentData/baseChart.vue
Normal file
128
src/views/quality/currentData/baseChart.vue
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:id="'currentDataChart' + chartN"
|
||||||
|
style="width: 100%; height: 300px"></div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import * as echarts from 'echarts';
|
||||||
|
import resize from '@/utils/chartMixins/resize';
|
||||||
|
export default {
|
||||||
|
name: 'BaseChart',
|
||||||
|
mixins: [resize],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
chartDom: '',
|
||||||
|
chart: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
chartData: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lineName: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
chartN: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
chartData: function () {
|
||||||
|
this.getChart();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getChart();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getChart() {
|
||||||
|
if (
|
||||||
|
this.chart !== null &&
|
||||||
|
this.chart !== '' &&
|
||||||
|
this.chart !== undefined
|
||||||
|
) {
|
||||||
|
this.chart.dispose(); // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
||||||
|
}
|
||||||
|
this.chartDom = document.getElementById('currentDataChart' + this.chartN);
|
||||||
|
this.chart = echarts.init(this.chartDom);
|
||||||
|
if (this.chartData.length === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
console.log('chartData:', this.chartData);
|
||||||
|
console.log('lineName:', this.lineName);
|
||||||
|
let xData = this.chartData.map((item) => {
|
||||||
|
return item.inspectionContent;
|
||||||
|
});
|
||||||
|
console.log('xData:', xData);
|
||||||
|
let series = [];
|
||||||
|
this.lineName.map((item) => {
|
||||||
|
let obj = {
|
||||||
|
data: [],
|
||||||
|
type: 'bar',
|
||||||
|
stack: 'a',
|
||||||
|
barWidth: 20,
|
||||||
|
name: item.prop,
|
||||||
|
};
|
||||||
|
this.chartData.forEach((ele) => {
|
||||||
|
obj.data.push(ele[item.prop]);
|
||||||
|
});
|
||||||
|
series.push(obj);
|
||||||
|
});
|
||||||
|
console.log('series:', series);
|
||||||
|
var option = {
|
||||||
|
color: [
|
||||||
|
'#288AFF',
|
||||||
|
'#73DE93',
|
||||||
|
'#FFCE6A',
|
||||||
|
'#63BDFF',
|
||||||
|
'#7164FF',
|
||||||
|
'#FF6860',
|
||||||
|
'#FF9747',
|
||||||
|
'#B0EB42',
|
||||||
|
'#D680FF',
|
||||||
|
'#0043D2',
|
||||||
|
],
|
||||||
|
legend: {
|
||||||
|
itemWidth: 10,
|
||||||
|
itemHeight: 10,
|
||||||
|
textStyle: {
|
||||||
|
color: '#8c8c8c',
|
||||||
|
},
|
||||||
|
right: 0,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: 20,
|
||||||
|
right: 0,
|
||||||
|
bottom: '3%',
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: xData,
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
},
|
||||||
|
series: series,
|
||||||
|
};
|
||||||
|
|
||||||
|
option && this.chart.setOption(option);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
232
src/views/quality/currentData/currentTest.vue
Normal file
232
src/views/quality/currentData/currentTest.vue
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="1"
|
||||||
|
:limit="1000"
|
||||||
|
:table-data="list" />
|
||||||
|
<div class="orderBox" v-for="(item, index) in downList" :key="index">
|
||||||
|
<div class="title">
|
||||||
|
<span>工单:{{ item.workOrderName }}</span>
|
||||||
|
<span>产品名称:{{ item.productionName }}</span>
|
||||||
|
<span>规格:{{ item.productionSize }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="custom-tabs">
|
||||||
|
<el-tabs v-model="item.activeName" :stretch="true">
|
||||||
|
<el-tab-pane :label="'\u2002表格\u2002'" name="table"></el-tab-pane>
|
||||||
|
<el-tab-pane
|
||||||
|
:label="'\u3000图表\u3000'"
|
||||||
|
name="chart"
|
||||||
|
style="overflow: inherit"></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
v-if="item.activeName === 'table'"
|
||||||
|
:table-props="item.tableProps"
|
||||||
|
:page="1"
|
||||||
|
:limit="1000"
|
||||||
|
:table-data="item.list"
|
||||||
|
:height="300" />
|
||||||
|
<baseChart
|
||||||
|
v-else
|
||||||
|
:chartN="index"
|
||||||
|
:chartData="item.list"
|
||||||
|
:lineName="item.downProps" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import BaseChart from './baseChart.vue';
|
||||||
|
import { getInspectionData } from '@/api/monitoring/statisticalData';
|
||||||
|
export default {
|
||||||
|
name: 'CurrentTest',
|
||||||
|
components: { BaseChart },
|
||||||
|
computed: {
|
||||||
|
tableProps() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
prop: 'workOrderName',
|
||||||
|
label: '工单名称',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
...this.dynamicProps,
|
||||||
|
{
|
||||||
|
prop: 'sumInput',
|
||||||
|
label: '上片总数',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sumOutput',
|
||||||
|
label: '下片总数',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dynamicProps: [],
|
||||||
|
list: [],
|
||||||
|
downList: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询列表 */
|
||||||
|
async getList() {
|
||||||
|
const res = await getInspectionData();
|
||||||
|
// const res = {
|
||||||
|
// data: [],
|
||||||
|
// };
|
||||||
|
if (res.data && res.data.length > 0) {
|
||||||
|
this.dynamicProps = this.filterNameData(res.data[0].upPart.nameData);
|
||||||
|
this.list = this.filterData(res.data[0].upPart.data);
|
||||||
|
// 工单明细
|
||||||
|
res.data.forEach((item) => {
|
||||||
|
let downProps = this.filterNameData(item.downPart[0].nameData);
|
||||||
|
console.log('downProps:', downProps);
|
||||||
|
let obj = this.downPartData(item.downPart[0].data, downProps);
|
||||||
|
obj.tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'inspectionContent',
|
||||||
|
label: '检测内容',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sumInput',
|
||||||
|
label: '原片总数',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
...downProps,
|
||||||
|
{
|
||||||
|
prop: 'sumScrap',
|
||||||
|
label: '未通过检测总数',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'scrapRatio',
|
||||||
|
label: '报废比例',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
this.downList.push(obj);
|
||||||
|
});
|
||||||
|
console.log(this.downList);
|
||||||
|
} else {
|
||||||
|
this.list = [];
|
||||||
|
this.dynamicProps = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filterNameData(nameData) {
|
||||||
|
const ndSet = new Set();
|
||||||
|
nameData.forEach((nd) => {
|
||||||
|
ndSet.add(nd.name);
|
||||||
|
});
|
||||||
|
return Array.from(ndSet.values())
|
||||||
|
.sort()
|
||||||
|
.map((name) => ({
|
||||||
|
prop: name,
|
||||||
|
label: name,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
filterData(data) {
|
||||||
|
return data.map((item) => {
|
||||||
|
const { data: innerData } = item;
|
||||||
|
const keyValuePairs = {};
|
||||||
|
console.log('innerData:', innerData);
|
||||||
|
this.dynamicProps.map((item) => {
|
||||||
|
keyValuePairs[item.prop] = '-';
|
||||||
|
});
|
||||||
|
innerData.forEach((d) => {
|
||||||
|
keyValuePairs[d.dynamicName] = d.dynamicValue;
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
inspectionContent: item.inspectionContent,
|
||||||
|
workOrderName: item.workOrderName,
|
||||||
|
...keyValuePairs,
|
||||||
|
sumInput: item.sumInput,
|
||||||
|
sumOutput: item.sumOutput,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
downPartData(data, downProps) {
|
||||||
|
let obj = {
|
||||||
|
workOrderName: '',
|
||||||
|
productionName: '',
|
||||||
|
productionSize: '',
|
||||||
|
activeName: 'table',
|
||||||
|
tableProps: [],
|
||||||
|
downProps: downProps,
|
||||||
|
list: [],
|
||||||
|
};
|
||||||
|
obj.workOrderName = data[0].workOrderName;
|
||||||
|
obj.productionName = data[0].productionName;
|
||||||
|
obj.productionSize = data[0].productionSize;
|
||||||
|
obj.list = data.map((item) => {
|
||||||
|
const { data: innerData } = item;
|
||||||
|
const keyValuePairs = {};
|
||||||
|
downProps.map((item) => {
|
||||||
|
keyValuePairs[item.prop] = '-';
|
||||||
|
});
|
||||||
|
innerData.map((d) => {
|
||||||
|
keyValuePairs[d.dynamicName] = d.dynamicValue;
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
inspectionContent: item.inspectionContent,
|
||||||
|
sumInput: item.sumInput,
|
||||||
|
...keyValuePairs,
|
||||||
|
sumScrap: item.sumScrap,
|
||||||
|
scrapRatio: item.scrapRatio,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.orderBox {
|
||||||
|
padding-top: 16px;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
position: relative;
|
||||||
|
padding: 4px 0;
|
||||||
|
padding-left: 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 6px;
|
||||||
|
height: 16px;
|
||||||
|
width: 4px;
|
||||||
|
border-radius: 1px;
|
||||||
|
background: #0b58ff;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
display: inline-block;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.custom-tabs) {
|
||||||
|
.el-tabs__header {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
transform: translateY(-12px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__content {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__item {
|
||||||
|
padding-left: 0 !important;
|
||||||
|
padding-right: 0 !important;
|
||||||
|
line-height: 36px !important;
|
||||||
|
height: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
86
src/views/quality/currentData/hourData.vue
Normal file
86
src/views/quality/currentData/hourData.vue
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:table-data="list"
|
||||||
|
:max-height="tableH" />
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
import { getRecordInOneDay } from '@/api/monitoring/statisticalData';
|
||||||
|
import moment from 'moment';
|
||||||
|
export default {
|
||||||
|
name: 'HourData',
|
||||||
|
mixins: [tableHeightMixin],
|
||||||
|
computed: {
|
||||||
|
tableProps() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
prop: 'inspectionDetContent',
|
||||||
|
label: '检测内容',
|
||||||
|
},
|
||||||
|
...this.nameData,
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
heightNum: 200,
|
||||||
|
nameData: [],
|
||||||
|
list: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getList() {
|
||||||
|
const res = await getRecordInOneDay();
|
||||||
|
if (res.data) {
|
||||||
|
this.nameData = this.filterNameData(res.data.nameData);
|
||||||
|
this.list = this.filterData(res.data.data);
|
||||||
|
} else {
|
||||||
|
this.nameData = [];
|
||||||
|
this.list = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filterNameData(nameData) {
|
||||||
|
let arr = [];
|
||||||
|
nameData.forEach((ele) => {
|
||||||
|
if (ele.tree === 1) {
|
||||||
|
arr.push({
|
||||||
|
prop: ele.id,
|
||||||
|
label: moment(ele.name).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
nameData.forEach((ele) => {
|
||||||
|
arr.forEach((inner) => {
|
||||||
|
if (ele.parentId === inner.prop) {
|
||||||
|
inner.children = [
|
||||||
|
{
|
||||||
|
prop: ele.parentId + ele.name,
|
||||||
|
label: ele.name,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return arr;
|
||||||
|
},
|
||||||
|
filterData(data) {
|
||||||
|
let list = [];
|
||||||
|
data.forEach((ele) => {
|
||||||
|
let obj = {};
|
||||||
|
obj.inspectionDetContent = ele.inspectionDetContent;
|
||||||
|
ele.data.forEach((inner) => {
|
||||||
|
inner.children.forEach((item) => {
|
||||||
|
obj[item.parentId + item.dynamicName] = item.dynamicValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
list.push(obj);
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
88
src/views/quality/currentData/index.vue
Normal file
88
src/views/quality/currentData/index.vue
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<template>
|
||||||
|
<div class="currentDataContainer">
|
||||||
|
<div class="topBox">
|
||||||
|
<el-menu
|
||||||
|
:default-active="activeName"
|
||||||
|
mode="horizontal"
|
||||||
|
@select="handleSelect">
|
||||||
|
<el-menu-item index="currentTest">当前检测数据</el-menu-item>
|
||||||
|
<el-menu-item index="24hour">24小时检测数据</el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
</div>
|
||||||
|
<div class="bottomBox">
|
||||||
|
<!-- 当前检测数据 -->
|
||||||
|
<div v-if="activeName === 'currentTest'">
|
||||||
|
<CurrentTest />
|
||||||
|
</div>
|
||||||
|
<!-- 24小时检测数据 -->
|
||||||
|
<div v-if="activeName === '24hour'">
|
||||||
|
<HourData />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import CurrentTest from './currentTest.vue';
|
||||||
|
import HourData from './hourData.vue';
|
||||||
|
export default {
|
||||||
|
name: 'currentData',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: 'currentTest',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
CurrentTest,
|
||||||
|
HourData,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSelect(name) {
|
||||||
|
this.activeName = name;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.currentDataContainer {
|
||||||
|
width: 100%;
|
||||||
|
min-height: calc(100vh - 120px - 8px);
|
||||||
|
background: rgba(242, 244, 249, 1);
|
||||||
|
.topBox {
|
||||||
|
.el-menu {
|
||||||
|
background-color: #f2f4f9;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.el-menu.el-menu--horizontal {
|
||||||
|
border-bottom: none;
|
||||||
|
width: 100%;
|
||||||
|
.el-menu-item {
|
||||||
|
height: 48px;
|
||||||
|
line-height: 48px;
|
||||||
|
width: calc((100% / 2) - 4px);
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: rgba(22, 22, 22, 0.65);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
:first-child {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.el-menu-item.is-active {
|
||||||
|
border-width: 4px;
|
||||||
|
color: #161616;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-tabs__active-bar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bottomBox {
|
||||||
|
min-height: calc(100vh - 184px);
|
||||||
|
background: #fff;
|
||||||
|
padding: 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,622 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<!-- 列表 -->
|
|
||||||
<el-row>
|
|
||||||
<el-col class="custom-tabs">
|
|
||||||
<el-tabs v-model="activeName" :stretch="true" @tab-click="handleTabClick">
|
|
||||||
<el-tab-pane :label="'\u2002表格数据\u2002'" name="table">
|
|
||||||
<!-- 列表 -->
|
|
||||||
<div class="blue-title">产品名:{{ productDetail.name }} 产品规格:{{ productDetail.specifications }}</div>
|
|
||||||
<base-table class="base-table__margin" :table-props="productProps" :page="1" :limit="10" :table-data="list">
|
|
||||||
</base-table>
|
|
||||||
<div v-for="(item,index) in downProps" :key="index">
|
|
||||||
<div class="blue-title">工单名称:{{ list[index].workOrderName }}</div>
|
|
||||||
<base-table class="base-table__margin" :table-props="item" :page="1" :limit="10"
|
|
||||||
:table-data="downList[index]">
|
|
||||||
</base-table>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="'\u3000图形数据\u3000'" name="chart" style="overflow: inherit">
|
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
<div id="main" style="height: 500px;width: 1000px;"></div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<!-- <pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" /> -->
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<!-- <base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="50%"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" />
|
|
||||||
</base-dialog> -->
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
getInspectionData,
|
|
||||||
getProductList,
|
|
||||||
getWorkOrderList
|
|
||||||
} from '@/api/monitoring/statisticalData';
|
|
||||||
// import Editor from '@/components/Editor';
|
|
||||||
import moment from 'moment';
|
|
||||||
// import DialogForm from './dialogForm.vue';
|
|
||||||
import * as echarts from 'echarts';
|
|
||||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
export default {
|
|
||||||
name: 'statisticalData',
|
|
||||||
// components: {
|
|
||||||
// DialogForm,
|
|
||||||
// },
|
|
||||||
// mixins: [basicPageMixin],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: [],
|
|
||||||
dynamicProps: [],
|
|
||||||
downProps: [],
|
|
||||||
downList: [],
|
|
||||||
productDetail: {
|
|
||||||
name: null,
|
|
||||||
specifications:null,
|
|
||||||
},
|
|
||||||
activeName: 'table',
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'label',
|
|
||||||
label: '当前检测数据柱状图',
|
|
||||||
// placeholder: '请选择工单号',
|
|
||||||
// param: 'workOrderId',
|
|
||||||
// selectOptions: [],
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'select',
|
|
||||||
// label: '产品',
|
|
||||||
// placeholder: '请选择产品',
|
|
||||||
// param: 'productionId',
|
|
||||||
// selectOptions: [],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'input',
|
|
||||||
// label: '检测内容',
|
|
||||||
// placeholder: '请输入检测内容',
|
|
||||||
// param: 'inspectionDetContent',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'datePicker',
|
|
||||||
// label: '时间段',
|
|
||||||
// dateType: 'daterange', // datetimerange
|
|
||||||
// // format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
// format: 'yyyy-MM-dd',
|
|
||||||
// valueFormat: 'timestamp',
|
|
||||||
// rangeSeparator: '-',
|
|
||||||
// startPlaceholder: '开始日期',
|
|
||||||
// endPlaceholder: '结束日期',
|
|
||||||
// defaultTime: ['00:00:00', '23:59:59'],
|
|
||||||
// param: 'checkTime',
|
|
||||||
// // width: 350,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'button',
|
|
||||||
// btnName: '查询',
|
|
||||||
// name: 'search',
|
|
||||||
// color: 'primary',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// },
|
|
||||||
// // {
|
|
||||||
// // type: this.$auth.hasPermi(
|
|
||||||
// // 'base:quality-inspection-record:create'
|
|
||||||
// // )
|
|
||||||
// // ? 'button'
|
|
||||||
// // : '',
|
|
||||||
// // btnName: '新增',
|
|
||||||
// // name: 'add',
|
|
||||||
// // plain: true,
|
|
||||||
// // color: 'success',
|
|
||||||
// // },
|
|
||||||
],
|
|
||||||
// tableBtn: [
|
|
||||||
// this.$auth.hasPermi('base:quality-inspection-record:update')
|
|
||||||
// ? {
|
|
||||||
// type: 'edit',
|
|
||||||
// btnName: '修改',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
// this.$auth.hasPermi('base:quality-inspection-record:delete')
|
|
||||||
// ? {
|
|
||||||
// type: 'delete',
|
|
||||||
// btnName: '删除',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
// ].filter((v) => v),
|
|
||||||
// tableProps: [
|
|
||||||
// {
|
|
||||||
// prop: 'createTime',
|
|
||||||
// label: '添加时间',
|
|
||||||
// fixed: true,
|
|
||||||
// width: 180,
|
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// // width: 128,
|
|
||||||
// prop: 'inspectionDetContent',
|
|
||||||
// label: '检测内容',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// // width: 128,
|
|
||||||
// prop: 'lineName',
|
|
||||||
// label: '产线',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// // width: 128,
|
|
||||||
// prop: 'checkPerson',
|
|
||||||
// label: '检测人员',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// // width: 160,
|
|
||||||
// prop: 'checkTime',
|
|
||||||
// label: '检测时间',
|
|
||||||
// filter: (val) =>
|
|
||||||
// val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// width: 90,
|
|
||||||
// prop: 'source',
|
|
||||||
// label: '来源',
|
|
||||||
// filter: (val) => ['未知', '手动', '自动'][val],
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
|
||||||
|
|
||||||
// searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
|
|
||||||
// form: {
|
|
||||||
// id: undefined,
|
|
||||||
// inspectionDetId: undefined,
|
|
||||||
// inspectionDetContent: undefined,
|
|
||||||
// productionLineId: undefined,
|
|
||||||
// sectionId: undefined,
|
|
||||||
// checkPerson: undefined,
|
|
||||||
// checkTime: undefined,
|
|
||||||
// source: undefined,
|
|
||||||
// explainText: undefined,
|
|
||||||
// remark: undefined,
|
|
||||||
// },
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
workOrderId: undefined,
|
|
||||||
productId: undefined,
|
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined,
|
|
||||||
// productionLineId: null,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
// this.getProductLineList();
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
productProps() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
// width: 160,
|
|
||||||
prop: 'workOrderName',
|
|
||||||
label: '工单名称',
|
|
||||||
},
|
|
||||||
...this.dynamicProps,
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'sumInput',
|
|
||||||
label: '上片总数',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'sumOutput',
|
|
||||||
label: '下片总数',
|
|
||||||
// subcomponent: {
|
|
||||||
// name: 'TextOnly',
|
|
||||||
// props: {
|
|
||||||
// injectData: {
|
|
||||||
// type: Object,
|
|
||||||
// default: () => ({}),
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// data() {
|
|
||||||
// return {
|
|
||||||
// text: '比例',
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// methods: {
|
|
||||||
// handleEmit(payload) {
|
|
||||||
// console.log('handleEmit', payload);
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// render(h) {
|
|
||||||
// return h('el-button', { props: { type: 'text' } }, this.text);
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.$route.params.startTime && this.$route.params.endTime) {
|
|
||||||
this.searchBarFormConfig[0].defaultSelect = [
|
|
||||||
this.$route.params.startTime,
|
|
||||||
this.$route.params.endTime,
|
|
||||||
];
|
|
||||||
this.queryParams.param = {};
|
|
||||||
this.$set(
|
|
||||||
this.queryParams.param,
|
|
||||||
'startTime',
|
|
||||||
this.$route.params.startTime
|
|
||||||
);
|
|
||||||
this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
|
|
||||||
} else {
|
|
||||||
this.searchBarFormConfig[0].defaultSelect = [];
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleTabClick() {
|
|
||||||
if (this.activeName === 'chart') {
|
|
||||||
var chartDom = document.getElementById('main');
|
|
||||||
var myChart = echarts.init(chartDom);
|
|
||||||
var option;
|
|
||||||
let arrXAxis = []
|
|
||||||
this.list.forEach((ele) => {
|
|
||||||
arrXAxis.push(ele.workOrderName)
|
|
||||||
})
|
|
||||||
this.downList.forEach((ele) => {
|
|
||||||
ele.forEach((item) => {
|
|
||||||
if (ele.length !==0 && item.productionline) {
|
|
||||||
arrXAxis.push('产线' + item.productionline)
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
let arrYAxis = []
|
|
||||||
this.list.forEach((ele) => {
|
|
||||||
// console.log(ele);
|
|
||||||
arrYAxis.push(ele.sumInput)
|
|
||||||
})
|
|
||||||
this.downList.forEach((ele) => {
|
|
||||||
ele.forEach((item) => {
|
|
||||||
console.log(item);
|
|
||||||
// if (ele.length !== 0 && item.productionline) {
|
|
||||||
arrYAxis.push(item.sumInput)
|
|
||||||
// }
|
|
||||||
})
|
|
||||||
})
|
|
||||||
// console.log(arrXAxis);
|
|
||||||
option = {
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: arrXAxis
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value'
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
data: arrYAxis,
|
|
||||||
type: 'bar',
|
|
||||||
showBackground: true,
|
|
||||||
barWidth: '20',
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top'
|
|
||||||
},
|
|
||||||
backgroundStyle: {
|
|
||||||
color: 'rgba(180, 180, 180, 0.2)'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
option && myChart.setOption(option);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 获取搜索栏的产线列表 */
|
|
||||||
// async getDict() {
|
|
||||||
// const res = await getProductList()
|
|
||||||
// const result = await getWorkOrderList()
|
|
||||||
// console.log(res);
|
|
||||||
// this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id:item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// this.searchBarFormConfig[0].selectOptions = result.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// getProductLineList() {
|
|
||||||
// this.$axios('/base/production-line/listAll').then((response) => {
|
|
||||||
// this.searchBarFormConfig[0].selectOptions = response.data.map(
|
|
||||||
// (item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id,
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
getList() {
|
|
||||||
this.getDataList()
|
|
||||||
// this.getDict()
|
|
||||||
},
|
|
||||||
/** 查询列表 */
|
|
||||||
async getDataList() {
|
|
||||||
this.loading = true;
|
|
||||||
// 执行查询
|
|
||||||
this.downProps= []
|
|
||||||
const res = await getInspectionData(this.queryParams)
|
|
||||||
console.log(res);
|
|
||||||
this.productDetail.name = res.data[0].productName
|
|
||||||
this.productDetail.specifications = res.data[0].specifications
|
|
||||||
// this.productName = res.data[0].productName
|
|
||||||
this.dynamicProps = this.filterNameData(res.data[0].upPart.nameData)
|
|
||||||
console.log(this.dynamicProps)
|
|
||||||
this.list = this.filterData(res.data[0].upPart.data)
|
|
||||||
console.log(this.list)
|
|
||||||
res.data[0].downPart.forEach((ele) => {
|
|
||||||
// console.log(ele.data);
|
|
||||||
let arr = this.downFilterNameData(ele.nameData)
|
|
||||||
if (arr.length !== 0) {
|
|
||||||
let propArr = [{
|
|
||||||
// width: 160,
|
|
||||||
prop: 'inspectionContent',
|
|
||||||
label: '检测内容',
|
|
||||||
},
|
|
||||||
...arr,
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'sumInput',
|
|
||||||
label: '原片总数',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'sumScrap',
|
|
||||||
label: '未通过检测总数',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'scrapRatio',
|
|
||||||
label: '报废比例',
|
|
||||||
}]
|
|
||||||
this.downProps.push(propArr)
|
|
||||||
}
|
|
||||||
// this.downProps = []
|
|
||||||
})
|
|
||||||
res.data[0].downPart.forEach((ele) => {
|
|
||||||
// console.log(ele.data);
|
|
||||||
let arr =this.downFilterData(ele.data)
|
|
||||||
if (arr.length !== 0) {
|
|
||||||
this.downList.push(arr)
|
|
||||||
}
|
|
||||||
// this.downProps = []
|
|
||||||
})
|
|
||||||
|
|
||||||
// console.log(this.downList);
|
|
||||||
},
|
|
||||||
downFilterNameData(nameData) {
|
|
||||||
const ndSet = new Set();
|
|
||||||
nameData.forEach((nd) => {
|
|
||||||
ndSet.add(nd.name);
|
|
||||||
});
|
|
||||||
return Array.from(ndSet.values())
|
|
||||||
.sort()
|
|
||||||
.map((name) => ({
|
|
||||||
prop: name,
|
|
||||||
label: name,
|
|
||||||
}));
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
downFilterData(data) {
|
|
||||||
return data.map((item) => {
|
|
||||||
const { data: innerData } = item;
|
|
||||||
const keyValuePairs = {};
|
|
||||||
innerData.map((d) => {
|
|
||||||
keyValuePairs[d.dynamicName] = d.dynamicValue;
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
inspectionContent: item.inspectionContent,
|
|
||||||
...keyValuePairs,
|
|
||||||
sumInput: item.sumInput,
|
|
||||||
scrapRatio: item.scrapRatio,
|
|
||||||
sumScrap: item.sumScrap
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
|
||||||
filterNameData(nameData) {
|
|
||||||
// console.log(upData);
|
|
||||||
// upData.forEach((ele) => {
|
|
||||||
const ndSet = new Set();
|
|
||||||
|
|
||||||
nameData.forEach((nd) => {
|
|
||||||
ndSet.add(nd.name);
|
|
||||||
});
|
|
||||||
return Array.from(ndSet.values())
|
|
||||||
.sort()
|
|
||||||
.map((name) => ({
|
|
||||||
prop: name,
|
|
||||||
label: name,
|
|
||||||
}));
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
filterData(data) {
|
|
||||||
return data.map((item) => {
|
|
||||||
const { data: innerData } = item;
|
|
||||||
const keyValuePairs = {};
|
|
||||||
innerData.map((d) => {
|
|
||||||
keyValuePairs[d.dynamicName] = d.dynamicValue;
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
inspectionContent: item.inspectionContent,
|
|
||||||
workOrderName: item.workOrderName,
|
|
||||||
...keyValuePairs,
|
|
||||||
sumInput: item.sumInput,
|
|
||||||
sumOutput: item.sumOutput,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 取消按钮 */
|
|
||||||
handleSearchBarBtnClick(val) {
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.queryParams.workOrderId = val.workOrderId ? val.workOrderId : undefined
|
|
||||||
this.queryParams.productId = val.productId ? val.productId : undefined
|
|
||||||
this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
|
|
||||||
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
|
|
||||||
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
console.log(val);
|
|
||||||
}
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
// 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;
|
|
||||||
// getQualityInspectionRecord(id).then((response) => {
|
|
||||||
// /** 因为后端返回的时间是时间戳格式,需转换 */
|
|
||||||
// const info = {}
|
|
||||||
// Object.keys(this.form).forEach(key => {
|
|
||||||
// info[key] = response.data[key]
|
|
||||||
// });
|
|
||||||
// this.form = info;
|
|
||||||
// this.open = true;
|
|
||||||
// this.title = '修改质量检查信息记录表';
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// /** 提交按钮 */
|
|
||||||
// submitForm() {
|
|
||||||
// this.$refs['form'].validate((valid) => {
|
|
||||||
// if (!valid) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// // 修改的提交
|
|
||||||
// if (this.form.id != null) {
|
|
||||||
// updateQualityInspectionRecord(this.form).then((response) => {
|
|
||||||
// this.$modal.msgSuccess('修改成功');
|
|
||||||
// this.open = false;
|
|
||||||
// this.getList();
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// // 添加的提交
|
|
||||||
// createQualityInspectionRecord(this.form).then((response) => {
|
|
||||||
// this.$modal.msgSuccess('新增成功');
|
|
||||||
// this.open = false;
|
|
||||||
// this.getList();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// /** 删除按钮操作 */
|
|
||||||
// handleDelete(row) {
|
|
||||||
// const id = row.id;
|
|
||||||
// this.$modal
|
|
||||||
// .confirm('是否确认删除"' + row.inspectionDetContent + '"?')
|
|
||||||
// .then(function () {
|
|
||||||
// return deleteQualityInspectionRecord(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 exportQualityInspectionRecordExcel(params);
|
|
||||||
// })
|
|
||||||
// .then((response) => {
|
|
||||||
// this.$download.excel(response, '质量检查信息记录表.xls');
|
|
||||||
// this.exportLoading = false;
|
|
||||||
// })
|
|
||||||
// .catch(() => {});
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
:deep(.custom-tabs) {
|
|
||||||
.el-tabs__header {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
display: inline-block;
|
|
||||||
transform: translateY(-12px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tabs__content {
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tabs__item {
|
|
||||||
padding-left: 0 !important;
|
|
||||||
padding-right: 0 !important;
|
|
||||||
line-height: 36px !important;
|
|
||||||
height: 36px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.blue-title {
|
|
||||||
position: relative;
|
|
||||||
padding: 4px 0;
|
|
||||||
padding-left: 12px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 6px;
|
|
||||||
height: 16px;
|
|
||||||
width: 4px;
|
|
||||||
border-radius: 1px;
|
|
||||||
background: #0b58ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,3 @@
|
|||||||
<!--
|
|
||||||
filename: index.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-09-04 09:34:52
|
|
||||||
description: 设备效率分析
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container allow-overflow">
|
<div class="app-container allow-overflow">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
@@ -15,10 +8,7 @@
|
|||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col class="custom-tabs">
|
<el-col class="custom-tabs">
|
||||||
<el-tabs
|
<el-tabs v-model="activeName" :stretch="true">
|
||||||
v-model="activeName"
|
|
||||||
:stretch="true"
|
|
||||||
@tab-click="handleTabClick">
|
|
||||||
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
|
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table
|
<base-table
|
||||||
@@ -27,7 +17,7 @@
|
|||||||
:page="1"
|
:page="1"
|
||||||
:limit="10"
|
:limit="10"
|
||||||
:table-data="list"
|
:table-data="list"
|
||||||
@emitFun="handleEmitFun"></base-table>
|
:max-height="tableH"></base-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
:label="'\u3000可视化\u3000'"
|
:label="'\u3000可视化\u3000'"
|
||||||
@@ -74,7 +64,6 @@
|
|||||||
v-for="item in list"
|
v-for="item in list"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:value="item" />
|
:value="item" />
|
||||||
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -86,40 +75,44 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import moment from 'moment';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
import PieChart from './components/pieChart.vue';
|
import PieChart from './components/pieChart.vue';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
import { exportEfficiencyExcel } from '@/api/equipment/analysis/statistics.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EfficiencyAnalysis',
|
name: 'EfficiencyAnalysis',
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin, tableHeightMixin],
|
||||||
components: { PieChart },
|
components: { PieChart },
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: 'table',
|
activeName: 'table',
|
||||||
open: false,
|
|
||||||
visualizationOpen: false,
|
|
||||||
trendOpen: false,
|
|
||||||
// tableBtn: [
|
|
||||||
// this.$auth.hasPermi('base:equipment-group:update')
|
|
||||||
// ? {
|
|
||||||
// type: 'edit',
|
|
||||||
// btnName: '修改',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
// this.$auth.hasPermi('base:equipment-group:delete')
|
|
||||||
// ? {
|
|
||||||
// type: 'delete',
|
|
||||||
// btnName: '删除',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
// ].filter((v) => v),
|
|
||||||
tableProps: [
|
tableProps: [
|
||||||
{ prop: 'factoryName', label: '工厂' },
|
{
|
||||||
{ prop: 'lineName', label: '产线' },
|
prop: 'factoryName',
|
||||||
{ prop: 'sectionName', label: '工段' },
|
label: '工厂',
|
||||||
{ prop: 'equipmentName', label: '设备' },
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'lineName',
|
||||||
|
label: '产线',
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sectionName',
|
||||||
|
label: '工段',
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'equipmentName',
|
||||||
|
label: '设备',
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '有效时间',
|
label: '有效时间',
|
||||||
children: [
|
children: [
|
||||||
@@ -127,12 +120,13 @@ export default {
|
|||||||
width: 128,
|
width: 128,
|
||||||
prop: 'workTime',
|
prop: 'workTime',
|
||||||
label: '工作时长[h]',
|
label: '工作时长[h]',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: 128,
|
width: 128,
|
||||||
prop: 'workRate',
|
prop: 'workRate',
|
||||||
label: '百分比[%]',
|
label: '百分比[%]',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -143,8 +137,14 @@ export default {
|
|||||||
width: 128,
|
width: 128,
|
||||||
prop: 'stopTime',
|
prop: 'stopTime',
|
||||||
label: '停机时长[h]',
|
label: '停机时长[h]',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'stopRate',
|
||||||
|
label: '百分比[%]',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{ width: 128, prop: 'stopRate', label: '百分比[%]' },
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -154,14 +154,19 @@ export default {
|
|||||||
width: 128,
|
width: 128,
|
||||||
prop: 'downTime',
|
prop: 'downTime',
|
||||||
label: '故障时长[h]',
|
label: '故障时长[h]',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'downRate',
|
||||||
|
label: '百分比[%]',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{ width: 128, prop: 'downRate', label: '百分比[%]' },
|
|
||||||
{
|
{
|
||||||
width: 128,
|
width: 128,
|
||||||
prop: 'timeEfficiency',
|
prop: 'timeEfficiency',
|
||||||
label: '时间开动率',
|
label: '时间开动率',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -172,150 +177,67 @@ export default {
|
|||||||
width: 128,
|
width: 128,
|
||||||
prop: 'realProcSpeed',
|
prop: 'realProcSpeed',
|
||||||
label: '实际加工速度',
|
label: '实际加工速度',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: 128,
|
width: 128,
|
||||||
prop: 'designProcSpeed',
|
prop: 'designProcSpeed',
|
||||||
label: '理论加工速度',
|
label: '理论加工速度',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: 128,
|
width: 128,
|
||||||
prop: 'peEfficiency',
|
prop: 'peEfficiency',
|
||||||
label: '速度开动率',
|
label: '速度开动率',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
prop: 'oee',
|
|
||||||
label: 'OEE',
|
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'teep',
|
|
||||||
label: 'TEEP',
|
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// _action: 'view-trend',
|
|
||||||
// label: '趋势',
|
|
||||||
// ,
|
|
||||||
// subcomponent: {
|
|
||||||
// props: ['injectData'],
|
|
||||||
// render: function (h) {
|
|
||||||
// const _this = this;
|
|
||||||
// return h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: { type: 'text' },
|
|
||||||
// on: {
|
|
||||||
// click: function () {
|
|
||||||
// console.log('inejctdata', _this.injectData);
|
|
||||||
// _this.$emit('emitData', {
|
|
||||||
// action: _this.injectData._action,
|
|
||||||
// // value: _this.injectData.id,
|
|
||||||
// value: _this.injectData,
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// '查看趋势'
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '工单',
|
label: '工单名称',
|
||||||
placeholder: '请选择工单',
|
param: 'workOrderId',
|
||||||
param: 'workOrderId',
|
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
|
filterable: true,
|
||||||
|
clearable: false,
|
||||||
|
defaultSelect: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// parent: 'dateFilterType',
|
||||||
|
// 时间段选择
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '时间段',
|
||||||
|
dateType: 'daterange',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
defaultTime: ['00:00:00', '00:00:00'],
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始时间',
|
||||||
|
endPlaceholder: '结束时间',
|
||||||
|
param: 'recordTime',
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// type: 'select',
|
|
||||||
// label: '产线',
|
|
||||||
// placeholder: '请选择产线',
|
|
||||||
// param: 'lineId',
|
|
||||||
// selectOptions: [],
|
|
||||||
// },
|
|
||||||
// 选项切换
|
|
||||||
// {
|
|
||||||
// type: 'select',
|
|
||||||
// label: '时间类型',
|
|
||||||
// param: 'dateFilterType',
|
|
||||||
// defaultSelect: 0,
|
|
||||||
// selectOptions: [
|
|
||||||
// { id: 0, name: '按时间段' },
|
|
||||||
// { id: 1, name: '按日期' },
|
|
||||||
// ],
|
|
||||||
// index: 2,
|
|
||||||
// extraOptions: [
|
|
||||||
{
|
|
||||||
// parent: 'dateFilterType',
|
|
||||||
// 时间段选择
|
|
||||||
type: 'datePicker',
|
|
||||||
// label: '时间段',
|
|
||||||
dateType: 'daterange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
defaultTime: ['00:00:00', '00:00:00'],
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timerange',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// parent: 'dateFilterType',
|
|
||||||
// // 日期选择
|
|
||||||
// type: 'datePicker',
|
|
||||||
// // label: '日期',
|
|
||||||
// dateType: 'date',
|
|
||||||
// placeholder: '选择日期',
|
|
||||||
// format: 'yyyy-MM-dd',
|
|
||||||
// valueFormat: 'yyyy-MM-dd',
|
|
||||||
// param: 'timeday',
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
btnName: '查询',
|
btnName: '查询',
|
||||||
name: 'search',
|
name: 'search',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// type: 'separate',
|
type: 'separate',
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// type: 'button',
|
type: 'button',
|
||||||
// btnName: '设备可视化',
|
btnName: '导出',
|
||||||
// name: 'visualization',
|
name: 'export',
|
||||||
// plain: true,
|
plain: true,
|
||||||
// color: 'success',
|
color: 'success',
|
||||||
// },
|
},
|
||||||
// {
|
|
||||||
// type: 'button',
|
|
||||||
// btnName: 'OEE',
|
|
||||||
// name: 'add',
|
|
||||||
// plain: true,
|
|
||||||
// color: 'success',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'button',
|
|
||||||
// btnName: 'TEEP',
|
|
||||||
// name: 'add',
|
|
||||||
// plain: true,
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
// lineId: null,
|
workOrderId: null,
|
||||||
workOrderId: null,
|
|
||||||
recordTime: [],
|
recordTime: [],
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
@@ -324,54 +246,32 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getWorkOrder()
|
this.getWorkOrder();
|
||||||
// this.getLine();
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 准备工厂数据 */
|
/** 准备工厂数据 */
|
||||||
async getWorkOrder() {
|
async getWorkOrder() {
|
||||||
console.log(1111);
|
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/core-work-order/listbyfilter',
|
url: '/base/core-work-order/listbyfilter',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
console.log('1111', data);
|
|
||||||
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
|
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
this.searchBarFormConfig[0].defaultSelect =
|
||||||
|
this.searchBarFormConfig[0].selectOptions[0].id;
|
||||||
|
this.queryParams.workOrderId =
|
||||||
|
this.searchBarFormConfig[0].selectOptions[0].id;
|
||||||
|
} else {
|
||||||
|
this.searchBarFormConfig[0].selectOptions = [];
|
||||||
|
this.searchBarFormConfig[0].defaultSelect = '';
|
||||||
|
this.queryParams.workOrderId = '';
|
||||||
}
|
}
|
||||||
},
|
this.getList();
|
||||||
|
|
||||||
// /** 准备产线数据 */
|
|
||||||
// async getLine() {
|
|
||||||
// const { code, data } = await this.$axios({
|
|
||||||
// url: '/base/production-line/listAll',
|
|
||||||
// method: 'get',
|
|
||||||
// });
|
|
||||||
// if (code == 0) {
|
|
||||||
// this.searchBarFormConfig[1].selectOptions = data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id,
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
|
||||||
handleEmitFun({ action, value }) {
|
|
||||||
switch (action) {
|
|
||||||
case 'view-trend':
|
|
||||||
const { id } = value;
|
|
||||||
this.open = true;
|
|
||||||
this.trendOpen = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
async getList() {
|
async getList() {
|
||||||
@@ -385,43 +285,23 @@ export default {
|
|||||||
this.list = data;
|
this.list = data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
exportExcel() {
|
||||||
|
this.loading = true;
|
||||||
|
exportEfficiencyExcel({ ...this.queryParams }).then((res) => {
|
||||||
|
this.$download.excel(res, '设备状态追溯.xls');
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
handleSearchBarBtnClick({ btnName, ...payload }) {
|
handleSearchBarBtnClick({ btnName, ...payload }) {
|
||||||
console.log('handleSearchBarBtnClick', btnName, payload);
|
this.queryParams.workOrderId = payload.workOrderId || null;
|
||||||
if (btnName == 'visualization') {
|
this.queryParams.recordTime = payload.recordTime || undefined;
|
||||||
// 可视化
|
|
||||||
this.visualizationOpen = true;
|
|
||||||
this.open = true;
|
|
||||||
}
|
|
||||||
if (btnName == 'search') {
|
if (btnName == 'search') {
|
||||||
this.queryParams.workOrderId = payload.workOrderId || null;
|
this.getList();
|
||||||
// this.queryParams.lineId = payload.lineId || null;
|
|
||||||
if (0 == payload.dateFilterType) {
|
|
||||||
this.queryParams.recordTime = payload.timerange;
|
|
||||||
} else if (1 == payload.dateFilterType) {
|
|
||||||
this.queryParams.recordTime = [
|
|
||||||
`${payload.timeday} 00:00:00`,
|
|
||||||
`${payload.timeday} 23:59:59`,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.recordTime = null;
|
this.exportExcel();
|
||||||
|
console.log('导出');
|
||||||
}
|
}
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
closed() {
|
|
||||||
this.visualizationOpen = false;
|
|
||||||
this.trendOpen = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
submitForm() {},
|
|
||||||
|
|
||||||
handleTabClick() {},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,251 +1,222 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2023-08-01 14:55:51
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @LastEditTime: 2023-11-24 10:55:54
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar
|
||||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
|
:formConfigs="formConfig"
|
||||||
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
ref="searchBarForm"
|
||||||
@clickBtn="handleClick" /> -->
|
@headBtnClick="buttonClick" />
|
||||||
</base-table>
|
<base-table
|
||||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
:table-props="tableProps"
|
||||||
@pagination="getList" />
|
:page="listQuery.pageNo"
|
||||||
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
|
:limit="listQuery.pageSize"
|
||||||
</div>
|
:table-data="list"
|
||||||
|
:max-height="tableH"></base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import AddOrUpdate from './add-or-updata';
|
|
||||||
// import unitDict from './unitDict';
|
|
||||||
// import basicPage from '../mixins/basic-page';
|
|
||||||
import { parseTime } from '../mixins/code-filter';
|
import { parseTime } from '../mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getMaterialUseLogPage,
|
getMaterialUseLogPage,
|
||||||
getWorkOrderList,
|
getWorkOrderList,
|
||||||
exportEnergyPlcExcel
|
exportEnergyPlcExcel,
|
||||||
} from '@/api/quality/materialTraceability';
|
} from '@/api/quality/materialTraceability';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'materialName',
|
prop: 'materialName',
|
||||||
label: '物料名称'
|
label: '物料名称',
|
||||||
},
|
showOverflowtooltip: true,
|
||||||
{
|
},
|
||||||
prop: 'materialCode',
|
{
|
||||||
label: '物料编码'
|
prop: 'materialCode',
|
||||||
},
|
label: '物料编码',
|
||||||
{
|
showOverflowtooltip: true,
|
||||||
prop: 'dateName',
|
minWidth: 120,
|
||||||
label: '物料批次'
|
},
|
||||||
},
|
{
|
||||||
{
|
prop: 'dateName',
|
||||||
prop: 'equipName',
|
label: '物料批次',
|
||||||
label: '使用设备'
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'num',
|
prop: 'equipName',
|
||||||
label: '使用数量'
|
label: '使用设备',
|
||||||
},
|
showOverflowtooltip: true,
|
||||||
{
|
},
|
||||||
prop: 'useTime',
|
{
|
||||||
label: '使用时间',
|
prop: 'num',
|
||||||
filter: parseTime
|
label: '使用数量',
|
||||||
},
|
showOverflowtooltip: true,
|
||||||
{
|
},
|
||||||
prop: 'userName',
|
{
|
||||||
label: '操作人'
|
prop: 'useTime',
|
||||||
},
|
label: '使用时间',
|
||||||
{
|
filter: parseTime,
|
||||||
prop: 'source',
|
width: 160,
|
||||||
label: '数据来源',
|
},
|
||||||
filter: (val) => val == 1 ? '内部' : '外部'
|
{
|
||||||
},
|
prop: 'userName',
|
||||||
{
|
label: '操作人',
|
||||||
prop: 'remark',
|
showOverflowtooltip: true,
|
||||||
label: '备注'
|
},
|
||||||
}
|
{
|
||||||
|
prop: 'source',
|
||||||
|
label: '数据来源',
|
||||||
|
filter: (val) => (val == 1 ? '内部' : '外部'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// mixins: [basicPage],
|
mixins: [tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// urlOptions: {
|
heightNum: 220,
|
||||||
// getDataListURL: getMaterialUseLogPage,
|
tableProps,
|
||||||
// // deleteURL: deletePackingType,
|
tableBtn: [
|
||||||
// // exportURL: exportPackingExcel,
|
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||||
// },
|
? {
|
||||||
tableProps,
|
type: 'edit',
|
||||||
tableBtn: [
|
btnName: '编辑',
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
}
|
||||||
? {
|
: undefined,
|
||||||
type: 'edit',
|
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||||
btnName: '编辑',
|
? {
|
||||||
}
|
type: 'delete',
|
||||||
: undefined,
|
btnName: '删除',
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
}
|
||||||
? {
|
: undefined,
|
||||||
type: 'delete',
|
].filter((v) => v),
|
||||||
btnName: '删除',
|
list: [],
|
||||||
}
|
listQuery: {
|
||||||
: undefined,
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
].filter((v) => v),
|
workOrderId: undefined,
|
||||||
list: [],
|
startTime: undefined,
|
||||||
listQuery: {
|
endTime: undefined,
|
||||||
pageSize: 10,
|
},
|
||||||
pageNo: 1,
|
total: 0,
|
||||||
total: 0,
|
formConfig: [
|
||||||
workOrderId: undefined,
|
{
|
||||||
startTime: undefined,
|
type: 'select',
|
||||||
endTime:undefined,
|
label: '工单名称',
|
||||||
},
|
selectOptions: [],
|
||||||
formConfig: [
|
param: 'workOrderId',
|
||||||
{
|
defaultSelect: '',
|
||||||
type: 'select',
|
filterable: true,
|
||||||
label: '工单',
|
clearable: false,
|
||||||
selectOptions: [],
|
},
|
||||||
labelField: 'name',
|
{
|
||||||
valueField: 'id',
|
type: 'datePicker',
|
||||||
param: 'workOrderId'
|
label: '时间段',
|
||||||
},
|
dateType: 'daterange',
|
||||||
{
|
format: 'yyyy-MM-dd',
|
||||||
type: 'datePicker',
|
valueFormat: 'yyyy-MM-dd',
|
||||||
label: '时间段',
|
rangeSeparator: '-',
|
||||||
dateType: 'daterange',
|
startPlaceholder: '开始时间',
|
||||||
format: 'yyyy-MM-dd',
|
endPlaceholder: '结束时间',
|
||||||
valueFormat: "yyyy-MM-dd",
|
param: 'timeVal',
|
||||||
rangeSeparator: '-',
|
defaultSelect: [],
|
||||||
startPlaceholder: '开始时间',
|
width: 250,
|
||||||
endPlaceholder: '结束时间',
|
},
|
||||||
param: 'timeVal',
|
{
|
||||||
defaultSelect: [],
|
type: 'button',
|
||||||
width: 250
|
btnName: '查询',
|
||||||
},
|
name: 'search',
|
||||||
{
|
color: 'primary',
|
||||||
type: 'button',
|
},
|
||||||
btnName: '搜索',
|
{
|
||||||
name: 'search',
|
type: 'separate',
|
||||||
color: 'primary',
|
},
|
||||||
},
|
{
|
||||||
{
|
type: this.$auth.hasPermi('monitoring:materiel-date-from:export')
|
||||||
type: 'separate',
|
? 'button'
|
||||||
},
|
: '',
|
||||||
// {
|
btnName: '导出',
|
||||||
// type: 'separate',
|
name: 'export',
|
||||||
// },
|
plain: true,
|
||||||
// {
|
color: 'success',
|
||||||
// type: 'button',
|
},
|
||||||
// btnName: '重置',
|
],
|
||||||
// name: 'reset',
|
};
|
||||||
// },
|
},
|
||||||
// {
|
components: {
|
||||||
// type: 'separate',
|
// AddOrUpdate,
|
||||||
// },
|
},
|
||||||
// {
|
created() {
|
||||||
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
this.getDict();
|
||||||
// btnName: '新增',
|
},
|
||||||
// name: 'add',
|
methods: {
|
||||||
// color: 'success',
|
getList() {
|
||||||
// plain: true,
|
getMaterialUseLogPage({ ...this.listQuery }).then((res) => {
|
||||||
// },
|
this.list = res.data || [];
|
||||||
// {
|
this.total = res.data.total || 0;
|
||||||
// type: 'separate',
|
});
|
||||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
},
|
||||||
// },
|
getDict() {
|
||||||
{
|
getWorkOrderList().then((response) => {
|
||||||
type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
|
this.formConfig[0].selectOptions = response.data.map((item) => {
|
||||||
btnName: '导出',
|
return {
|
||||||
name: 'export',
|
name: item.name,
|
||||||
color: 'warning',
|
id: item.id,
|
||||||
},
|
};
|
||||||
],
|
});
|
||||||
};
|
console.log(this.formConfig[0].selectOptions);
|
||||||
},
|
this.formConfig[0].defaultSelect =
|
||||||
components: {
|
this.formConfig[0].selectOptions[0].id || '';
|
||||||
// AddOrUpdate,
|
this.listQuery.workOrderId =
|
||||||
},
|
this.formConfig[0].selectOptions[0].id || '';
|
||||||
created() {
|
this.getList();
|
||||||
this.getList()
|
});
|
||||||
this.getDict()
|
},
|
||||||
},
|
handleExport() {
|
||||||
methods: {
|
// 处理查询参数
|
||||||
getList() {
|
let params = { ...this.listQuery };
|
||||||
getMaterialUseLogPage({ ...this.listQuery }).then(res => {
|
params.pageNo = undefined;
|
||||||
this.list = res.data || []
|
params.pageSize = undefined;
|
||||||
this.listQuery.total = res.data.total || 0
|
this.exportLoading = true;
|
||||||
})
|
exportEnergyPlcExcel(params)
|
||||||
},
|
.then((response) => {
|
||||||
getDict() {
|
this.$download.excel(response, '物料信息追溯 ');
|
||||||
// 获取产品的属性列表
|
this.exportLoading = false;
|
||||||
// getCustomerList().then((response) => {
|
})
|
||||||
// console.log(response);
|
.catch(() => {});
|
||||||
// this.customerList = response.data
|
},
|
||||||
// // this.listQuery.total = response.data.total;
|
buttonClick(val) {
|
||||||
// })
|
console.log(val);
|
||||||
// getModelList().then((response) => {
|
if (val.btnName === 'search') {
|
||||||
// console.log(response);
|
this.listQuery.workOrderId = val.workOrderId
|
||||||
// this.modelList = response.data
|
? val.workOrderId
|
||||||
// // this.listQuery.total = response.data.total;
|
: undefined;
|
||||||
// })
|
if (val.timeVal && val.timeVal.length != 0) {
|
||||||
getWorkOrderList().then((response) => {
|
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
|
||||||
// console.log(response);
|
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
|
||||||
this.formConfig[0].selectOptions = response.data.map((item) => {
|
} else {
|
||||||
return {
|
this.listQuery.startTime = undefined;
|
||||||
name: item.name,
|
this.listQuery.endTime = undefined;
|
||||||
id: item.id
|
}
|
||||||
}
|
this.getList();
|
||||||
})
|
} else {
|
||||||
console.log(this.formConfig[0].selectOptions);
|
this.handleExport();
|
||||||
// this.listQuery.total = response.data.total;
|
}
|
||||||
})
|
},
|
||||||
},
|
otherMethods(val) {
|
||||||
handleExport() {
|
this.addOrUpdateVisible = true;
|
||||||
// 处理查询参数
|
this.addOrEditTitle = '详情';
|
||||||
let params = { ...this.listQuery };
|
this.$nextTick(() => {
|
||||||
params.pageNo = undefined;
|
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
params.pageSize = undefined;
|
});
|
||||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
},
|
||||||
this.exportLoading = true;
|
},
|
||||||
return exportEnergyPlcExcel(params);
|
|
||||||
}).then(response => {
|
|
||||||
this.$download.excel(response, '物料信息追溯 ');
|
|
||||||
this.exportLoading = false;
|
|
||||||
}).catch(() => { });
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
|
|
||||||
// this.queryParams.status = val.status
|
|
||||||
if (val.timeVal && val.timeVal.length != 0 ) {
|
|
||||||
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
|
|
||||||
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
|
|
||||||
} else {
|
|
||||||
this.listQuery.startTime = undefined
|
|
||||||
this.listQuery.endTime = undefined
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
this.handleExport()
|
|
||||||
// this.addOrEditTitle = '新增'
|
|
||||||
// this.centervisible = true
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.orderAdd.init()
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
otherMethods(val) {
|
|
||||||
this.addOrUpdateVisible = true;
|
|
||||||
this.addOrEditTitle = '详情';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,279 +1,218 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2023-08-01 14:55:51
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @LastEditTime: 2023-11-28 10:51:44
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar
|
||||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
|
:formConfigs="formConfig"
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
ref="searchBarForm"
|
||||||
@clickBtn="handleClick" />
|
@headBtnClick="buttonClick" />
|
||||||
</base-table>
|
<base-table
|
||||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
:table-props="tableProps"
|
||||||
@pagination="getList" />
|
:page="listQuery.pageNo"
|
||||||
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
|
:limit="listQuery.pageSize"
|
||||||
</div>
|
:table-data="list"
|
||||||
|
:max-height="tableH">
|
||||||
|
<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="getList" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import AddOrUpdate from './add-or-updata';
|
|
||||||
// import unitDict from './unitDict';
|
|
||||||
// import basicPage from '../mixins/basic-page';
|
|
||||||
import { parseTime } from '../mixins/code-filter';
|
import { parseTime } from '../mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getProcessTraceabilityPage,
|
getProcessTraceabilityPage,
|
||||||
getWorkOrderList,
|
getWorkOrderList,
|
||||||
getCoreProduct
|
getCoreProduct,
|
||||||
// exportEnergyPlcExcel
|
|
||||||
} from '@/api/quality/processTraceability';
|
} from '@/api/quality/processTraceability';
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '工单名称'
|
label: '工单名称',
|
||||||
},
|
showOverflowtooltip: true,
|
||||||
{
|
minWidth: 120,
|
||||||
prop: 'code',
|
},
|
||||||
label: '工单编码'
|
{
|
||||||
},
|
prop: 'code',
|
||||||
{
|
label: '工单编码',
|
||||||
prop: 'planProductName',
|
showOverflowtooltip: true,
|
||||||
label: '产品名'
|
minWidth: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'status',
|
prop: 'planProductName',
|
||||||
label: '状态',
|
label: '产品名',
|
||||||
filter: (val) => val == 1 ? '等待' : val == 2 ? '激活' : val == 3 ? '暂停' : val == 4 ? '完成' : '作废',
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'startProduceTime',
|
prop: 'status',
|
||||||
label: '开始生产时间',
|
label: '状态',
|
||||||
filter: parseTime
|
filter: (val) =>
|
||||||
},
|
val == 1
|
||||||
{
|
? '等待'
|
||||||
prop: 'finishProduceTime',
|
: val == 2
|
||||||
label: '结束生产时间',
|
? '激活'
|
||||||
filter: parseTime
|
: val == 3
|
||||||
},
|
? '暂停'
|
||||||
{
|
: val == 4
|
||||||
prop: 'actualQuantity',
|
? '完成'
|
||||||
label: '生产数量'
|
: '作废',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'planProductUnit',
|
prop: 'startProduceTime',
|
||||||
label: '单位',
|
label: '开始生产时间',
|
||||||
filter: publicFormatter('unit_dict')
|
filter: parseTime,
|
||||||
},
|
width: 160,
|
||||||
{
|
},
|
||||||
prop: 'processFlowName',
|
{
|
||||||
label: '工艺名称'
|
prop: 'finishProduceTime',
|
||||||
},
|
label: '结束生产时间',
|
||||||
{
|
filter: parseTime,
|
||||||
prop: 'yield',
|
width: 160,
|
||||||
label: '合格率'
|
},
|
||||||
}
|
{
|
||||||
|
prop: 'actualQuantity',
|
||||||
|
label: '生产数量',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'planProductUnit',
|
||||||
|
label: '单位',
|
||||||
|
filter: publicFormatter('unit_dict'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'yield',
|
||||||
|
label: '合格率',
|
||||||
|
filter: (val) => (val ? val.toFixed(2) + '%' : '-'),
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'processFlowName',
|
||||||
|
label: '工艺名称',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// mixins: [basicPage],
|
mixins: [tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// urlOptions: {
|
tableProps,
|
||||||
// getDataListURL: getMaterialUseLogPage,
|
tableBtn: [
|
||||||
// // deleteURL: deletePackingType,
|
{
|
||||||
// // exportURL: exportPackingExcel,
|
type: 'processDetail',
|
||||||
// },
|
btnName: '查看工艺详情',
|
||||||
tableProps,
|
},
|
||||||
tableBtn: [
|
].filter((v) => v),
|
||||||
// this.$auth.hasPermi(`base:packaging-print-log:update`)
|
list: [],
|
||||||
// ? {
|
listQuery: {
|
||||||
// type: 'edit',
|
pageSize: 10,
|
||||||
// btnName: '编辑',
|
pageNo: 1,
|
||||||
// }
|
},
|
||||||
// : undefined,
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'processDetail',
|
type: 'select',
|
||||||
btnName: '查看工艺详情',
|
label: '工单名称',
|
||||||
},
|
selectOptions: [],
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
param: 'orderName',
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '工单开始时间',
|
||||||
|
dateType: 'daterange',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: 'yyyy-MM-dd',
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始时间',
|
||||||
|
endPlaceholder: '结束时间',
|
||||||
|
param: 'timeVal',
|
||||||
|
defaultSelect: [],
|
||||||
|
width: 250,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getDict();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
getProcessTraceabilityPage(this.listQuery).then((res) => {
|
||||||
|
this.list = res.data.list || [];
|
||||||
|
this.listQuery.total = res.data.total || 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClick(val) {
|
||||||
|
if (val.type === 'processDetail') {
|
||||||
|
console.log(val);
|
||||||
|
let specificationsData = '';
|
||||||
|
getCoreProduct(val.data.planProductId).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
].filter((v) => v),
|
this.$router.push({
|
||||||
list: [],
|
path: 'process-traceability-detail',
|
||||||
listQuery: {
|
query: {
|
||||||
pageSize: 10,
|
id: val.data.processFlowId,
|
||||||
pageNo: 1,
|
orderId: val.data.id,
|
||||||
// total: 0,
|
name: val.data.name,
|
||||||
// orderName: '工单',
|
specifications: res.data.specifications,
|
||||||
// startTime: undefined,
|
productName: val.data.planProductName,
|
||||||
// endTime:undefined,
|
processFlowName: val.data.processFlowName,
|
||||||
},
|
},
|
||||||
formConfig: [
|
});
|
||||||
{
|
});
|
||||||
type: 'select',
|
}
|
||||||
label: '工单',
|
},
|
||||||
selectOptions: [],
|
getDict() {
|
||||||
labelField: 'name',
|
getWorkOrderList().then((response) => {
|
||||||
valueField: 'id',
|
this.formConfig[0].selectOptions = response.data.map((item) => {
|
||||||
param: 'orderName',
|
return {
|
||||||
filterable: true,
|
name: item.name,
|
||||||
},
|
id: item.name,
|
||||||
{
|
};
|
||||||
type: 'datePicker',
|
});
|
||||||
label: '工单开始时间',
|
console.log(this.formConfig[0].selectOptions);
|
||||||
dateType: 'daterange',
|
});
|
||||||
format: 'yyyy-MM-dd',
|
},
|
||||||
valueFormat: "yyyy-MM-dd",
|
buttonClick(val) {
|
||||||
rangeSeparator: '-',
|
console.log(val);
|
||||||
startPlaceholder: '开始时间',
|
if (val.btnName === 'search') {
|
||||||
endPlaceholder: '结束时间',
|
this.listQuery.orderName = val.orderName ? val.orderName : undefined;
|
||||||
param: 'timeVal',
|
if (val.timeVal && val.timeVal.length != 0) {
|
||||||
defaultSelect: [],
|
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
|
||||||
width: 250
|
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
|
||||||
},
|
} else {
|
||||||
{
|
this.listQuery.startTime = undefined;
|
||||||
type: 'button',
|
this.listQuery.endTime = undefined;
|
||||||
btnName: '搜索',
|
}
|
||||||
name: 'search',
|
this.getList();
|
||||||
color: 'primary',
|
}
|
||||||
},
|
},
|
||||||
// {
|
otherMethods(val) {
|
||||||
// type: 'separate',
|
this.addOrUpdateVisible = true;
|
||||||
// },
|
this.addOrEditTitle = '详情';
|
||||||
// {
|
this.$nextTick(() => {
|
||||||
// type: 'button',
|
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
// btnName: '重置',
|
});
|
||||||
// name: 'reset',
|
},
|
||||||
// },
|
},
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
|
||||||
// btnName: '新增',
|
|
||||||
// name: 'add',
|
|
||||||
// color: 'success',
|
|
||||||
// plain: true,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
// AddOrUpdate,
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList()
|
|
||||||
this.getDict()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList() {
|
|
||||||
getProcessTraceabilityPage(this.listQuery).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.listQuery.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
|
||||||
if (val.type === "processDetail") {
|
|
||||||
console.log(val);
|
|
||||||
let specificationsData =''
|
|
||||||
getCoreProduct(val.data.planProductId).then((res) => {
|
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
this.$router.push({
|
|
||||||
path: 'process-traceability-detail',
|
|
||||||
query: {
|
|
||||||
id: val.data.processFlowId,
|
|
||||||
orderId: val.data.id,
|
|
||||||
name: val.data.name,
|
|
||||||
specifications: res.data.specifications,
|
|
||||||
productName: val.data.planProductName,
|
|
||||||
processFlowName: val.data.processFlowName,
|
|
||||||
// planProductId: val.data.planProductId
|
|
||||||
// equipmentName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
// this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getDict() {
|
|
||||||
// 获取产品的属性列表
|
|
||||||
// getCustomerList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
// this.customerList = response.data
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getModelList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
// this.modelList = response.data
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
getWorkOrderList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
this.formConfig[0].selectOptions = response.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.name
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// handleExport() {
|
|
||||||
// // 处理查询参数
|
|
||||||
// let params = { ...this.listQuery };
|
|
||||||
// params.pageNo = undefined;
|
|
||||||
// params.pageSize = undefined;
|
|
||||||
// this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
|
||||||
// this.exportLoading = true;
|
|
||||||
// return exportEnergyPlcExcel(params);
|
|
||||||
// }).then(response => {
|
|
||||||
// this.$download.excel(response, '物料信息追溯 ');
|
|
||||||
// this.exportLoading = false;
|
|
||||||
// }).catch(() => { });
|
|
||||||
// },
|
|
||||||
buttonClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.listQuery.orderName = val.orderName ? val.orderName :undefined
|
|
||||||
// this.queryParams.status = val.status
|
|
||||||
if (val.timeVal && val.timeVal.length != 0 ) {
|
|
||||||
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
|
|
||||||
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
|
|
||||||
} else {
|
|
||||||
this.listQuery.startTime = undefined
|
|
||||||
this.listQuery.endTime = undefined
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
// this.handleExport()
|
|
||||||
// this.addOrEditTitle = '新增'
|
|
||||||
// this.centervisible = true
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.orderAdd.init()
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
otherMethods(val) {
|
|
||||||
this.addOrUpdateVisible = true;
|
|
||||||
this.addOrEditTitle = '详情';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,219 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: dialogForm.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-09-11 15:55:13
|
|
||||||
description: DialogForm for qualityInspectionRecord only
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-form ref="form" :model="innerDataForm" label-width="100px" v-loading="formLoading">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="工单名称" prop="workOrderId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select v-model="innerDataForm.workOrderId" placeholder="请选择工单名称" filterable clearable>
|
|
||||||
<el-option v-for="opt in workOrderList" :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="inspectionDetId"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select v-model="innerDataForm.inspectionDetId" placeholder="请选择检测内容" filterable clearable
|
|
||||||
@change="handleInspectionDetChange">
|
|
||||||
<el-option v-for="opt in inspectionDetList" :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="productionLineId"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select v-model="innerDataForm.productionLineId" placeholder="请选择产线" filterable clearable
|
|
||||||
@change="handleProductlineChange">
|
|
||||||
<el-option v-for="opt in productionLineList" :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="sectionId" :rules="[{ required: false, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select v-model="innerDataForm.sectionId" placeholder="请选择工段" clearable filterable
|
|
||||||
@change="$emit('update', innerDataForm)">
|
|
||||||
<el-option v-for="opt in sectionList" :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="checkPerson">
|
|
||||||
<el-input v-model="innerDataForm.checkPerson" clearable @change="$emit('update', innerDataForm)"
|
|
||||||
placeholder="请输入检测人员" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="检测时间" prop="checkTime" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-date-picker v-model="innerDataForm.checkTime" type="datetime" placeholder="请选择检测时间"
|
|
||||||
value-format="timestamp" @change="$emit('update', innerDataForm)"></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="来源" prop="source" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select v-model="innerDataForm.source" placeholder="请选择来源" filterable clearable
|
|
||||||
@change="$emit('update', innerDataForm)">
|
|
||||||
<el-option v-for="opt in [
|
|
||||||
{ label: '手动', value: 1 },
|
|
||||||
{ label: '自动', value: 2 },
|
|
||||||
]" :key="opt.value" :label="opt.label" :value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="innerDataForm.remark" @change="$emit('update', innerDataForm)" placeholder="请输入备注">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'DialogForm',
|
|
||||||
model: {
|
|
||||||
prop: 'dataForm',
|
|
||||||
event: 'update',
|
|
||||||
},
|
|
||||||
emits: ['update'],
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
dataForm: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formLoading: true,
|
|
||||||
inspectionDetList: [],
|
|
||||||
productionLineList: [],
|
|
||||||
sectionList: [],
|
|
||||||
workOrderList:[],
|
|
||||||
innerDataForm: {},
|
|
||||||
cacheInspectionDetList: null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Promise.all([this.getProductLineList(), this.getInspectionDetList(), this.getWorkOrderList()]).then(
|
|
||||||
() => {
|
|
||||||
this.formLoading = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
// 'innerDataForm.productionLineId': {
|
|
||||||
// handler: async function (plId) {
|
|
||||||
// if (plId) await this.getWorksectionList(plId);
|
|
||||||
// },
|
|
||||||
// immediate: true,
|
|
||||||
// },
|
|
||||||
dataForm: {
|
|
||||||
handler: function (dataForm) {
|
|
||||||
this.innerDataForm = Object.assign({}, dataForm);
|
|
||||||
|
|
||||||
if (dataForm.productionLineId)
|
|
||||||
this.getWorksectionList(dataForm.productionLineId);
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 模拟透传 ref */
|
|
||||||
validate(cb) {
|
|
||||||
return this.$refs.form.validate(cb);
|
|
||||||
},
|
|
||||||
resetFields(args) {
|
|
||||||
return this.$refs.form.resetFields(args);
|
|
||||||
},
|
|
||||||
|
|
||||||
handleInspectionDetChange(value) {
|
|
||||||
const { id, content } = this.cacheInspectionDetList.find(
|
|
||||||
(item) => item.id == value
|
|
||||||
);
|
|
||||||
this.innerDataForm.inspectionDetId = id;
|
|
||||||
this.innerDataForm.inspectionDetContent = content;
|
|
||||||
this.$emit('update', this.innerDataForm);
|
|
||||||
},
|
|
||||||
|
|
||||||
async handleProductlineChange(id) {
|
|
||||||
// await this.getWorksectionList(id);
|
|
||||||
this.innerDataForm.sectionId = null;
|
|
||||||
this.$emit('update', this.innerDataForm);
|
|
||||||
},
|
|
||||||
|
|
||||||
// getCode
|
|
||||||
async getCode(url) {
|
|
||||||
const response = await this.$axios(url);
|
|
||||||
return response.data;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取产线列表
|
|
||||||
async getProductLineList() {
|
|
||||||
const response = await this.$axios('/base/core-production-line/listAll');
|
|
||||||
this.productionLineList = response.data.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
|
|
||||||
async getWorkOrderList() {
|
|
||||||
const response = await this.$axios('base/core-work-order/listbyfilter');
|
|
||||||
this.workOrderList = response.data.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取检测内容列表
|
|
||||||
async getInspectionDetList() {
|
|
||||||
const response = await this.$axios(
|
|
||||||
'/base/quality-inspection-det/listAll'
|
|
||||||
);
|
|
||||||
this.cacheInspectionDetList = response.data;
|
|
||||||
this.inspectionDetList = response.data.map((item) => ({
|
|
||||||
label: item.content,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取工段列表
|
|
||||||
async getWorksectionList(plId) {
|
|
||||||
const response = await this.$axios(
|
|
||||||
'/base/core-workshop-section/listByParentId',
|
|
||||||
{
|
|
||||||
params: {
|
|
||||||
id: plId,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
this.sectionList = response.data.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.el-date-editor,
|
|
||||||
.el-select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: index.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-08-04 14:44:58
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="[{ label: '近24小时检测记录', type: 'title' }]"
|
|
||||||
ref="search-bar" />
|
|
||||||
<!-- <pre><code v-html="jsondemo"></code></pre> -->
|
|
||||||
|
|
||||||
<el-skeleton v-if="initing" :rows="6" animated />
|
|
||||||
<div v-else >
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun"></base-table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// import response from './response.json';
|
|
||||||
import { handleNameData, handleDynamicData } from '@/utils/dynamicProps';
|
|
||||||
// import hljs from 'highlight.js/lib/highlight';
|
|
||||||
// import json from 'highlight.js/lib/languages/json';
|
|
||||||
// import 'highlight.js/styles/github-gist.css';
|
|
||||||
|
|
||||||
// hljs.registerLanguage('json', json);
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'QualityRecentHours',
|
|
||||||
components: {},
|
|
||||||
props: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
initing: false,
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
list: [
|
|
||||||
// {
|
|
||||||
// inspectionContent: '检测内容1',
|
|
||||||
// '2023-03-18T00:00:00-产线1': '产线1-asdf',
|
|
||||||
// '2023-03-18T01:00:00-产线2': '产线2-kldf',
|
|
||||||
// '2023-03-18T02:00:00-产线1': '产线1-vasdkj',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
tableProps: [
|
|
||||||
{
|
|
||||||
prop: 'inspectionContent',
|
|
||||||
label: '检测内容',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
mounted() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async getList() {
|
|
||||||
const response = await this.$axios({
|
|
||||||
url: '/analysis/record-in-one-day/get',
|
|
||||||
method: 'get',
|
|
||||||
});
|
|
||||||
const {
|
|
||||||
data: { data: dyanmicData, nameData },
|
|
||||||
} = response;
|
|
||||||
|
|
||||||
this.initing = true;
|
|
||||||
const dynamicProps = handleNameData(nameData);
|
|
||||||
this.tableProps.push(...dynamicProps);
|
|
||||||
const dataList = handleDynamicData(dyanmicData);
|
|
||||||
this.list = dataList;
|
|
||||||
this.queryParams.pageSize = dataList.length;
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
this.initing = false;
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEmitFun(payload) {
|
|
||||||
console.log('payload', payload);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
margin: 10px;
|
|
||||||
background: #f6f8faf6;
|
|
||||||
border: 1px solid #e1e4e8;
|
|
||||||
padding: 12px;
|
|
||||||
border-radius: 12px;
|
|
||||||
position: fixed;
|
|
||||||
// top: 15vh;
|
|
||||||
top: 10vh;
|
|
||||||
left: 0;
|
|
||||||
max-height: 80vh;
|
|
||||||
overflow-y: auto;
|
|
||||||
z-index: 100000;
|
|
||||||
box-shadow: 0 0 32px 12px #0001;
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
font-family: 'IntelOne Mono', 'Ubuntu', 'Courier New', Courier, monospace;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
{
|
|
||||||
"tableProps": [
|
|
||||||
{
|
|
||||||
"prop": "inspectionContent",
|
|
||||||
"label": "检测内容",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T00:00:00",
|
|
||||||
"label": "2023-03-18T00:00:00",
|
|
||||||
"align": "center",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T00:00:00-产线1",
|
|
||||||
"label": "产线1",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T00:00:00-产线2",
|
|
||||||
"label": "产线2",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T00:00:00-产线3",
|
|
||||||
"label": "产线3",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T00:00:00-产线4",
|
|
||||||
"label": "产线4",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T00:00:00-产线5",
|
|
||||||
"label": "产线5",
|
|
||||||
"align": "center"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T01:00:00",
|
|
||||||
"label": "2023-03-18T01:00:00",
|
|
||||||
"align": "center",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T01:00:00-产线1",
|
|
||||||
"label": "产线1",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T01:00:00-产线2",
|
|
||||||
"label": "产线2",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T01:00:00-产线3",
|
|
||||||
"label": "产线3",
|
|
||||||
"align": "center"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T02:00:00",
|
|
||||||
"label": "2023-03-18T02:00:00",
|
|
||||||
"align": "center",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T02:00:00-产线1",
|
|
||||||
"label": "产线1",
|
|
||||||
"align": "center"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prop": "2023-03-18T02:00:00-产线2",
|
|
||||||
"label": "产线2",
|
|
||||||
"align": "center"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
{
|
|
||||||
"code": 0,
|
|
||||||
"data": {
|
|
||||||
"data": [
|
|
||||||
{
|
|
||||||
"data": [
|
|
||||||
{
|
|
||||||
"id": "测试222023-08-09T02:00",
|
|
||||||
"parentId": "测试22",
|
|
||||||
"dynamicName": "2023-08-09T02:00",
|
|
||||||
"dynamicValue": 1691517600000,
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试222023-08-09T02:00",
|
|
||||||
"dynamicName": "产线1",
|
|
||||||
"dynamicValue": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "测试222023-08-09T08:00",
|
|
||||||
"parentId": "测试22",
|
|
||||||
"dynamicName": "2023-08-09T08:00",
|
|
||||||
"dynamicValue": 1691539200000,
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试222023-08-09T08:00",
|
|
||||||
"dynamicName": "产线1",
|
|
||||||
"dynamicValue": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "测试222023-08-09T11:00",
|
|
||||||
"parentId": "测试22",
|
|
||||||
"dynamicName": "2023-08-09T11:00",
|
|
||||||
"dynamicValue": 1691550000000,
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试222023-08-09T11:00",
|
|
||||||
"dynamicName": "产线1",
|
|
||||||
"dynamicValue": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"inspectionDetContent": "测试22"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data": [
|
|
||||||
{
|
|
||||||
"id": "测试112023-08-09T02:00",
|
|
||||||
"parentId": "测试11",
|
|
||||||
"dynamicName": "2023-08-09T02:00",
|
|
||||||
"dynamicValue": 1691517600000,
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "1672847052717821954",
|
|
||||||
"parentId": "测试112023-08-09T02:00",
|
|
||||||
"dynamicName": "产线22",
|
|
||||||
"dynamicValue": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "测试112023-08-09T08:00",
|
|
||||||
"parentId": "测试11",
|
|
||||||
"dynamicName": "2023-08-09T08:00",
|
|
||||||
"dynamicValue": 1691539200000,
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试112023-08-09T08:00",
|
|
||||||
"dynamicName": "产线1",
|
|
||||||
"dynamicValue": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "测试112023-08-09T09:00",
|
|
||||||
"parentId": "测试11",
|
|
||||||
"dynamicName": "2023-08-09T09:00",
|
|
||||||
"dynamicValue": 1691542800000,
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "1672847052717821954",
|
|
||||||
"parentId": "测试112023-08-09T09:00",
|
|
||||||
"dynamicName": "产线22",
|
|
||||||
"dynamicValue": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"inspectionDetContent": "测试11"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nameData": [
|
|
||||||
{
|
|
||||||
"name": "2023-08-09T02:00",
|
|
||||||
"tree": 1,
|
|
||||||
"id": "测试222023-08-09T02:00",
|
|
||||||
"parentId": "测试22"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "产线1",
|
|
||||||
"tree": 2,
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试222023-08-09T02:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "2023-08-09T08:00",
|
|
||||||
"tree": 1,
|
|
||||||
"id": "测试222023-08-09T08:00",
|
|
||||||
"parentId": "测试22"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "产线1",
|
|
||||||
"tree": 2,
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试222023-08-09T08:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "2023-08-09T11:00",
|
|
||||||
"tree": 1,
|
|
||||||
"id": "测试222023-08-09T11:00",
|
|
||||||
"parentId": "测试22"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "产线1",
|
|
||||||
"tree": 2,
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试222023-08-09T11:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "2023-08-09T02:00",
|
|
||||||
"tree": 1,
|
|
||||||
"id": "测试112023-08-09T02:00",
|
|
||||||
"parentId": "测试11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "产线22",
|
|
||||||
"tree": 2,
|
|
||||||
"id": "1672847052717821954",
|
|
||||||
"parentId": "测试112023-08-09T02:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "2023-08-09T08:00",
|
|
||||||
"tree": 1,
|
|
||||||
"id": "测试112023-08-09T08:00",
|
|
||||||
"parentId": "测试11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "产线1",
|
|
||||||
"tree": 2,
|
|
||||||
"id": "1672847052717821953",
|
|
||||||
"parentId": "测试112023-08-09T08:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "2023-08-09T09:00",
|
|
||||||
"tree": 1,
|
|
||||||
"id": "测试112023-08-09T09:00",
|
|
||||||
"parentId": "测试11"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "产线22",
|
|
||||||
"tree": 2,
|
|
||||||
"id": "1672847052717821954",
|
|
||||||
"parentId": "测试112023-08-09T09:00"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"msg": ""
|
|
||||||
}
|
|
||||||
@@ -1,243 +1,160 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2023-08-01 14:55:51
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @LastEditTime: 2023-11-10 16:26:45
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar
|
||||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
|
:formConfigs="formConfig"
|
||||||
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
ref="searchBarForm"
|
||||||
@clickBtn="handleClick" /> -->
|
@headBtnClick="buttonClick" />
|
||||||
</base-table>
|
<base-table
|
||||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
:table-props="tableProps"
|
||||||
@pagination="getList" />
|
:page="listQuery.pageNo"
|
||||||
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
|
:limit="listQuery.pageSize"
|
||||||
</div>
|
:table-data="list"
|
||||||
|
:max-height="tableH"></base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import AddOrUpdate from './add-or-updata';
|
|
||||||
// import unitDict from './unitDict';
|
|
||||||
// import basicPage from '../mixins/basic-page';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict';
|
||||||
import { parseTime } from '../mixins/code-filter';
|
import { parseTime } from '../mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getRawMaterialPage,
|
getRawMaterialPage,
|
||||||
getWorkOrderList,
|
getWorkOrderList,
|
||||||
// exportEnergyPlcExcel
|
|
||||||
} from '@/api/quality/rawMaterialTraceability';
|
} from '@/api/quality/rawMaterialTraceability';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
filter: parseTime
|
filter: parseTime,
|
||||||
},
|
width: 150,
|
||||||
{
|
},
|
||||||
prop: 'material',
|
{
|
||||||
label: '原料名称',
|
prop: 'material',
|
||||||
filter: publicFormatter('material')
|
label: '原料名称',
|
||||||
},
|
filter: publicFormatter('material'),
|
||||||
{
|
showOverflowtooltip: true,
|
||||||
prop: 'origin',
|
},
|
||||||
label: '来源',
|
{
|
||||||
filter: (val)=>val == 1 ? '内部' : '外部'
|
prop: 'origin',
|
||||||
},
|
label: '来源',
|
||||||
{
|
filter: (val) => (val == 1 ? '内部' : '外部'),
|
||||||
prop: 'supplierId',
|
},
|
||||||
label: '供应商'
|
{
|
||||||
},
|
prop: 'supplierName',
|
||||||
{
|
label: '供应商',
|
||||||
prop: 'batch',
|
},
|
||||||
label: '批次'
|
{
|
||||||
},
|
prop: 'batch',
|
||||||
{
|
label: '批次',
|
||||||
prop: 'num',
|
showOverflowtooltip: true,
|
||||||
label: '数量'
|
},
|
||||||
},
|
{
|
||||||
{
|
prop: 'num',
|
||||||
prop: 'unit',
|
label: '数量',
|
||||||
label: '单位',
|
},
|
||||||
filter: publicFormatter('unit_dict')
|
{
|
||||||
}
|
prop: 'unit',
|
||||||
|
label: '单位',
|
||||||
|
filter: publicFormatter('unit_dict'),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// mixins: [basicPage],
|
mixins: [tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// urlOptions: {
|
tableProps,
|
||||||
// getDataListURL: getMaterialUseLogPage,
|
tableBtn: [
|
||||||
// // deleteURL: deletePackingType,
|
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||||
// // exportURL: exportPackingExcel,
|
? {
|
||||||
// },
|
type: 'edit',
|
||||||
tableProps,
|
btnName: '编辑',
|
||||||
tableBtn: [
|
}
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
: undefined,
|
||||||
? {
|
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||||
type: 'edit',
|
? {
|
||||||
btnName: '编辑',
|
type: 'delete',
|
||||||
}
|
btnName: '删除',
|
||||||
: undefined,
|
}
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
: undefined,
|
||||||
? {
|
].filter((v) => v),
|
||||||
type: 'delete',
|
list: [],
|
||||||
btnName: '删除',
|
listQuery: {
|
||||||
}
|
pageSize: 10,
|
||||||
: undefined,
|
pageNo: 1,
|
||||||
|
workOrderId: undefined,
|
||||||
].filter((v) => v),
|
startTime: undefined,
|
||||||
list: [],
|
endTime: undefined,
|
||||||
listQuery: {
|
},
|
||||||
pageSize: 10,
|
total: 0,
|
||||||
pageNo: 1,
|
formConfig: [
|
||||||
total: 0,
|
{
|
||||||
workOrderId: undefined,
|
type: 'select',
|
||||||
startTime: undefined,
|
label: '工单名称',
|
||||||
endTime:undefined,
|
selectOptions: [],
|
||||||
},
|
labelField: 'name',
|
||||||
formConfig: [
|
valueField: 'id',
|
||||||
{
|
param: 'workOrderId',
|
||||||
type: 'select',
|
clearable: false,
|
||||||
label: '工单',
|
filterable: true,
|
||||||
selectOptions: [],
|
defaultSelect: '',
|
||||||
labelField: 'name',
|
},
|
||||||
valueField: 'id',
|
{
|
||||||
param: 'workOrderId'
|
type: 'button',
|
||||||
},
|
btnName: '查询',
|
||||||
// {
|
name: 'search',
|
||||||
// type: 'datePicker',
|
color: 'primary',
|
||||||
// label: '时间段',
|
},
|
||||||
// dateType: 'daterange',
|
],
|
||||||
// format: 'yyyy-MM-dd',
|
};
|
||||||
// valueFormat: "yyyy-MM-dd",
|
},
|
||||||
// rangeSeparator: '-',
|
created() {
|
||||||
// startPlaceholder: '开始时间',
|
this.getDict();
|
||||||
// endPlaceholder: '结束时间',
|
},
|
||||||
// param: 'timeVal',
|
methods: {
|
||||||
// defaultSelect: [],
|
getList() {
|
||||||
// width: 250
|
getRawMaterialPage({ ...this.listQuery }).then((res) => {
|
||||||
// },
|
this.list = res.data.records || [];
|
||||||
{
|
this.total = res.data.total || 0;
|
||||||
type: 'button',
|
});
|
||||||
btnName: '搜索',
|
},
|
||||||
name: 'search',
|
getDict() {
|
||||||
color: 'primary',
|
getWorkOrderList().then((response) => {
|
||||||
},
|
this.formConfig[0].selectOptions = response.data.map((item) => {
|
||||||
// {
|
return {
|
||||||
// type: 'separate',
|
name: item.name,
|
||||||
// },
|
id: item.id,
|
||||||
// {
|
};
|
||||||
// type: 'button',
|
});
|
||||||
// btnName: '重置',
|
this.formConfig[0].defaultSelect =
|
||||||
// name: 'reset',
|
this.formConfig[0].selectOptions[0].id || '';
|
||||||
// },
|
this.listQuery.workOrderId =
|
||||||
// {
|
this.formConfig[0].selectOptions[0].id || '';
|
||||||
// type: 'separate',
|
this.getList();
|
||||||
// },
|
});
|
||||||
// {
|
},
|
||||||
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
buttonClick(val) {
|
||||||
// btnName: '新增',
|
console.log(val);
|
||||||
// name: 'add',
|
if (val.btnName === 'search') {
|
||||||
// color: 'success',
|
this.listQuery.workOrderId = val.workOrderId
|
||||||
// plain: true,
|
? val.workOrderId
|
||||||
// },
|
: undefined;
|
||||||
// {
|
this.getList();
|
||||||
// type: 'separate',
|
}
|
||||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
},
|
||||||
// },
|
otherMethods(val) {
|
||||||
// {
|
this.addOrUpdateVisible = true;
|
||||||
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
|
this.addOrEditTitle = '详情';
|
||||||
// btnName: '导出',
|
this.$nextTick(() => {
|
||||||
// name: 'export',
|
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
// color: 'warning',
|
});
|
||||||
// },
|
},
|
||||||
],
|
},
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
// AddOrUpdate,
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList()
|
|
||||||
this.getDict()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList() {
|
|
||||||
getRawMaterialPage({ ...this.listQuery }).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.listQuery.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getDict() {
|
|
||||||
// 获取产品的属性列表
|
|
||||||
// getCustomerList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
// this.customerList = response.data
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getModelList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
// this.modelList = response.data
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
getWorkOrderList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
this.formConfig[0].selectOptions = response.data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log(this.formConfig[0].selectOptions);
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// handleExport() {
|
|
||||||
// // 处理查询参数
|
|
||||||
// let params = { ...this.listQuery };
|
|
||||||
// params.pageNo = undefined;
|
|
||||||
// params.pageSize = undefined;
|
|
||||||
// this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
|
||||||
// this.exportLoading = true;
|
|
||||||
// return exportEnergyPlcExcel(params);
|
|
||||||
// }).then(response => {
|
|
||||||
// this.$download.excel(response, '物料信息追溯 ');
|
|
||||||
// this.exportLoading = false;
|
|
||||||
// }).catch(() => { });
|
|
||||||
// },
|
|
||||||
buttonClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
|
|
||||||
// this.queryParams.status = val.status
|
|
||||||
// if (val.timeVal && val.timeVal.length != 0 ) {
|
|
||||||
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
|
|
||||||
// this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
|
|
||||||
// } else {
|
|
||||||
// this.listQuery.startTime = undefined
|
|
||||||
// this.listQuery.endTime = undefined
|
|
||||||
// }
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
// this.handleExport()
|
|
||||||
// this.addOrEditTitle = '新增'
|
|
||||||
// this.centervisible = true
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.orderAdd.init()
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
otherMethods(val) {
|
|
||||||
this.addOrUpdateVisible = true;
|
|
||||||
this.addOrEditTitle = '详情';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,11 +12,29 @@
|
|||||||
label-width="100px"
|
label-width="100px"
|
||||||
v-loading="formLoading">
|
v-loading="formLoading">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item
|
||||||
|
label="工单名称"
|
||||||
|
prop="workOrderId"
|
||||||
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
|
<el-select
|
||||||
|
v-model="innerDataForm.workOrderId"
|
||||||
|
placeholder="请选择工单名称"
|
||||||
|
filterable
|
||||||
|
clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="opt in workOrderList"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="检测内容"
|
label="检测内容"
|
||||||
prop="inspectionDetId"
|
prop="inspectionDetId"
|
||||||
:rules="[{ required: true, message: '检测内容不能为空', trigger: 'blur' }]">
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="innerDataForm.inspectionDetId"
|
v-model="innerDataForm.inspectionDetId"
|
||||||
placeholder="请选择检测内容"
|
placeholder="请选择检测内容"
|
||||||
@@ -31,12 +49,78 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item
|
||||||
|
label="产线"
|
||||||
|
prop="productionLineId"
|
||||||
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
|
<el-select
|
||||||
|
v-model="innerDataForm.productionLineId"
|
||||||
|
placeholder="请选择产线"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
@change="handleProductlineChange">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in productionLineList"
|
||||||
|
: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="sectionId"
|
||||||
|
:rules="[{ required: false, message: '不能为空', trigger: 'blur' }]">
|
||||||
|
<el-select
|
||||||
|
v-model="innerDataForm.sectionId"
|
||||||
|
placeholder="请选择工段"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="$emit('update', innerDataForm)">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in sectionList"
|
||||||
|
: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="checkPerson">
|
||||||
|
<el-input
|
||||||
|
v-model="innerDataForm.checkPerson"
|
||||||
|
clearable
|
||||||
|
@change="$emit('update', innerDataForm)"
|
||||||
|
placeholder="请输入检测人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item
|
||||||
|
label="检测时间"
|
||||||
|
prop="checkTime"
|
||||||
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="innerDataForm.checkTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="请选择检测时间"
|
||||||
|
value-format="timestamp"
|
||||||
|
@change="$emit('update', innerDataForm)"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="来源"
|
label="来源"
|
||||||
prop="source"
|
prop="source"
|
||||||
:rules="[{ required: true, message: '来源不能为空', trigger: 'blur' }]">
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="innerDataForm.source"
|
v-model="innerDataForm.source"
|
||||||
placeholder="请选择来源"
|
placeholder="请选择来源"
|
||||||
@@ -56,81 +140,6 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="产线"
|
|
||||||
prop="productionLineId"
|
|
||||||
:rules="[{ required: true, message: '产线不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="innerDataForm.productionLineId"
|
|
||||||
placeholder="请选择产线"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
@change="handleProductlineChange">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in productionLineList"
|
|
||||||
: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="sectionId"
|
|
||||||
:rules="[{ required: true, message: '工段不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="innerDataForm.sectionId"
|
|
||||||
placeholder="请选择工段"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
@change="$emit('update', innerDataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in sectionList"
|
|
||||||
: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="checkPerson">
|
|
||||||
<el-input
|
|
||||||
v-model="innerDataForm.checkPerson"
|
|
||||||
clearable
|
|
||||||
@change="$emit('update', innerDataForm)"
|
|
||||||
placeholder="请输入检测人员" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="检测时间"
|
|
||||||
prop="checkTime"
|
|
||||||
:rules="[{ required: true, message: '检测时间不能为空', trigger: 'blur' }]">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="innerDataForm.checkTime"
|
|
||||||
type="datetime"
|
|
||||||
placeholder="请选择检测时间"
|
|
||||||
value-format="timestamp"
|
|
||||||
@change="$emit('update', innerDataForm)"></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="描述" prop="explainText">
|
|
||||||
<el-input
|
|
||||||
v-model="innerDataForm.explainText"
|
|
||||||
placeholder="请输入描述信息"
|
|
||||||
@change="$emit('update', innerDataForm)"
|
|
||||||
type="textarea"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input
|
<el-input
|
||||||
@@ -164,16 +173,19 @@ export default {
|
|||||||
inspectionDetList: [],
|
inspectionDetList: [],
|
||||||
productionLineList: [],
|
productionLineList: [],
|
||||||
sectionList: [],
|
sectionList: [],
|
||||||
|
workOrderList: [],
|
||||||
innerDataForm: {},
|
innerDataForm: {},
|
||||||
cacheInspectionDetList: null,
|
cacheInspectionDetList: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
Promise.all([this.getProductLineList(), this.getInspectionDetList()]).then(
|
Promise.all([
|
||||||
() => {
|
this.getProductLineList(),
|
||||||
this.formLoading = false;
|
this.getInspectionDetList(),
|
||||||
}
|
this.getWorkOrderList(),
|
||||||
);
|
]).then(() => {
|
||||||
|
this.formLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 'innerDataForm.productionLineId': {
|
// 'innerDataForm.productionLineId': {
|
||||||
@@ -224,13 +236,21 @@ export default {
|
|||||||
|
|
||||||
// 获取产线列表
|
// 获取产线列表
|
||||||
async getProductLineList() {
|
async getProductLineList() {
|
||||||
const response = await this.$axios('/base/core-production-line/listAll');
|
const response = await this.$axios('/base/core-production-line/listAll');
|
||||||
this.productionLineList = response.data.map((item) => ({
|
this.productionLineList = response.data.map((item) => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id,
|
value: item.id,
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async getWorkOrderList() {
|
||||||
|
const response = await this.$axios('base/core-work-order/listbyfilter');
|
||||||
|
this.workOrderList = response.data.map((item) => ({
|
||||||
|
label: item.name,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
// 获取检测内容列表
|
// 获取检测内容列表
|
||||||
async getInspectionDetList() {
|
async getInspectionDetList() {
|
||||||
const response = await this.$axios(
|
const response = await this.$axios(
|
||||||
@@ -246,7 +266,7 @@ export default {
|
|||||||
// 获取工段列表
|
// 获取工段列表
|
||||||
async getWorksectionList(plId) {
|
async getWorksectionList(plId) {
|
||||||
const response = await this.$axios(
|
const response = await this.$axios(
|
||||||
'/base/workshop-section/listByParentId',
|
'/base/core-workshop-section/listByParentId',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
id: plId,
|
id: plId,
|
||||||
@@ -12,12 +12,13 @@
|
|||||||
:page="queryParams.pageNo"
|
:page="queryParams.pageNo"
|
||||||
:limit="queryParams.pageSize"
|
:limit="queryParams.pageSize"
|
||||||
:table-data="list"
|
:table-data="list"
|
||||||
@emitFun="handleEmitFun">
|
@emitFun="handleEmitFun"
|
||||||
|
:max-height="tableH">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
label="操作"
|
label="操作"
|
||||||
:width="120"
|
:width="80"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleTableBtnClick" />
|
@clickBtn="handleTableBtnClick" />
|
||||||
@@ -58,102 +59,29 @@ import moment from 'moment';
|
|||||||
import DialogForm from './dialogForm.vue';
|
import DialogForm from './dialogForm.vue';
|
||||||
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
export default {
|
export default {
|
||||||
name: 'QualityInspectionRecord',
|
name: 'QualityInspectionRecord',
|
||||||
components: {
|
components: {
|
||||||
DialogForm,
|
DialogForm,
|
||||||
},
|
},
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin, tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '检测内容',
|
|
||||||
url: '/base/quality-inspection-det/listAll',
|
|
||||||
prop: 'inspectionDetId',
|
|
||||||
labelKey: 'content',
|
|
||||||
rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '来源',
|
|
||||||
prop: 'source',
|
|
||||||
value: 1, // 默认手动
|
|
||||||
options: [
|
|
||||||
{ label: '手动', value: 1 },
|
|
||||||
{ label: '自动', value: 2 },
|
|
||||||
],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '产线',
|
|
||||||
url: '/base/production-line/listAll',
|
|
||||||
prop: 'productionLineId',
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '工段',
|
|
||||||
url: '/base/workshop-section/listAll', // 这个 url 其实可加可不加,因为下面会更新 options
|
|
||||||
options: [], // 这个options也可加可不加, 因为下面会更新 options
|
|
||||||
prop: 'sectionId',
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
rules: [{ required: false, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '检测人员',
|
|
||||||
prop: 'checkPerson',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
datetime: true,
|
|
||||||
label: '检测时间',
|
|
||||||
prop: 'checkTime',
|
|
||||||
rules: [{ required: true, message: '检测时间不能为空', trigger: 'blur' }],
|
|
||||||
bind: {
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
'value-format': 'timestamp',
|
|
||||||
// 'value-format': 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
clearable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[{ textarea: true, label: '描述', prop: 'explainText' }],
|
|
||||||
[{ input: true, label: '备注', prop: 'remark' }],
|
|
||||||
],
|
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '工单名称',
|
label: '工单名称',
|
||||||
placeholder: '请选择工单名称',
|
|
||||||
param: 'workOrderId',
|
param: 'workOrderId',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
filterable:true
|
filterable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '检测内容',
|
label: '检测内容',
|
||||||
placeholder: '请输入检测内容',
|
selectOptions: [],
|
||||||
selectOptions: [],
|
param: 'inspectionDetContent',
|
||||||
param: 'inspectionDetContent',
|
filterable: true,
|
||||||
filterable: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
@@ -179,9 +107,7 @@ export default {
|
|||||||
type: 'separate',
|
type: 'separate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi(
|
type: this.$auth.hasPermi('base:quality-inspection-record:create')
|
||||||
'base:quality-inspection-record:create'
|
|
||||||
)
|
|
||||||
? 'button'
|
? 'button'
|
||||||
: '',
|
: '',
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
@@ -194,10 +120,10 @@ export default {
|
|||||||
this.$auth.hasPermi('base:quality-inspection-record:update')
|
this.$auth.hasPermi('base:quality-inspection-record:update')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '修改',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('base:quality-inspection-record:delete')
|
this.$auth.hasPermi('base:quality-inspection-record:delete')
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
@@ -208,32 +134,31 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
fixed: true,
|
width: 160,
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// width: 128,
|
prop: 'workOrderName',
|
||||||
prop: 'workOrderName',
|
label: '工单名称',
|
||||||
label: '工单名称',
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// width: 128,
|
|
||||||
prop: 'inspectionDetContent',
|
prop: 'inspectionDetContent',
|
||||||
label: '检测内容',
|
label: '检测内容',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// width: 128,
|
prop: 'productionLineName',
|
||||||
prop: 'lineName',
|
|
||||||
label: '产线',
|
label: '产线',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// width: 128,
|
|
||||||
prop: 'checkPerson',
|
prop: 'checkPerson',
|
||||||
label: '检测人员',
|
label: '检测人员',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// width: 160,
|
width: 160,
|
||||||
prop: 'checkTime',
|
prop: 'checkTime',
|
||||||
label: '检测时间',
|
label: '检测时间',
|
||||||
filter: (val) =>
|
filter: (val) =>
|
||||||
@@ -247,25 +172,25 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
||||||
searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
|
searchBarKeys: ['workOrderId', 'inspectionDetContent', 'checkTime'],
|
||||||
form: {
|
form: {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
inspectionDetId: undefined,
|
inspectionDetId: undefined,
|
||||||
inspectionDetContent: undefined,
|
inspectionDetContent: undefined,
|
||||||
productionLineId: undefined,
|
productionLineId: undefined,
|
||||||
sectionId: undefined,
|
sectionId: undefined,
|
||||||
checkPerson: undefined,
|
checkPerson: undefined,
|
||||||
workOrderId:undefined,
|
workOrderId: undefined,
|
||||||
checkTime: undefined,
|
checkTime: undefined,
|
||||||
source: undefined,
|
source: undefined,
|
||||||
explainText: undefined,
|
workOrderId: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
},
|
},
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
workOrderId:null,
|
workOrderId: null,
|
||||||
inspectionDetContent: null,
|
inspectionDetContent: null,
|
||||||
checkTime: [],
|
checkTime: [],
|
||||||
// productionLineId: null,
|
// productionLineId: null,
|
||||||
@@ -274,43 +199,20 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getProductLineList()
|
this.getProductLineList();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
form: {
|
form: {
|
||||||
handler: function (val) {
|
handler: function (val) {
|
||||||
console.log('form change:', val);
|
console.log('form change:', val);
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true,
|
||||||
}
|
},
|
||||||
// 注册弹窗里产线改变时的监听事件
|
|
||||||
// 'form.productionLineId': {
|
|
||||||
// handler: function (val) {
|
|
||||||
// if (val == null) return;
|
|
||||||
// this.$axios('/base/workshop-section/listByParentId', {
|
|
||||||
// params: {
|
|
||||||
// id: val,
|
|
||||||
// },
|
|
||||||
// }).then((response) => {
|
|
||||||
// this.$set(
|
|
||||||
// this.rows[1][1], // 这里索引是硬编码,所以当 this.rows 里数据顺序改变时,此处也要改
|
|
||||||
// 'options',
|
|
||||||
// response.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// label: item.name,
|
|
||||||
// value: item.id,
|
|
||||||
// };
|
|
||||||
// })
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// immediate: true,
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 获取搜索栏的产线列表 */
|
/** 获取搜索栏的产线列表 */
|
||||||
getProductLineList() {
|
getProductLineList() {
|
||||||
this.$axios('/base/core-work-order/listbyfilter').then((response) => {
|
this.$axios('/base/core-work-order/listbyfilter').then((response) => {
|
||||||
this.searchBarFormConfig[0].selectOptions = response.data.map(
|
this.searchBarFormConfig[0].selectOptions = response.data.map(
|
||||||
(item) => {
|
(item) => {
|
||||||
return {
|
return {
|
||||||
@@ -319,17 +221,17 @@ export default {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
})
|
});
|
||||||
this.$axios('/base/quality-inspection-det/listAll').then((response) => {
|
this.$axios('/base/quality-inspection-det/listAll').then((response) => {
|
||||||
this.searchBarFormConfig[1].selectOptions = response.data.map(
|
this.searchBarFormConfig[1].selectOptions = response.data.map(
|
||||||
(item) => {
|
(item) => {
|
||||||
return {
|
return {
|
||||||
name: item.content,
|
name: item.content,
|
||||||
id: item.content,
|
id: item.content,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
getList() {
|
getList() {
|
||||||
@@ -356,7 +258,7 @@ export default {
|
|||||||
checkPerson: undefined,
|
checkPerson: undefined,
|
||||||
checkTime: undefined,
|
checkTime: undefined,
|
||||||
source: undefined,
|
source: undefined,
|
||||||
explainText: undefined,
|
workOrderId: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
productionLineId: undefined,
|
productionLineId: undefined,
|
||||||
};
|
};
|
||||||
@@ -376,7 +278,7 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加质量检查信息记录表';
|
this.title = '新增';
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@@ -384,13 +286,13 @@ export default {
|
|||||||
const id = row.id;
|
const id = row.id;
|
||||||
getQualityInspectionRecord(id).then((response) => {
|
getQualityInspectionRecord(id).then((response) => {
|
||||||
/** 因为后端返回的时间是时间戳格式,需转换 */
|
/** 因为后端返回的时间是时间戳格式,需转换 */
|
||||||
const info = {}
|
const info = {};
|
||||||
Object.keys(this.form).forEach(key => {
|
Object.keys(this.form).forEach((key) => {
|
||||||
info[key] = response.data[key]
|
info[key] = response.data[key];
|
||||||
});
|
});
|
||||||
this.form = info;
|
this.form = info;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改质量检查信息记录表';
|
this.title = '编辑';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@@ -420,7 +322,7 @@ export default {
|
|||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除"' + row.inspectionDetContent + '"?')
|
.delConfirm(row.inspectionDetContent)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return deleteQualityInspectionRecord(id);
|
return deleteQualityInspectionRecord(id);
|
||||||
})
|
})
|
||||||
269
src/views/quality/qualityScrapLog/add-or-updata.vue
Normal file
269
src/views/quality/qualityScrapLog/add-or-updata.vue
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="auto">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工单名称" prop="workOrderId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.workOrderId"
|
||||||
|
placeholder="请选择工单名称"
|
||||||
|
style="width: 100%"
|
||||||
|
:disabled="showDetail">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in workOrderList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="班组" prop="teamId" :disabled="showDetail">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.teamId"
|
||||||
|
placeholder="请选择班组"
|
||||||
|
style="width: 100%"
|
||||||
|
:disabled="showDetail">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in teamList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="数量" prop="num" style="width: 100%">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.num"
|
||||||
|
placeholder="请输入数量"
|
||||||
|
:disabled="showDetail" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="产线" prop="lineId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.lineId"
|
||||||
|
placeholder="请选择产线"
|
||||||
|
style="width: 100%"
|
||||||
|
:disabled="showDetail">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in lineList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报废原因" prop="detId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.detId"
|
||||||
|
placeholder="请选择报废原因"
|
||||||
|
style="width: 100%"
|
||||||
|
:disabled="showDetail">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in detList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报废时间" prop="logTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dataForm.logTime"
|
||||||
|
type="datetime"
|
||||||
|
label-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
value-format="timestamp"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="选择日期"
|
||||||
|
:disabled="showDetail"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="来源" prop="source">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.source"
|
||||||
|
placeholder="请选择来源"
|
||||||
|
style="width: 100%"
|
||||||
|
:disabled="showDetail">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sourceList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="描述" prop="description">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.description"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||||
|
:disabled="showDetail" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.remark"
|
||||||
|
placeholder="备注"
|
||||||
|
:disabled="showDetail" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
createQualityScrapLog,
|
||||||
|
updateQualityScrapLog,
|
||||||
|
getQualityScrapLog,
|
||||||
|
getWorkOrderList,
|
||||||
|
getTeamList,
|
||||||
|
getDetList,
|
||||||
|
getLineList,
|
||||||
|
} from '@/api/base/qualityScrapLog';
|
||||||
|
// import { getList } from '@/api/base/qualityScrapType';
|
||||||
|
import moment from 'moment';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lineList: [],
|
||||||
|
workOrderList: [],
|
||||||
|
detList: [],
|
||||||
|
teamList: [],
|
||||||
|
sourceList: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: '手动',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: '自动',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
logTime: undefined,
|
||||||
|
source: 1,
|
||||||
|
detId: undefined,
|
||||||
|
workOrderId: null,
|
||||||
|
teamId: undefined,
|
||||||
|
num: null,
|
||||||
|
lineId: undefined,
|
||||||
|
description: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
workOrderId: [
|
||||||
|
{ required: true, message: '工单号不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
|
||||||
|
detId: [
|
||||||
|
{ required: true, message: '报废原因不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
|
||||||
|
logTime: [
|
||||||
|
{ required: true, message: '报废时间不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
showDetail: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(id, show) {
|
||||||
|
this.showDetail = show ? true : false;
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
if (id) {
|
||||||
|
// 编辑
|
||||||
|
getQualityScrapLog(id).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.dataForm = res.data;
|
||||||
|
this.dataForm.logTime = res.data.logTime || null;
|
||||||
|
console.log('==================');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.dataForm.logTime = moment().format('yyyy-MM-DD hh:mm:ss');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 修改的提交
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
updateQualityScrapLog(this.dataForm).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createQualityScrapLog(this.dataForm).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
// 物料列表
|
||||||
|
getWorkOrderList().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.workOrderList = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
getLineList().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.lineList = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
getDetList().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.detList = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.content,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
getTeamList().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.teamList = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
formClear() {
|
||||||
|
this.$refs.dataForm.resetFields();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
159
src/views/quality/qualityScrapLog/basic-page.js
Normal file
159
src/views/quality/qualityScrapLog/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.detContent)
|
||||||
|
} else if (val.type === "change") {
|
||||||
|
this.changeStatus(val.data.id)
|
||||||
|
} else {
|
||||||
|
this.otherMethods(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle(id, detContent) {
|
||||||
|
this.$modal
|
||||||
|
.delConfirm(detContent)
|
||||||
|
.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(() => { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
252
src/views/quality/qualityScrapLog/index.vue
Normal file
252
src/views/quality/qualityScrapLog/index.vue
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
<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"
|
||||||
|
:max-height="tableH">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="110"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="50%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
<el-row slot="footer" type="flex" justify="end">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-button size="small" class="btnTextStyle" @click="handleCancel">
|
||||||
|
{{ this.addOrEditTitle === '详情' ? '关闭' : '取消' }}
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-show="this.addOrEditTitle !== '详情'"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
class="btnTextStyle"
|
||||||
|
@click="handleConfirm">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
|
||||||
|
import basicPage from './basic-page';
|
||||||
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
|
import {
|
||||||
|
getQualityScrapLogPage,
|
||||||
|
deleteQualityScrapLog,
|
||||||
|
getWorkOrderList,
|
||||||
|
getTeamList,
|
||||||
|
} from '@/api/base/qualityScrapLog';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
filter: parseTime,
|
||||||
|
width: 160,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'workOrderName',
|
||||||
|
label: '工单',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'teamName',
|
||||||
|
label: '班组',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'detContent',
|
||||||
|
label: '报废原因',
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'logTime',
|
||||||
|
label: '报废时间',
|
||||||
|
filter: parseTime,
|
||||||
|
width: 160,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'num',
|
||||||
|
label: '数量',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage, tableHeightMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getQualityScrapLogPage,
|
||||||
|
deleteURL: deleteQualityScrapLog,
|
||||||
|
// exportURL: exportFactoryExcel,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`base:quality-scrap-log:detail`)
|
||||||
|
? {
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '详情',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`base:quality-scrap-log:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`base:quality-scrap-log:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '工单名称',
|
||||||
|
selectOptions: [],
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
param: 'workOrderId',
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '班组',
|
||||||
|
selectOptions: [],
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
param: 'teamId',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:quality-scrap-log:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
teamList: [],
|
||||||
|
showDetail: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDict();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
otherMethods(val) {
|
||||||
|
if (val.type === 'detail') {
|
||||||
|
this.addOrEditTitle = '详情';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
getDict() {
|
||||||
|
getWorkOrderList().then((res) => {
|
||||||
|
this.formConfig[0].selectOptions = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
getTeamList().then((res) => {
|
||||||
|
this.formConfig[1].selectOptions = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.teamList = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||||
|
let arr = response.data.list;
|
||||||
|
arr.forEach((item) => {
|
||||||
|
item.teamName = this.teamList.find((v) => v.id == item.teamId)
|
||||||
|
? this.teamList.find((v) => v.id == item.teamId).name
|
||||||
|
: '';
|
||||||
|
});
|
||||||
|
this.tableData = arr;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.workOrderId = val.workOrderId
|
||||||
|
? val.workOrderId
|
||||||
|
: undefined;
|
||||||
|
this.listQuery.teamId = val.teamId ? val.teamId : undefined;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,317 +1,424 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
<el-form
|
||||||
<el-form-item label="部门名称" prop="name">
|
:model="queryParams"
|
||||||
<el-input v-model="queryParams.name" placeholder="请输入部门名称" clearable @keyup.enter.native="handleQuery"/>
|
ref="queryForm"
|
||||||
</el-form-item>
|
size="small"
|
||||||
<el-form-item label="状态" prop="status">
|
:inline="true"
|
||||||
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
|
v-show="showSearch">
|
||||||
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
|
<el-form-item label="部门名称" prop="name">
|
||||||
</el-select>
|
<el-input
|
||||||
</el-form-item>
|
v-model="queryParams.name"
|
||||||
<el-form-item>
|
placeholder="请输入部门名称"
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
clearable
|
||||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
@keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="菜单状态"
|
||||||
|
clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in statusDictDatas"
|
||||||
|
:key="parseInt(dict.value)"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="parseInt(dict.value)" />
|
||||||
|
</el-select>
|
||||||
|
</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-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
<el-button
|
||||||
v-hasPermi="['system:dept:create']">新增</el-button>
|
type="primary"
|
||||||
</el-col>
|
plain
|
||||||
<el-col :span="1.5">
|
icon="el-icon-plus"
|
||||||
<el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
|
size="mini"
|
||||||
</el-col>
|
@click="handleAdd"
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
v-hasPermi="['system:dept:create']">
|
||||||
</el-row>
|
新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="info"
|
||||||
|
plain
|
||||||
|
icon="el-icon-sort"
|
||||||
|
size="mini"
|
||||||
|
@click="toggleExpandAll">
|
||||||
|
展开/折叠
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="id" :default-expand-all="isExpandAll"
|
<el-table
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
v-if="refreshTable"
|
||||||
<el-table-column prop="name" label="部门名称" width="260"></el-table-column>
|
v-loading="loading"
|
||||||
<el-table-column prop="leader" label="负责人" :formatter="userNicknameFormat" width="120"/>
|
:data="deptList"
|
||||||
<el-table-column prop="sort" label="排序" width="200"></el-table-column>
|
row-key="id"
|
||||||
<el-table-column prop="status" label="状态" width="100">
|
:default-expand-all="isExpandAll"
|
||||||
<template v-slot="scope">
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
|
<el-table-column
|
||||||
</template>
|
prop="name"
|
||||||
</el-table-column>
|
label="部门名称"
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
width="260"></el-table-column>
|
||||||
<template v-slot="scope">
|
<el-table-column
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
prop="leader"
|
||||||
</template>
|
label="负责人"
|
||||||
</el-table-column>
|
:formatter="userNicknameFormat"
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
width="120" />
|
||||||
<template v-slot="scope">
|
<el-table-column prop="sort" label="排序" width="200"></el-table-column>
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
<el-table-column prop="status" label="状态" width="100">
|
||||||
v-hasPermi="['system:dept:update']">修改</el-button>
|
<template v-slot="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)"
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||||
v-hasPermi="['system:dept:create']">新增</el-button>
|
</template>
|
||||||
<el-button v-if="scope.row.parentId !== 0" size="mini" type="text" icon="el-icon-delete"
|
</el-table-column>
|
||||||
@click="handleDelete(scope.row)" v-hasPermi="['system:dept:delete']">删除</el-button>
|
<el-table-column
|
||||||
</template>
|
label="创建时间"
|
||||||
</el-table-column>
|
align="center"
|
||||||
</el-table>
|
prop="createTime"
|
||||||
|
width="200">
|
||||||
|
<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="['system:dept:update']">
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handleAdd(scope.row)"
|
||||||
|
v-hasPermi="['system:dept:create']">
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.parentId !== 0"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:dept:delete']">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
<!-- 添加或修改部门对话框 -->
|
<!-- 添加或修改部门对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="上级部门" prop="parentId">
|
<el-form-item label="上级部门" prop="parentId">
|
||||||
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
|
<treeselect
|
||||||
</el-form-item>
|
v-model="form.parentId"
|
||||||
</el-col>
|
:options="deptOptions"
|
||||||
<el-col :span="12">
|
:normalizer="normalizer"
|
||||||
<el-form-item label="部门名称" prop="name">
|
placeholder="选择上级部门" />
|
||||||
<el-input v-model="form.name" placeholder="请输入部门名称" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="12">
|
||||||
<el-col :span="12">
|
<el-form-item label="部门名称" prop="name">
|
||||||
<el-form-item label="显示排序" prop="sort">
|
<el-input v-model="form.name" placeholder="请输入部门名称" />
|
||||||
<el-input-number v-model="form.sort" controls-position="right" :min="0" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="12">
|
||||||
<el-col :span="12">
|
<el-form-item label="显示排序" prop="sort">
|
||||||
<el-form-item label="负责人" prop="leaderUserId">
|
<el-input-number
|
||||||
<el-select v-model="form.leaderUserId" placeholder="请输入负责人" clearable style="width: 100%">
|
v-model="form.sort"
|
||||||
<el-option v-for="item in users" :key="parseInt(item.id)" :label="item.nickname" :value="parseInt(item.id)" />
|
controls-position="right"
|
||||||
</el-select>
|
:min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="联系电话" prop="phone">
|
<el-form-item label="负责人" prop="leaderUserId">
|
||||||
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
<el-select
|
||||||
</el-form-item>
|
v-model="form.leaderUserId"
|
||||||
</el-col>
|
placeholder="请输入负责人"
|
||||||
<el-col :span="12">
|
clearable
|
||||||
<el-form-item label="邮箱" prop="email">
|
style="width: 100%">
|
||||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
<el-option
|
||||||
</el-form-item>
|
v-for="item in users"
|
||||||
</el-col>
|
:key="parseInt(item.id)"
|
||||||
<el-col :span="12">
|
:label="item.nickname"
|
||||||
<el-form-item label="部门状态" prop="status">
|
:value="parseInt(item.id)" />
|
||||||
<el-radio-group v-model="form.status">
|
</el-select>
|
||||||
<el-radio v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="parseInt(dict.value)">
|
</el-form-item>
|
||||||
{{dict.label}}</el-radio>
|
</el-col>
|
||||||
</el-radio-group>
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="联系电话" prop="phone">
|
||||||
</el-col>
|
<el-input
|
||||||
</el-row>
|
v-model="form.phone"
|
||||||
</el-form>
|
placeholder="请输入联系电话"
|
||||||
<div slot="footer" class="dialog-footer">
|
maxlength="11" />
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
</el-form-item>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
</el-col>
|
||||||
</div>
|
<el-col :span="12">
|
||||||
</el-dialog>
|
<el-form-item label="邮箱" prop="email">
|
||||||
</div>
|
<el-input
|
||||||
|
v-model="form.email"
|
||||||
|
placeholder="请输入邮箱"
|
||||||
|
maxlength="50" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="部门状态" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in statusDictDatas"
|
||||||
|
:key="parseInt(dict.value)"
|
||||||
|
:label="parseInt(dict.value)">
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listDept, getDept, delDept, addDept, updateDept } from "@/api/system/dept";
|
import {
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
listDept,
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
getDept,
|
||||||
|
delDept,
|
||||||
|
addDept,
|
||||||
|
updateDept,
|
||||||
|
} from '@/api/system/dept';
|
||||||
|
import Treeselect from '@riophae/vue-treeselect';
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
|
||||||
|
|
||||||
import {CommonStatusEnum} from '@/utils/constants'
|
import { CommonStatusEnum } from '@/utils/constants';
|
||||||
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
|
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
|
||||||
import {listSimpleUsers} from "@/api/system/user";
|
import { listSimpleUsers } from '@/api/system/user';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SystemDept",
|
name: 'SystemDept',
|
||||||
components: { Treeselect },
|
components: { Treeselect },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 表格树数据
|
// 表格树数据
|
||||||
deptList: [],
|
deptList: [],
|
||||||
// 部门树选项
|
// 部门树选项
|
||||||
deptOptions: [],
|
deptOptions: [],
|
||||||
// 用户下拉列表
|
// 用户下拉列表
|
||||||
users: [],
|
users: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: '',
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 是否展开,默认全部展开
|
// 是否展开,默认全部展开
|
||||||
isExpandAll: true,
|
isExpandAll: true,
|
||||||
// 重新渲染表格状态
|
// 重新渲染表格状态
|
||||||
refreshTable: true,
|
refreshTable: true,
|
||||||
// 是否展开
|
// 是否展开
|
||||||
expand: false,
|
expand: false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
name: undefined,
|
name: undefined,
|
||||||
status: undefined
|
status: undefined,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: "部门名称不能为空", trigger: "blur" }
|
{ required: true, message: '部门名称不能为空', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
sort: [
|
sort: [
|
||||||
{ required: true, message: "显示排序不能为空", trigger: "blur" }
|
{ required: true, message: '显示排序不能为空', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
email: [
|
email: [
|
||||||
{
|
{
|
||||||
type: "email",
|
type: 'email',
|
||||||
message: "'请输入正确的邮箱地址",
|
message: "'请输入正确的邮箱地址",
|
||||||
trigger: ["blur", "change"]
|
trigger: ['blur', 'change'],
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
phone: [
|
phone: [
|
||||||
{
|
{
|
||||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
pattern:
|
||||||
message: "请输入正确的手机号码",
|
/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||||
trigger: "blur"
|
message: '请输入正确的手机号码',
|
||||||
}
|
trigger: 'blur',
|
||||||
],
|
},
|
||||||
status: [
|
],
|
||||||
{ required: true, message: "状态不能为空", trigger: "blur" }
|
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||||
]
|
},
|
||||||
},
|
|
||||||
|
|
||||||
// 枚举
|
// 枚举
|
||||||
CommonStatusEnum: CommonStatusEnum,
|
CommonStatusEnum: CommonStatusEnum,
|
||||||
// 数据字典
|
// 数据字典
|
||||||
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS)
|
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
listSimpleUsers().then(response => {
|
listSimpleUsers().then((response) => {
|
||||||
this.users = response.data;
|
this.users = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询部门列表 */
|
/** 查询部门列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listDept(this.queryParams).then(response => {
|
listDept(this.queryParams).then((response) => {
|
||||||
this.deptList = this.handleTree(response.data, "id");
|
this.deptList = this.handleTree(response.data, 'id');
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 转换部门数据结构 */
|
/** 转换部门数据结构 */
|
||||||
normalizer(node) {
|
normalizer(node) {
|
||||||
if (node.children && !node.children.length) {
|
if (node.children && !node.children.length) {
|
||||||
delete node.children;
|
delete node.children;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
id: node.id,
|
id: node.id,
|
||||||
label: node.name,
|
label: node.name,
|
||||||
children: node.children
|
children: node.children,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// 用户昵称展示
|
// 用户昵称展示
|
||||||
userNicknameFormat(row, column) {
|
userNicknameFormat(row, column) {
|
||||||
if (!row.leaderUserId) {
|
if (!row.leaderUserId) {
|
||||||
return '未设置';
|
return '未设置';
|
||||||
}
|
}
|
||||||
for (const user of this.users) {
|
for (const user of this.users) {
|
||||||
if (row.leaderUserId === user.id) {
|
if (row.leaderUserId === user.id) {
|
||||||
return user.nickname;
|
return user.nickname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return '未知【' + row.leaderUserId + '】';
|
return '未知【' + row.leaderUserId + '】';
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.reset();
|
this.reset();
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
sort: undefined,
|
sort: undefined,
|
||||||
leaderUserId: undefined,
|
leaderUserId: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
email: undefined,
|
email: undefined,
|
||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm('form');
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm('queryForm');
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd(row) {
|
handleAdd(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (row !== undefined) {
|
if (row !== undefined) {
|
||||||
this.form.parentId = row.id;
|
this.form.parentId = row.id;
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加部门";
|
this.title = '添加部门';
|
||||||
listDept().then(response => {
|
listDept().then((response) => {
|
||||||
this.deptOptions = this.handleTree(response.data, "id");
|
this.deptOptions = this.handleTree(response.data, 'id');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
toggleExpandAll() {
|
toggleExpandAll() {
|
||||||
this.refreshTable = false;
|
this.refreshTable = false;
|
||||||
this.isExpandAll = !this.isExpandAll;
|
this.isExpandAll = !this.isExpandAll;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.refreshTable = true;
|
this.refreshTable = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
getDept(row.id).then(response => {
|
getDept(row.id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
if (this.form.parentId === 0) { // 无父部门时,标记为 undefined,避免展示为 Unknown
|
if (this.form.parentId === 0) {
|
||||||
this.form.parentId = undefined;
|
// 无父部门时,标记为 undefined,避免展示为 Unknown
|
||||||
}
|
this.form.parentId = undefined;
|
||||||
this.open = true;
|
}
|
||||||
this.title = "修改部门";
|
this.open = true;
|
||||||
});
|
this.title = '修改部门';
|
||||||
listDept(row.id).then(response => {
|
});
|
||||||
this.deptOptions = this.handleTree(response.data, "id");
|
listDept(row.id).then((response) => {
|
||||||
});
|
this.deptOptions = this.handleTree(response.data, 'id');
|
||||||
},
|
});
|
||||||
/** 提交按钮 */
|
},
|
||||||
submitForm: function() {
|
/** 提交按钮 */
|
||||||
this.$refs["form"].validate(valid => {
|
submitForm: function () {
|
||||||
if (valid) {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (this.form.id !== undefined) {
|
if (valid) {
|
||||||
updateDept(this.form).then(response => {
|
if (this.form.id !== undefined) {
|
||||||
this.$modal.msgSuccess("修改成功");
|
updateDept(this.form).then((response) => {
|
||||||
this.open = false;
|
this.$modal.msgSuccess('修改成功');
|
||||||
this.getList();
|
this.open = false;
|
||||||
});
|
this.getList();
|
||||||
} else {
|
});
|
||||||
addDept(this.form).then(response => {
|
} else {
|
||||||
this.$modal.msgSuccess("新增成功");
|
addDept(this.form).then((response) => {
|
||||||
this.open = false;
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.getList();
|
this.open = false;
|
||||||
});
|
this.getList();
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
},
|
});
|
||||||
/** 删除按钮操作 */
|
},
|
||||||
handleDelete(row) {
|
/** 删除按钮操作 */
|
||||||
this.$modal.confirm('是否确认删除名称为"' + row.name + '"的数据项?').then(function() {
|
handleDelete(row) {
|
||||||
return delDept(row.id);
|
this.$modal
|
||||||
}).then(() => {
|
.delConfirm(row.name)
|
||||||
this.getList();
|
.then(function () {
|
||||||
this.$modal.msgSuccess("删除成功");
|
return delDept(row.id);
|
||||||
}).catch(() => {});
|
})
|
||||||
}
|
.then(() => {
|
||||||
}
|
this.getList();
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user