projects/mes-test #133

Merged
gtz217 merged 281 commits from projects/mes-test into projects/mes 2023-11-30 09:11:34 +08:00
37 changed files with 2029 additions and 74 deletions
Showing only changes of commit ac4565e587 - Show all commits

View File

@ -9,13 +9,11 @@
ENV = 'development'
# 页面标题
VUE_APP_TITLE = 产线监控系统
VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
VUE_APP_BASE_API = 'http://192.168.0.33:48080'
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

8
src/api/base/customer.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
// 获得所有客户列表
export function getCustomerList() {
return request({
url: '/base/core-customer/listAll',
method: 'get'
})
}

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
// 获得工厂产线工段设备树形结构
export function getTree() {
return request({
url: '/base/factory/getTree',
url: '/base/core-factory/getTree',
method: 'get'
})
}

View File

@ -58,3 +58,49 @@ export function listEnabled() {
method: 'get'
})
}
// 获得班组组员信息分页
export function groupTeamPage(query) {
return request({
url: '/base/group-team-det/page',
method: 'get',
params: query
})
}
// 获得班组组员信息
export function groupTeamDet(query) {
return request({
url: '/base/group-team-det/get',
method: 'get',
params: query
})
}
// 创建班组组员信息
export function teamDetCreate(data) {
return request({
url: '/base/group-team-det/create',
method: 'post',
data: data
})
}
// 更新班组组员信息
export function teamDetUpdate(data) {
return request({
url: '/base/group-team-det/update',
method: 'put',
data: data
})
}
// 删除班组组员信息
export function teamDetDelete(query) {
return request({
url: '/base/group-team-det/delete',
method: 'delete',
params: query
})
}

View File

@ -26,3 +26,12 @@ export function autoSet(query) {
params: query
})
}
// 获得排班信息分页 建议size 150
export function groupTeamSchedulingPage(query) {
return request({
url: '/base/group-team-scheduling/page',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 条件获得订单列表
export function orderList(query) {
return request({
url: '/base/order/listbyfilter',
method: 'get',
params: query
})
}
// 条件获得工单列表
export function workOrderList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query
})
}
// 获得订单分页
export function getOrderPage(query) {
return request({
url: '/base/order/page',
method: 'get',
params: query
})
}
// 获取订单code
export function getOrderCode() {
return request({
url: '/base/order/getOrderCode',
method: 'get'
})
}
// 获得订单
export function getOrderById(query) {
return request({
url: '/base/order/get',
method: 'get',
params: query
})
}

8
src/api/base/product.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
// 获得产品列表
export function getProductAll() {
return request({
url: '/base/core-product/listAll',
method: 'get'
})
}

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
// 获得所有工厂产线列表
export function getLineAll() {
return request({
url: '/base/production-line/listAll',
url: '/base/core-production-line/listAll',
method: 'get'
})
}

View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
// 获得工单列表
export function workOrderList() {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get'
})
}

17
src/api/base/worker.js Normal file
View File

@ -0,0 +1,17 @@
import request from '@/utils/request'
// 获得所有员工列表
export function getWorkerList() {
return request({
url: '/base/core-worker/listAll',
method: 'get'
})
}
// 获得员工
export function getWorker(query) {
return request({
url: '/base/core-worker/get',
method: 'get',
params: query
})
}

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
// 获得所有产线工段列表
export function getWorkShopAll() {
return request({
url: '/base/workshop-section/listAll',
url: '/base/core-workshop-section/listAll',
method: 'get'
})
}

View File

@ -0,0 +1,27 @@
import request from '@/utils/request'
// 执行班组追溯 根据工单
export function getByWorkOrder(query) {
return request({
url: '/monitoring/schedulingmonitoring/getByWorkOrder',
method: 'get',
params: query
})
}
// 执行班组追溯详情 根据工单班组
export function getByTeam(query) {
return request({
url: '/monitoring/schedulingmonitoring/getByTeam',
method: 'get',
params: query
})
}
// 获取某次排班的生产情况详情
export function getByScheduling(query) {
return request({
url: '/monitoring/schedulingmonitoring/getByScheduling',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,19 @@
import request from '@/utils/request'
// 获取工单信息
export function getWorkOrderMsg(data) {
return request({
url: '/monitoring/energy-work-order/getWorkOrderMsg',
method: 'post',
data: data
})
}
// 获取工单能源消耗数据
export function getOrderEnergyData(data) {
return request({
url: '/monitoring/energy-work-order/getData',
method: 'post',
data: data
})
}

View File

@ -95,7 +95,12 @@ export const DICT_TYPE = {
MONITOR_INDEX_TYPE: 'monitor_index_type',
OBJECT_TYPE: 'object_type',
STATISTIC_TYPE: 'statistic_type',
TIME_DIM: 'time_dim'
TIME_DIM: 'time_dim',
// ============== ORDER - 订单模块 =============
ORDER_STATUS: 'order_status',
ORDER_ORIGIN: 'order_origin',
ORDER_PRIORITY: 'order_priority'
}
/**

View File

@ -20,9 +20,6 @@
@change="selectObj"
clearable></el-cascader>
</el-form-item>
<el-form-item label="对象备注" prop="remark">
<el-input v-model="form.remark"/>
</el-form-item>
</el-form>
</template>
<script>
@ -42,8 +39,7 @@ export default {
id: '',
plcId: '',
bindObjectId: '',
bindObjectType: '',
remark: ''
bindObjectType: ''
},
objIds: [],//
plcList: [],
@ -130,7 +126,6 @@ export default {
this.form.plcId = ''
this.form.bindObjectId = ''
this.form.bindObjectType = ''
this.form.remark = ''
this.objIds = []
this.isEdit = false
}

View File

@ -61,10 +61,6 @@ const tableProps = [
prop: 'objCode',
label: '对象编码'
},
{
prop: 'remark',
label: '对象备注'
},
{
prop: 'plcTableName',
label: '关联表名'

View File

@ -38,8 +38,8 @@ const tableProps = [
label: '统计对象'
},
{
prop: 'objRemark',
label: '对象备注'
prop: 'objCode',
label: '对象编码'
},
{
prop: 'energyTypeName',

View File

@ -55,9 +55,8 @@ const tableProps = [
label: '监控对象'
},
{
prop: 'objectType',
label: '对象备注',
filter: publicFormatter('object_type')
prop: 'objCode',
label: '对象编码'
},
{
prop: 'energyType',

View File

@ -34,8 +34,8 @@ const tableProps = [
label: '监控对象'
},
{
prop: 'objRemark',
label: '对象备注'
prop: 'objCode',
label: '对象编码'
},
{
prop: 'energyType',

View File

@ -54,8 +54,8 @@ const tableProps = [
label: '所属对象'
},
{
prop: 'objRemark',
label: '对象备注'
prop: 'objCode',
label: '对象编码'
},
{
prop: 'paramName',

View File

@ -41,8 +41,8 @@ const tableProps = [
label: '所属对象'
},
{
prop: 'objRemark',
label: '对象备注'
prop: 'objCode',
label: '对象编码'
},
{
prop: 'paramName',

View File

@ -0,0 +1,93 @@
<template>
<div
id="orderEnergyChart"
style="width: 100%"
:style="{ height: chartHeight + 'px' }"
></div>
</template>
<script>
import * as echarts from 'echarts'
import resize from '@/utils/chartMixins/resize'
export default {
name: "BarChart",
mixins: [resize],
data() {
return {
chartDom: '',
chart: '',
chartHeight: this.tableHeight(430)
}
},
props: {
chartData: {
type: Array,
required: true,
default: () => {
return []
}
}
},
watch: {
chartData: function () {
this.getChart()
}
},
mounted() {
window.addEventListener('resize', () => {
this.chartHeight = this.tableHeight(430)
})
},
methods: {
getChart() {
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose() // Dom
}
this.chartDom = document.getElementById('orderEnergyChart')
this.chart = echarts.init(this.chartDom)
console.log(this.chartData)
let xData = []
let yData = []
this.chartData && this.chartData.map(item =>{
xData.push(item.objName)
yData.push(item.useNum)
})
var option = {
color:['#288AFF'],
grid: {
left: '2%',
right: '1%',
bottom: '1%',
containLabel: true
},
xAxis: {
type: 'category',
data: xData,
axisLabel: {
rotate: "45"
}
},
yAxis: {
type: 'value'
},
series: [
{
data: yData,
type: 'bar',
barMaxWidth: 20,
label: {
show: true,
position: 'top'
}
}
]
};
option && this.chart.setOption(option);
}
}
}
</script>

View File

@ -0,0 +1,269 @@
<template>
<div class="orderEnergyContainer">
<div class="box1">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>工单信息</span>
</div>
<el-row>
<el-col :span='4'>
<div class="blodTip">工单名称</div>
<div class="lightTip">{{ orderMsg.name }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip">{{orderMsg.productName }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划完成数量</div>
<div class="lightTip">{{orderMsg.planQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际加工数量</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
</el-col>
</el-row>
</div>
<div class="box3">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>能耗信息</span>
</div>
<div class="toggleTabBox">
<div :class="{ active: activeModule === 'dataList' }" @click="toggleTab('dataList')">数据列表</div>
<div :class="{ active: activeModule === 'barChart' }" @click="toggleTab('barChart')">柱状图</div>
</div>
<div>
<div v-show="activeModule === 'dataList'">
<!-- 表格 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
</div>
<!-- 图形 -->
<div v-show="activeModule === 'barChart'">
<bar-chart ref="orderEnergyChart" :chartData="chartData"/>
</div>
</div>
</div>
</div>
</template>
<script>
const tableProps = [
{
prop: 'objName',
label: '对象名称'
},
{
prop: 'objCode',
label: '对象编码'
},
{
prop: 'energyType',
label: '能源类型'
},
{
prop: 'startNum',
label: '工单开始值'
},
{
prop: 'endNum',
label: '工单结束值/当前值'
},
{
prop: 'useNum',
label: '使用量'
}
]
import { getEnergyTypeListAll } from '@/api/base/energyType'
import { orderList, workOrderList } from '@/api/base/orderManage'
import { getWorkOrderMsg, getOrderEnergyData } from '@/api/monitoring/orderEnergy'
import BarChart from "./components/barChart"
export default {
name: 'OrderEnergy',
data() {
return {
formConfig: [
{
type: 'select',
label: '订单',
selectOptions: [],
param: 'energyTypeId'
},
{
type: 'select',
label: '工单',
selectOptions: [],
param: 'energyTypeId1'
},
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId2',
filterable: true,
width: 120
},
{
type: 'select',
label: '对象维度',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
labelField: 'label',
valueField: 'value',
param: 'energyTypeId3',
width: 100
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
tableProps,
tableData: [],
tableH: this.tableHeight(400),
//
queryParams: {
pageNo: 1,
pageSize: 10000
},
orderMsg: {},
chartData: [],
activeModule: 'dataList'
}
},
components: { BarChart },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(400)
})
this.getListArr()
},
methods: {
getListArr() {
getEnergyTypeListAll().then(res => {
this.formConfig[2].selectOptions = res.data || []
})
orderList().then(res => {
console.log(res)
})
workOrderList().then(res => {
console.log(res)
})
},
buttonClick() {
getWorkOrderMsg({
"workOrderId": 1,
"objType": "3",
"energyTypeId": '1681183397517406210'
}).then(res => {
console.log(res)
this.orderMsg = res.data || {}
getOrderEnergyData({
"workOrderId": 1,
"objType": "3",
"energyTypeId": '1681183397517406210',
"startProduceTime": "1694239523000",
"finishProduceTime": "1694498723000"
}).then(res => {
console.log(res)
this.tableData = res.data || []
this.chartData = res.data || []
})
})
},
toggleTab(val) {
this.activeModule = val
if (this.activeModule === 'barChart') {
this.$nextTick((res) => {
this.$refs.orderEnergyChart.getChart()
})
}
},
headBtnClick() {}
}
}
</script>
<style lang='scss' scoped>
.orderEnergyContainer {
background-color: rgb(242, 244, 249);
.box1, .box2, .box3 {
background-color: #fff;
border-radius: 9px;
}
.box1 {
height: 64px;
padding: 12px 16px 0;
}
.box2 {
height: 122px;
margin: 8px 0;
padding: 16px;
.blodTip {
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
font-weight: 400;
color: rgba(102,102,102,0.75);
}
}
.box3 {
padding: 16px;
height: calc(100vh - 330px);
.toggleTabBox {
display: inline-block;
div {
display: inline-block;
padding:0 8px 4px;
color: rgba(102, 102, 102, 0.5);
border-bottom: 2px solid rgba(242, 244, 249, 1);
cursor: pointer;
}
.active {
color: rgba(0,0,0,0.85);
border-bottom-color: #0B58FF;
}
}
}
.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

@ -108,20 +108,22 @@ export default {
],
tableProps,
tableBtn: [
{
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: '不可用'
}
]
this.$auth.hasPermi('base:group-classes:cancel')
? {
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: '不可用'
}
]
}
}
},
: undefined,
this.$auth.hasPermi('base:group-classes:update')
? {
type: 'edit',

View File

@ -1,5 +1,5 @@
<template>
<el-form ref="form" :rules="rules" label-width="80px" :model="form">
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-row>
<el-col :span="12">
<el-form-item label="班组名称" prop="name">
@ -14,13 +14,20 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班组人数" prop="num">
<el-input-number v-model="form.num" :min="1" :max="99999999" style="width: 100%;"></el-input-number>
<el-form-item label="班组组长" prop="leaderId">
<el-select v-model="form.leaderId" placeholder="请选择" style="width: 100%;" @change="selectLeader">
<el-option
v-for="item in workerList"
: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="leaderName">
<el-input v-model="form.leaderName"></el-input>
<el-form-item label="手机号" prop="telephone">
<el-input v-model="form.telephone" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
@ -28,6 +35,7 @@
</template>
<script>
import { getGroupTeam, updateGroupTeam, createGroupTeam, getCode } from '@/api/base/groupTeam'
import { getWorkerList } from '@/api/base/worker'
export default {
name: 'groupTeamAdd',
data() {
@ -36,23 +44,28 @@ export default {
id: '',
name: '',
code: '',
num: null,
leaderName: ''
leaderId: '',
telephone: ''
},
isEdit: false, //
rules: {
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }]
}
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入班组编码', trigger: 'blur' }],
leaderId: [{ required: true, message: '请选择组长', trigger: 'select' }]
},
workerList: []
}
},
methods: {
init(id) {
this.getWorkerList()
if (id) {
this.isEdit = true
this.form.id = id
getGroupTeam( id ).then((res) => {
if (res.code === 0) {
this.form = res.data
this.selectLeader()
}
})
} else {
@ -63,6 +76,24 @@ export default {
})
}
},
// list
getWorkerList() {
getWorkerList().then(res => {
this.workerList = res.data
})
},
//
selectLeader() {
if (this.form.leaderId) {
this.workerList.map(item => {
if (item.id === this.form.leaderId) {
this.form.telephone = item.telephone || ''
}
})
} else {
this.form.telephone = ''
}
},
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {

View File

@ -12,8 +12,7 @@ export default {
},
data() {
return {
state: false,
payload: {}
state: false
}
},
computed: {
@ -31,9 +30,16 @@ export default {
}
},
changeHandler() {
this.payload.id = this.injectData.id
this.payload.enabled = this.state ? '1' : '0'
this.$emit('emitData', this.payload)
let params = {}
let payload = {}
params.name = 'state'
payload.id = this.injectData.id
payload.enabled = this.state ? '1' : '0'
payload.code = this.injectData.code
payload.name = this.injectData.name
payload.leaderId = this.injectData.leaderId
params.payload = payload
this.$emit('emitData', params)
}
}
}

View File

@ -0,0 +1,298 @@
<template>
<div>
<el-drawer :title="title" :visible.sync="visible" size="70%" @close='closeD'>
<div class="box">
<el-row class="topBox">
<el-col :span="6">
<p class="boldTitle">班组名称</p>
<p class="lightText">{{ teamData.teamName }}</p>
</el-col>
<el-col :span="6">
<p class="boldTitle">班组长</p>
<p class="lightText">{{ teamData.leaderName }}</p>
</el-col>
<el-col :span="6">
<p class="boldTitle">班组人数</p>
<p class="lightText">{{ teamData.teamNum }}</p>
</el-col>
<el-col :span="6">
<p class="boldTitle">手机号</p>
<p class="lightText">{{ teamData.leaderTelephone }}</p>
</el-col>
</el-row>
<div class="bottomBox">
<!-- 搜索工作栏 -->
<search-bar
v-if="visible"
:formConfigs="formConfig"
@headBtnClick="buttonClick"
/>
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</div>
</el-drawer>
<!-- 新增编辑组员 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<worker-team-add ref="workerTeamAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
const tableProps = [
{
prop: 'workerName',
label: '人员姓名'
},
{
prop: 'workerMajorName',
label: '专业'
},
{
prop: 'workerTelephone',
label: '手机'
},
{
prop: 'remark',
label: '备注'
}
]
import { groupTeamPage, teamDetDelete } from '@/api/base/groupTeam'
import { getWorker } from '@/api/base/worker'
import WorkerTeamAdd from './workerTeamAdd.vue'
export default {
name: 'WorkerEdit',
data() {
return {
visible: false,
title: '',
formConfig: [],
teamData: {
teamName: '',
leaderName: '',
teamNum: '',
leaderTelephone: '-',
teamId: ''
},
queryParams: {
pageNo: 1,
pageSize: 20,
teamId: '',
workerName: ''
},
tableProps,
tableData: [],
tableBtn: [],
tableH: this.tableHeight(320),
total: 0,
//
addOrEditTitle: "",
//
centervisible: false
}
},
components: { WorkerTeamAdd },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(320)
})
},
methods: {
init(val) {
this.visible = true
this.teamData.teamName = val.payload.name
this.teamData.leaderName = val.payload.leaderName
this.teamData.teamNum = val.payload.num
this.teamData.teamId = val.payload.teamId
this.queryParams.teamId = val.payload.id
getWorker({id:val.payload.leaderId}).then(res => {//
this.teamData.leaderTelephone = res.data.telephone || '-'
})
this.getList()
if (val.name === 'view') {
this.title = '查看组员'
this.tableBtn = []
this.formConfig = [
{
type: 'input',
label: '关键字',
placeholder: '关键字',
param: 'workerName'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
]
}else{
this.title = '编辑组员'
this.tableBtn = [
{
type: 'edit',
btnName: '编辑'
},
{
type: 'delete',
btnName: '删除'
}
]
this.formConfig = [
{
type: 'input',
label: '关键字',
placeholder: '关键字',
param: 'workerName'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: 'button',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
]
}
},
getList() {
groupTeamPage({ ...this.queryParams }).then(res => {
if (res.code === 0 && res.data.list.length > 0) {
let arr = []
res.data.list.map(item => {
let obj = {}
obj.workerName = item.worker.name
obj.workerMajorName = item.worker.majorName
obj.workerTelephone = item.worker.telephone
obj.remark = item.remark
obj.id = item.id
arr.push(obj)
})
this.tableData = arr
this.total = res.data.total
} else {
this.tableData = []
this.total = 0
}
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.workerName = val.workerName
this.queryParams.pageNo = 1
this.getList()
}else if (val.btnName === 'add') {
this.addNew()
}
},
//
addNew() {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.workerTeamAdd.init({'teamId': this.queryParams.teamId, id: ''})
})
},
handleCancel() {
this.$refs.workerTeamAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.workerTeamAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.workerTeamAdd.init({'teamId': this.queryParams.teamId, id: val.data.id})
})
break
default:
this.handleDelete(val.data)
}
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row)
this.$modal.confirm('是否确认删除人员"' + row.workerName + '"的数据项?').then(function() {
return teamDetDelete({id: row.id});
}).then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
closeD() {
this.$emit('closeDrawer')
}
}
}
</script>
<style lang='scss' scoped>
.box {
padding:0 30px;
.topBox {
padding-bottom: 30px;
border-bottom: 1px solid #E9E9E9;
.boldTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin: 0;
margin-bottom: 10px;
}
.lightText {
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin: 0;
}
}
.bottomBox {
padding-top: 30px;
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="workerOperate">
<div class="operateBtn">
<span class="view" v-if="this.$auth.hasPermi('base:group-team:view-worker')" @click="emitParams('view')">查看</span>
<span class="edit" v-if="this.$auth.hasPermi('base:group-team:edit-worker')" @click="emitParams('edit')">编辑</span>
</div>
</div>
</template>
<script>
export default {
name: 'WorkerOperate',
props: {
injectData: {
type: Object,
default: () => ({})
}
},
methods: {
emitParams(data) {
let params = {}
params.name = data
params.payload = this.injectData
this.$emit('emitData', params)
}
}
}
</script>
<style lang='scss' scoped>
.workerOperate {
.operateBtn{
color: #0B58FF;
.view {
margin-right: 10px;
cursor: pointer;
}
.edit {
cursor: pointer;
}
}
}
</style>

View File

@ -0,0 +1,113 @@
<template>
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-form-item label="员工" prop="workerId">
<el-select v-model="form.workerId" placeholder="请选择" filterable style="width: 100%;" @change="selectWorker()">
<el-option
v-for="item in workerList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="专业" prop="majorName">
<el-input v-model="form.majorName" disabled></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-form>
</template>
<script>
import { getWorkerList } from '@/api/base/worker'
import { teamDetCreate, teamDetUpdate, groupTeamDet } from '@/api/base/groupTeam'
export default {
name: 'WorkerTeamAdd',
data() {
return {
workerList: [],
form: {
teamId: '',
workerId: '',
remark: '',
majorName: '',
id: ''
},
rules: {
workerId: [{ required: true, message: '员工不能为空', trigger: 'change' }]
}
}
},
methods: {
init(param) {
this.form.teamId = param.teamId
getWorkerList().then(res => {
this.workerList = res.data || []
if (param.id) {
this.isEdit = true
this.form.id = param.id
groupTeamDet({id: this.form.id}).then((res) => {
if (res.code === 0) {
this.form.workerId = res.data.workerId
this.selectWorker()
this.form.remark = res.data.remark
}
})
} else {
this.isEdit = false
this.form.id = ''
}
})
},
selectWorker() {
if (this.form.workerId) {
this.workerList.map(item => {
if (item.id === this.form.workerId) {
this.form.majorName = item.majorName
}
})
}else{
this.form.majorName = ''
}
},
//
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.isEdit) {
//
teamDetUpdate({
teamId: this.form.teamId,
workerId: this.form.workerId,
remark: this.form.remark,
id: this.form.id
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
teamDetCreate({
teamId: this.form.teamId,
workerId: this.form.workerId,
remark: this.form.remark
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.form.resetFields()
this.isEdit = false
}
}
}
</script>

View File

@ -41,14 +41,18 @@
>
<group-team-add ref="groupList" @successSubmit="successSubmit" />
</base-dialog>
<!-- 组员编辑 -->
<worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
</div>
</template>
<script>
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
import { parseTime } from '@/utils/ruoyi'
import GroupTeamAdd from './components/groupTeamAdd.vue'
import GroupTeamAdd from './components/groupTeamAdd'
import StatusBtn from './components/statusBtn.vue'
import WorkerOperate from './components/workerOperate.vue'
import WorkerEdit from './components/workerEdit.vue';
const tableProps = [
{
prop: 'createTime',
@ -62,7 +66,7 @@ const tableProps = [
},
{
prop: 'code',
label: '班组编码',
label: '编码',
minWidth: 220
},
{
@ -71,17 +75,22 @@ const tableProps = [
},
{
prop: 'leaderName',
label: '班组组长'
label: '组长'
},
{
prop: 'enabled',
label: '班组状态',
subcomponent: StatusBtn
}
},
{
prop: 'workerName',
label: '组员',
subcomponent: WorkerOperate
},
]
export default {
name: "GroupTeam",
components: { GroupTeamAdd },
components: { GroupTeamAdd, WorkerEdit },
data() {
return {
formConfig: [
@ -93,9 +102,9 @@ export default {
},
{
type: 'input',
label: '班组编码',
placeholder: '班组编码',
param: 'code'
label: '组长',
placeholder: '组长',
param: 'leaderName'
},
{
type: 'button',
@ -144,7 +153,8 @@ export default {
pageSize: 20,
name: null,
code: null
}
},
paramVisible: false
};
},
created() {
@ -158,8 +168,8 @@ export default {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.leaderName = val.leaderName
this.queryParams.name = val.name
this.queryParams.code = val.code
this.getList()
break
default:
@ -191,12 +201,20 @@ export default {
}
},
//
handleTableEvents(data) {
updateGroupTeam({ ...data }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
}
})
handleTableEvents(params) {
console.log(params)
if (params.name === 'state') {//
updateGroupTeam({ ...params.payload }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
}
})
}else {// &
this.paramVisible = true
this.$nextTick(() => {
this.$refs.workerEditParam.init(params)
})
}
},
handleCancel() {
this.$refs.groupList.formClear()
@ -219,6 +237,9 @@ export default {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
closeDrawer() {
this.getList()
}
}
};

View File

@ -0,0 +1,46 @@
<template>
<div>
<el-drawer title="查看详情" :visible.sync="visible" size="70%">
<div class="box">
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
</div>
</el-drawer>
</div>
</template>
<script>
import { getByScheduling } from '@/api/monitoring/groupTeamView'
export default {
name: 'schedulingMonitoringDetail',
data() {
return {
visible: false,
tableProps: [],
tableData: [],
tableH: this.tableHeight(200)
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(200)
})
},
methods: {
init(id) {
this.visible = true
console.log(id)
getByScheduling({id}).then(res => {
console.log(res)
})
}
}
}
</script>
<style lang="scss" scoped>
.box {
padding: 0 32px;
}
</style>

View File

@ -0,0 +1,154 @@
<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="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 查看生产情况 -->
<scheduling-monitoring-detail v-if='paramVisible' ref='schedulingMonitoringDetail'/>
</div>
</template>
<script>
import { groupTeamSchedulingPage } from '@/api/base/groupTeamScheduling'
import { parseTime } from '@/utils/ruoyi'
import SchedulingMonitoringDetail from './components/schedulingMonitoringDetail'
const tableProps = [
{
prop: 'createTime',
label: '排班创建时间',
filter: parseTime
},
{
prop: 'startDay',
label: '上班日期'
},
{
prop: 'startTime',
label: '上班时间',
filter: parseTime
},
{
prop: 'endTime',
label: '下班时间',
filter: parseTime
},
{
prop: 'classesName',
label: '班次名称'
},
{
prop: 'teamName',
label: '班组名称'
}
]
const tableBtn = [
{
type: 'viewDetail',
btnName: '查看生产情况'
}
]
export default {
name: 'GroupTeamScheduling',
data() {
return {
formConfig: [
{
type: 'select',
label: '班次信息',
selectOptions: [],
param: 'classesId'
},
{
type: 'input',
label: '班组信息',
placeholder: '班组信息',
param: 'teamName'
},
{
type: 'datePicker',
label: '上班日期',
dateType: 'date',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
param: 'startDay',
defaultSelect: '',
width: 200
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
classesId: '',
teamName: '',
startDay: ''
},
tableProps,
tableBtn,
list: [],
tableH: this.tableHeight(220),
total: 0,
paramVisible: false
}
},
components: { SchedulingMonitoringDetail },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(220)
})
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.cnName = val.cnName
this.getList()
},
getList() {
groupTeamSchedulingPage().then(res => {
console.log(res)
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
handleClick(val) {
console.log(val)
this.paramVisible = true
this.$nextTick(() => {
this.$refs.schedulingMonitoringDetail.init(val.data.id)
})
}
}
}
</script>

View File

@ -0,0 +1,85 @@
<template>
<div>
<el-drawer title="查看详情" :visible.sync="visible" size="70%">
<div class="box">
<el-form :inline="true">
<el-form-item label="工单名称">
<el-input v-model="queryParams.workOrderName" size='small' readonly></el-input>
</el-form-item>
<el-form-item label="班组名称">
<el-input v-model="queryParams.teamName" size='small' readonly></el-input>
</el-form-item>
</el-form>
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
</div>
</el-drawer>
</div>
</template>
<script>
import { getByTeam } from '@/api/monitoring/groupTeamView'
import { parseTime } from '@/utils/ruoyi'
const tableProps = [
{
prop: 'startTime',
label: '开始时间',
filter: parseTime,
minWidth: 150
},
{
prop: 'endTime',
label: '结束时间',
filter: parseTime,
minWidth: 150
},
{
prop: 'num',
label: '人数'
},
{
prop: 'workTime',
label: '工作时长'
}
]
export default {
name: 'GroupTeamViewDetail',
data() {
return {
visible: false,
workOrderName: '',
teamName: '',
tableProps,
tableData: [],
tableH: this.tableHeight(200),
queryParams: {}
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(200)
})
},
methods: {
init(params) {
console.log(params)
this.visible = true
this.queryParams = params
getByTeam({
teamId: this.queryParams.teamId,
workOrderId: this.queryParams.workOrderId
}).then(res => {
console.log(res)
this.tableData = res.data || []
})
}
}
}
</script>
<style lang="scss" scoped>
.box {
padding: 0 32px;
}
</style>

View File

@ -0,0 +1,130 @@
<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="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<!-- 查看详情 -->
<group-team-view-detail v-if="paramVisible" ref="groupTeamViewDetail"/>
</div>
</template>
<script>
import { getByWorkOrder } from '@/api/monitoring/groupTeamView'
import { workOrderList } from '@/api/base/workOrder'
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue'
const tableProps = [
{
prop: 'name',
label: '班组名称'
},
{
prop: 'leaderName',
label: '班组长'
},
{
prop: 'num',
label: '人数'
},
{
prop: 'workCount',
label: '上班次数'
}
]
const tableBtn = [
{
type: 'detail',
btnName: '详情'
}
]
export default {
name: 'GroupTeamView',
data() {
return {
formConfig: [
{
type: 'input',
label: '工单名称',
placeholder: '工单名称',
param: 'cnName'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
//
queryParams: {
pageNo: 1,
pageSize: 1000,
workOrderId: ''
},
workOrderName: '工单名称ddd',
tableBtn,
tableProps,
tableH: this.tableHeight(220),
list: [],
paramVisible: false
}
},
components: { GroupTeamViewDetail },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(220)
})
},
methods: {
// list
getOrderList() {
workOrderList().then(res => {
})
},
//
buttonClick(val) {
// this.queryParams.workOrderId = val.id
this.queryParams.workOrderId = 1
this.getList()
},
// table
getList() {
getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => {
console.log(res)
this.list = res.data
})
},
handleClick(val) {
console.log(val)
this.paramVisible = true
let params = {}
params.teamId = val.data.id
params.teamName = val.data.name
params.workOrderId = this.queryParams.workOrderId
params.workOrderName = this.workOrderName
this.$nextTick(() => {
this.$refs.groupTeamViewDetail.init(params)
})
}
}
}
</script>

View File

@ -0,0 +1,243 @@
<template>
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form">
<el-row>
<el-col :span='12'>
<el-form-item label="订单名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="订单号" prop="code">
<el-input v-model="form.code" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<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='12'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<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='12'>
<el-form-item label="产品规格" prop="productSpec">
<el-input v-model="form.productSpec" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="客户" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in customerList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;">
<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-row>
<el-row>
<el-col :span='12'>
<el-form-item label="包装规格" prop="packSpec">
<el-input v-model="form.packSpec" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;">
<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='12'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-radio-group v-model="form.materialMethod">
<el-radio :label="1">产品基础</el-radio>
<el-radio :label="2">工艺扩展</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="订单计划开始时间" prop="planStartTime">
<el-date-picker
v-model="form.planStartTime"
type="date"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="订单计划完成时间" prop="planFinishTime">
<el-date-picker
v-model="form.planFinishTime"
type="date"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='24'>
<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 } 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: '',
productSpec: '',
customerId: '',
priority: '',
packSpec: '',
workers: '',
processFlowId: '',
materialMethod: '1',
planStartTime: '',
planFinishTime: '',
remark: '',
description: ''
},
rules: {
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
},
productList: [],
customerList: [],
isEdit: false //
}
},
methods: {
init(id) {
this.getList()
if (id) {
this.isEdit = true
this.form.id = id
getOrderById(id).then(res => {
if (res.code === 0) {
this.form = res.data
// this.selectLeader()
}
})
} 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 || []
})
//
},
submitForm() {
this.$refs['orderAddForm'].validate((valid) => {
if (valid) {
if (this.isEdit) {
//
updateGroupTeam({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
createGroupTeam({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.orderAddForm.resetFields()
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,244 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='70%'
>
<order-add ref="orderAdd" @successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderPage } from '@/api/base/orderManage'
import OrderAdd from './components/orderAdd.vue'
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 150
},
{
prop: 'name',
label: '订单名称'
},
{
prop: 'code',
label: '订单编码',
minWidth: 220
},
{
prop: 'num',
label: '客户'
},
{
prop: 'leaderName',
label: '来源'
},
{
prop: 'leaderName1',
label: '优先级'
},
{
prop: 'leaderNam1e',
label: '订单状态'
},
{
prop: 'leaderName3',
label: '计划加工量'
},
{
prop: 'leaderName9',
label: '实际加工量'
},
{
prop: 'leaderN4ame',
label: '产品'
},
{
prop: 'leade2rName',
label: '单位'
},
{
prop: 'leaderN11ame',
label: '单价(元)'
},
{
prop: 'leaderName22',
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: 'separate'
},
{
type: '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:group-team:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:group-team:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false
}
},
components: { OrderAdd },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList();
},
methods: {
getList() {
getOrderPage({...this.queryParams}).then(res => {
console.log(res)
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (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
}
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.$nextTick(() => {
this.$refs.groupList.init(val.data.id)
})
this.centervisible = true
break
default:
this.handleDelete(val.data)
}
},
//
handleCancel() {
this.$refs.orderAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.orderAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
}
}
</script>

View File

@ -36,7 +36,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
['/proxy-api']: {
target: `http://localhost:48080`,
target: `http://localhost:80`,
// target: `http://api-dashboard.yudao.iocoder.cn`,
changeOrigin: true,
pathRewrite: {