projects/mes-dy #385

Merged
juzi merged 4 commits from projects/mes-dy into projects/mes-test 2024-07-29 16:03:54 +08:00
108 changed files with 7337 additions and 1 deletions
Showing only changes of commit 21988ae8b0 - Show all commits

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,15 @@
<template>
<dict-tag
:type="DICT_TYPE.UNIT_DICT"
:value="injectData.unitDictValue" />
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
};
</script>

View File

@ -0,0 +1,304 @@
<template>
<el-form ref="addWorkOrder" :rules="rules" label-width="130px" :model="form" label-position='top'>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="工单名称" prop="name" v-if='!isBind'>
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg">
<el-option
v-for="item in workOrderList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="工单编码" prop="code">
<el-input v-model="form.code" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name+' | '+item.specifications"
:value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划开始时间">
<el-date-picker
v-model="planStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="计划完成时间">
<el-date-picker
v-model="planFinishTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
<el-option
v-for="item in processFlowList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled>
<el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="工单类型" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers" :disabled="isBind"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
import { getLineAll } from '@/api/base/productionLine'
import moment from 'moment'
export default {
name: 'AddWorkOrder',
data() {
return {
form: {
workOrderId: '',
orderId: '',
name: '',
code: '',
planProductId: '',
planStartTime: '',
planFinishTime: '',
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
priority: '',
productLineId: [],
type: '',
workers: '',
planAssignmentQuantity: ''
},
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
},
productList: [],
processFlowList: [],
productLineList: [],
workOrderTypeList: [
{id: 1,name:'标准工单'},
{id: 2, name:'特殊工单'}
],
planStartTime: '',
planFinishTime: '',
isBind: false,
workOrderList: []
}
},
methods: {
init(data, param) {
this.form.orderId = data.id
this.getList()
if (param === 'add') {
this.isBind = false
getWorkOrderCode().then(res => {
this.form.code = res.data || ''
})
this.form.planProductId = data.planProductId
this.form.processFlowId = data.processFlowId
this.form.materialMethod = data.materialMethod
}else{//
this.isBind = true
}
},
getList() {
//
getProductAll().then(res => {
this.productList = res.data || []
})
// 线
getLineAll().then(res => {
this.productLineList = res.data || []
})
//
getProcessFlowList().then(res => {
this.processFlowList = res.data || []
})
// list
workOrderList({
status: 1
}).then(res => {
this.workOrderList = res.data || []
})
},
addWorkOrderSubmit() {
this.$refs['addWorkOrder'].validate((valid) => {
if (valid) {
if (this.isBind) {
//
orderIssue({
workOrderId: this.form.workOrderId,
orderId: this.form.orderId,
planAssignmentQuantity: this.form.planAssignmentQuantity
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功")
this.$emit('addWorkOrderSubmit')
}
})
} else {
//
let _this = this
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
orderIssue({ ..._this.form }).then(res => {
if (res.code === 0) {
_this.$modal.msgSuccess("操作成功")
let name = this.form.name
_this.$emit('addWorkOrderSubmit')
// 使
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
_this.$router.push({
path: '/core/core-work-order?workOrderName='+encodeURI(name)
})
})
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.addWorkOrder.resetFields()
this.form.materialMethod = 1
this.form.planAssignQuantity = 0
this.form.planQuantity = 0
this.planFinishTime = ''
this.planStartTime = ''
this.form.planFinishTime = ''
this.form.planStartTime = ''
this.isBind = false
},
//
getWorkOrderMsg() {
if (this.form.workOrderId) {
getWorkOrderById({id:this.form.workOrderId}).then(res => {
if (res.code === 0) {
this.form.code = res.data.code
this.form.planProductId = res.data.planProductId
this.planStartTime = res.data.planStartTime ? moment.unix(res.data.planStartTime).format('YYYY-MM-DD HH:mm:ss') : null
this.planFinishTime = res.data.planFinishTime ? moment.unix(res.data.planFinishTime).format('YYYY-MM-DD HH:mm:ss') : null
this.form.planAssignQuantity = res.data.planAssignQuantity
this.form.planQuantity = res.data.planQuantity
this.form.processFlowId = res.data.processFlowId
this.form.materialMethod = res.data.materialMethod
this.form.priority = res.data.priority ? res.data.priority + '' : ''
this.form.productLineId = res.data.productLineIds
this.form.type = res.data.type
this.form.workers = res.data.workers
}
})
}
}
}
}
</script>

View File

@ -0,0 +1,293 @@
<template>
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="订单名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="订单号" prop="code">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划加工数量" prop="planQuantity">
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable>
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name+' | '+(item.specifications || '')"
:value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="单价" prop="price">
<el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="客户" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;" clearable filterable>
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="包装规格" prop="packSpec">
<el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.PACK_SPEC)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;" clearable filterable @change="processFlowIdChange">
<el-option
v-for="item in processFlowList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" @change='materialMethodChange'>
<el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="订单计划开始时间" prop="planStartTime">
<el-date-picker
v-model="form.planStartTime"
type="datetime"
style="width: 100%;"
value-format="timestamp"
@change="timeChange"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="订单计划完成时间" prop="planFinishTime">
<el-date-picker
v-model="form.planFinishTime"
type="datetime"
style="width: 100%;"
value-format="timestamp"
@change="timeChange"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span='24'>
<el-form-item label="描述信息" prop="description">
<el-input v-model="form.description"></el-input>
</el-form-item>
</el-col>
</el-row> -->
</el-form>
</template>
<script>
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage'
import { getProductAll } from '@/api/base/product'
import { getCustomerList } from '@/api/base/customer'
export default {
name: 'OrderAdd',
data() {
return {
form: {
id: '',
name: '',
code: '',
planQuantity: '',
planProductId: '',
price: '',
customerId: '',
priority: '',
packSpec: '',
workers: '',
processFlowId: '',
materialMethod: 1,
remark: '',
// description: '',
planStartTime: '',
planFinishTime: ''
},
rules: {
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
},
productList: [],
customerList: [],
processFlowList: [],
isEdit: false //
}
},
methods: {
init(id) {
this.getList()
if (id) {
this.isEdit = true
this.form.id = id
getOrderById({id: this.form.id}).then(res => {
if (res.code === 0) {
this.form.name = res.data.name
this.form.code = res.data.code
this.form.planQuantity = res.data.planQuantity
this.form.planProductId = res.data.planProductId
this.form.price = res.data.price
this.form.customerId = res.data.customerId
this.form.priority = res.data.priority ? res.data.priority + '' : ''
this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
this.form.workers = res.data.workers
this.form.processFlowId = res.data.processFlowId
this.form.materialMethod = res.data.materialMethod
this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
this.form.remark = res.data.remark
// this.form.description = res.data.description
}
})
} else {
this.isEdit = false
this.form.id = ''
//
getOrderCode().then(res => {
this.form.code = res.data || ''
})
}
},
getList() {
//
getProductAll().then(res => {
this.productList = res.data || []
})
//
getCustomerList().then(res => {
this.customerList = res.data || []
})
//
getProcessFlowList().then(res => {
this.processFlowList = res.data || []
})
},
timeChange() {
if (this.form.planStartTime && this.form.planFinishTime) {
if (this.form.planStartTime > this.form.planFinishTime) {
this.$modal.msgError('计划开始时间不能大于结束时间')
}
}
},
//
materialMethodChange(val) {
if (val === 2 && !this.form.processFlowId) {
this.form.materialMethod = 1
this.$modal.msgError("请先选择关联工艺");
}
},
//
processFlowIdChange(val) {
console.log(val)
if (!val) {
this.form.materialMethod = 1
}
},
submitForm() {
this.$refs['orderAddForm'].validate((valid) => {
if (valid) {
if (this.form.planStartTime && this.form.planFinishTime) {
if (this.form.planStartTime > this.form.planFinishTime) {
this.$modal.msgError('计划开始时间不能大于结束时间')
return false
}
}
// console.log(this.form)
if (this.isEdit) {
//
orderUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
this.form.status = 1
this.form.triggerOrigin = 1
orderCreate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.orderAddForm.resetFields()
this.form.materialMethod = 1
this.form.price = 0.00
this.form.planQuantity = 0
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,470 @@
<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="240"
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"
width='60%'
>
<order-add ref="orderAdd" @successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
:dialogTitle="workIssueTitle"
:dialogVisible="addWorkOrdervisible"
@cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel"
width='70%'
>
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderPage, orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
import OrderAdd from './components/orderAdd'
import AddWorkOrder from './components/addWorkOrder'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '订单名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 180
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true
},
{
prop: 'triggerOrigin',
label: '来源',
filter: publicFormatter('order_Origin')
},
{
prop: 'priority',
label: '优先级',
filter: publicFormatter('order_priority')
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
},
{
prop: 'productName',
label: '产品',
showOverflowtooltip: true
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'price',
label: '单价(元)',
align: 'right'
},
{
prop: 'workOrderNum',
label: '工单数量'
}
]
export default {
name: 'OrderManage',
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
placeholder: '订单名称',
param: 'name'
},
{
type: 'select',
label: '状态',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'status'
},
{
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'
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null,
lastIssuedTime: []
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder')
? {
type: 'add',
btnName: '新增',
showTip: '新增工单',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 1
},
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'bind',
btnName: '绑定',
showTip: '绑定工单',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 1
},
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined,
this.$auth.hasPermi('base:order-manage:edit')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
name: 'status',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:delete')
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
name: 'status',
value: 1
}
]
}
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
addWorkOrdervisible: false,
orderDetailVisible: false
}
},
components: { OrderAdd, AddWorkOrder },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
},
methods: {
getList() {
getOrderPage({...this.queryParams}).then(res => {
let arr = res.data.records || []
this.total = res.data.total || 0
if (arr.length > 0) {
customerList().then(result => {
let tempData = result.data || []
if (tempData.length > 0) {
arr.map(item => {
for (let i of tempData) {
if (item.customerId === i.id) {
item.customerId = i.name
}
}
item.price = item.price.toFixed(2)
})
this.list = arr
}
})
}else {
this.list = arr
}
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.lastIssuedTime = []
}
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderAdd.init(val.data.id)
})
break
case 'delete':
this.handleDelete(val.data)
break
case 'detail':
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
break
case 'add':
this.workIssueTitle = '新增工单'
this.addWorkOrdervisible = true
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'add')
})
break
case 'bind':
this.workIssueTitle = '绑定工单'
this.addWorkOrdervisible = true
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'bind')
})
break
case 'complete':
this.handleComplete(val.data)
break
default:
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return orderDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleComplete(val) {
this.$modal.confirm('是否确认完成订单"' + val.name + '"?').then(function() {
return orderFinish({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.orderAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.orderAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
//
addWorkOrderCancel() {
this.$refs.addWorkOrder.formClear()
this.addWorkOrdervisible = false
},
addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit()
},
addWorkOrderSubmit() {
this.addWorkOrderCancel()
this.getList()
}
// bindWorkOrderCancel() {
// this.$refs.bindWorkOrder.formClear()
// this.bindWorkOrdervisible = false
// },
// bindWorkOrderConfirm() {
// this.$refs.bindWorkOrder.bindWorkOrderSubmit()
// },
// bindWorkOrderSubmit() {
// this.bindWorkOrderCancel()
// this.getList()
// }
}
}
</script>

View File

@ -0,0 +1,343 @@
<template>
<div class="orderDetailData">
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>订单编码: {{orderMsg.code}}</span>
</div>
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='3'>
<div class="blodTip">订单名</div>
<div class="lightTip">{{orderMsg.name}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">产品信息</div>
<div class="lightTip">{{orderMsg.productName}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">产品规格</div>
<div class="lightTip">{{orderMsg.specifications}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">客户</div>
<div class="lightTip">{{orderMsg.customerName}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">包装规格</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">物料计算方式</div>
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">计划开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='3'>
<div class="blodTip">计划完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{orderMsg.planQuantity}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{orderMsg.planArea}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">预计用时()</div>
<div class="lightTip">{{ orderMsg.expectTime }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">实际完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='3'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{orderMsg.completeProp}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">废片数量</div>
<div class="lightTip">{{orderMsg.nokQuantity}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">负责人</div>
<div class="lightTip">{{orderMsg.workers}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">关联工艺</div>
<div class="lightTip">{{processFlowName}}</div>
</el-col>
</el-row>
</div>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>工单信息</span>
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps1"
:table-data="list1"
:max-height="tableH"
/>
</div>
<div class="box3">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>预计用料信息</span>
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps2"
:table-data="list2"
:max-height="tableH"
/>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { getProcessFlowList } from '@/api/base/orderManage'
const tableProps1 = [
{
prop: 'issueTime',
label: '下发时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '工单名',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'code',
label: '工单编码',
minWidth: 150
},
{
prop: 'planAssignmentQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
},
{
prop: 'actualArea',
label: '加工平方数',
width: 100
},
{
prop: 'status',
label: '状态',
filter: publicFormatter('order_status')
},
{
prop: 'startProduceTime',
label: '开始时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'finishProduceTime',
label: '结束时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'productLineNames',
label: '关联产线',
filter: (val) => val ? val.join(',') : '',
showOverflowtooltip: true
},
{
prop: 'workers',
label: '负责人'
},
{
prop: 'remark',
label: '备注'
}
]
const tableProps2 = [
{
prop: 'materialName',
label: '物料名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'num',
label: '剩余生产预计消耗'
}
]
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
export default {
name: 'OrderDetailData',
data() {
return {
orderId: '',
tableProps1,
tableProps2,
list1: [],
list2: [],
tableH: this.tableHeight(510) / 2,
//
queryParams: {
pageNo: 1,
pageSize: 500
},
orderMsg: {},
processFlowName: ''
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2
})
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg()
},
watch: {
$route: 'initData'
},
methods: {
initData(to) {
if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg()
}
},
getMsg() {
orderDetail({
id: this.orderId
}).then(res => {
this.orderMsg = res.data
this.list1 = res.data.coreWorkOrderRespVOS
bomUseNum({
productId: this.orderMsg.planProductId
}).then(res2 => {
if (res2.data && res2.data.length > 0) {
let arr = res2.data
arr.map(item => {
if (item) {
let a = item.num * this.orderMsg.remainingQuantity
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
}
})
this.list2 = arr
}else {
this.list2 = []
}
})
//
getProcessFlowList().then(res => {
let arr = res.data || []
if (arr.length > 0) {
arr.map(item => {
if (item.id === this.orderMsg.processFlowId) {
this.processFlowName = item.name
}
})
}
})
})
},
//
returnOrderManage() {
this.$router.push({path: '/order/base/order-manage'})
}
}
}
</script>
<style lang='scss' scoped>
.orderDetailData {
background-color: rgb(242, 244, 249);
.box1, .box2, .box3 {
background-color: #fff;
border-radius: 9px;
}
.box2 {
height: calc((100vh - 360px) / 2);
padding: 12px 16px 0;
margin: 8px 0;
}
.box1 {
height: 215px;
padding: 16px 16px 0 16px;
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
}
}
.box3 {
padding: 16px;
height: calc((100vh - 360px) / 2);
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -0,0 +1,168 @@
<template>
<div>
<div class="boxTitle">
<span class="blueTitle"></span>
<span>各订单环形图</span>
</div>
<div class="chartBox" id='orderChartBox' v-show='chartList.length'>
<div class="chartItem" v-for="(item, index) in chartList" :key='index' :style="{width: 388*beilv+'px',height: 286*beilv+'px',padding:14*beilv+'px',marginRight:9*beilv+'px',marginBottom:9*beilv+'px'}">
<div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}">
<svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/>
<span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderName}}</span>
<span>订单计划数量{{item.num}}</span>
</div>
<div
:id="item.id"
:style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}"
></div>
<div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}">
<div class="legendItem" v-for="(subItem, i) in item.workOrder" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
<span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span>
<div>
<span class="itemName" :style="{fontSize: 14 * beilv + 'px'}">
<span class="smallBlock" :style="{backgroundColor:subItem.color,width:8*beilv+'px',height:8*beilv+'px'}"></span>
{{subItem.name}}
</span>
</div>
</div>
</div>
</div>
</div>
<!-- 空图 -->
<div class="no-data-bg" v-show='!chartList.length'></div>
</div>
</template>
<script>
import * as echarts from 'echarts'
import { debounce } from '@/utils/debounce'
export default {
name: 'MonitoringRingCharts',
props: {
chartList: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
myChart: [],
beilv: 1,
canvasReset: ''
}
},
mounted() {
this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610
this.canvasReset = debounce(() => {
this.initChart()
}, 500)
window.addEventListener('resize', () => {
this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610
this.canvasReset()
})
},
methods: {
//
initChart() {
if (this.chartList.length <= 0) {
return false
}
//
for (let j = 0;j < this.chartList.length; j++) {
if (this.myChart[j]) {
this.myChart[j].dispose() // Dom
}
}
for (let i = 0; i < this.chartList.length; i++) {
var chartDom = document.getElementById(this.chartList[i].id);
this.myChart[i] = echarts.init(chartDom);
let colorList = []
this.chartList[i].workOrder.map(item => {
colorList.push(item.color)
})
let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0)
var option = {
color: colorList,
series: [
{
name: 'Access From',
type: 'pie',
radius: ['75%', '95%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 5,
borderColor: '#fff',
borderWidth: 2
},
label: {
show: true,
position: 'center',
color: '#000',
formatter: [
'{a|'+percentage+'%}',
'{b|生产'+this.chartList[i].sunNum+'}'
].join('\n\n'),
rich: {
a: {
fontSize: this.beilv*24 +'px'
},
b: {
fontSize: this.beilv*12 +'px'
}
}
},
emphasis: {
disabled: true
},
labelLine: {
show: false
},
data: this.chartList[i].workOrder
}
]
};
option && this.myChart[i].setOption(option)
}
}
}
}
</script>
<style lang='scss' scoped>
.chartBox {
width: 100%;
padding-right: 6px;
height: calc(100vh - 310px);
display: flex;
flex-flow: row wrap;
overflow: auto;
align-content: flex-start;
.chartItem {
border-radius: 8px;
border: 1px solid #CACACA;
.topTitle {
margin-bottom: 10px;
.orderName {
border-right: 1px solid #CACACA;
}
}
.legend {
text-align: center;
white-space: nowrap;
overflow: auto;
.legendItem {
display: inline-block;
border-right: 1px solid #E8E8E8;
.itemName {
.smallBlock {
display: inline-block;
}
}
}
.legendItem:last-child {
border: none;
}
}
}
}
</style>

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