Compare commits

..

No commits in common. "e11c71edf1abf861701cda91ea3d8a239ebe5cd1" and "8e0ac6f96256536728d7d1e2dc2bf2a09b1d5c7e" have entirely different histories.

11 changed files with 321 additions and 520 deletions

View File

@ -1,8 +1,8 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-10-21 16:41:54
# @LastEditors: zwq
# @LastEditTime: 2024-09-02 09:07:05
# @LastEditors: zhp
# @Description:
###
# 开发环境配置
@ -22,7 +22,7 @@ VUE_APP_TITLE = MES系统
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.64:48082'
VUE_APP_BASE_API = 'http://mes2.kszny.picaiba.com'
VUE_APP_BASE_API = 'http://192.168.1.20:48082'

View File

@ -407,7 +407,7 @@ export default {
}
}
.current-date {
font-size: 15px;
font-size: 10px;
font-weight: 500;
position: absolute;
right: 0px;

View File

@ -44,17 +44,16 @@ import { Message } from 'element-ui';
import LocalDataManager from './utils/local-data-manager';
// import response from './response';
import moment from 'moment';
import { parseTime } from '@/utils/ruoyi'
export default {
name: 'EquipmentFullParams',
components: {},
props: {},
data() {
// const now = new Date().getTime();
// const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date().getTime();
const tenminAgo = new Date(today - (10 * 60 * 1000)).getTime();
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const aWeekAgo = today - 3600 * 1000 * 24 * 7;
return {
searchBarFormConfig: [
{
@ -74,10 +73,10 @@ export default {
{
type: 'datePicker',
label: '时间段',
dateType: 'datetimerange', // datetimerange
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
@ -94,20 +93,14 @@ export default {
},
],
queryParams: {
equipmentId: null,
recordTime: [parseTime(tenminAgo), parseTime(today)],
id: null,
time: [new Date(aWeekAgo), new Date(today)],
},
tableList: [
// {
// key: 'base-table__key__1',
// tableProps: [{
// prop: 'name',
// label: 'name'
// }],
// dataManager: {dataList: [{name: '1'}]},
// list: [{
// name: '11'
// }],
// tableProps: [],
// list: [],
// pageNo: 1,
// pageSize: 3,
// total: 0,
@ -118,7 +111,7 @@ export default {
beforeRouteEnter(to, from, next) {
if (Object.keys(to.params).length > 0) {
next((vm) => {
vm.$set(vm.queryParams, 'equipmentId', to.params.equipmentId);
vm.$set(vm.queryParams, 'id', to.params.equipmentId);
vm.$set(
vm.searchBarFormConfig[0],
'defaultSelect',
@ -129,11 +122,6 @@ export default {
'defaultSelect',
to.params.equipmentCode
);
vm.$set(
vm.searchBarFormConfig[2],
'defaultSelect',
vm.queryParams.recordTime
);
vm.handleQuery();
});
} else {
@ -167,7 +155,7 @@ export default {
},
beforeRouteLeave(to, from, next) {
// clean job
this.$set(this.queryParams, 'equipmentId', null);
this.$set(this.queryParams, 'id', null);
this.$set(this.searchBarFormConfig[0], 'defaultSelect', null);
this.$set(this.searchBarFormConfig[1], 'defaultSelect', null);
this.tableList = [];
@ -204,7 +192,7 @@ export default {
props.push({
label: item.name,
prop: item.name,
// width: 128,
width: 128,
});
firstLineData[item.name] = `${item.minValue ?? ''}-${
item.maxValue ?? ''
@ -280,18 +268,11 @@ export default {
async handleSearchBarBtnClick({ btnName, timeVal }) {
if (timeVal && timeVal.length > 0) {
console.log('nihc ', timeVal)
if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) {
this.queryParams.recordTime = timeVal;
this.queryParams.time = timeVal;
} else {
this.queryParams.time = [];
}
await this.handleQuery();
} else {
this.$message.warning('时间范围最大30分钟限制')
}
} else {
this.queryParams.recordTime = [];
this.$message.warning('时间段必选!')
}
},
handleEmitFun(table, val) {
@ -314,12 +295,9 @@ export default {
}
.tables {
/* display: grid; */
/* grid-template-columns: 1fr 1fr; */
/* gap: 18px; */
display: flex;
flex-direction: column;
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 18px;
}
.tables >>> .baseTable {
@ -328,6 +306,5 @@ export default {
.custom-table {
overflow-x: hidden;
margin-bottom: 10px;
}
</style>

View File

@ -22,7 +22,7 @@ export default {
},
methods: {
changeInput() {
this.list.sType = 1
console.log(this.list)
this.$emit('emitData', this.list)
}
}

View File

@ -31,15 +31,9 @@
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="产品规格" prop="specifications">
<el-input v-model="form.specifications"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="交货日期" prop="deliveTime">
<el-date-picker v-model="form.deliveTime" type="datetime" style="width: 100%;" value-format="timestamp"
@change="timeChange" placeholder="选择日期">
</el-date-picker>
<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'>
@ -51,9 +45,19 @@
</el-form-item>
</el-col>
<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 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-col :span='6'>
<el-form-item label="交货日期" prop="deliveTime">
<el-date-picker v-model="form.deliveTime" type="datetime" style="width: 100%;" value-format="timestamp"
@change="timeChange" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
@ -61,12 +65,8 @@
</el-row>
<el-row :gutter="20">
<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 label="产品规格" prop="specifications">
<el-input v-model="form.specifications"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>

View File

@ -1,79 +1,51 @@
<!--
* @Author: zwq
* @Date: 2024-09-26 14:08:58
* @LastEditors: zwq
* @LastEditTime: 2024-11-05 14:19:46
* @Author: zhp
* @Date: 2024-08-01 16:27:30
* @LastEditTime: 2024-09-04 15:56:53
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form
ref="orderAddForm"
:rules="rules"
:model="form"
:inline="true"
class="demo-form-inline">
<el-form ref="orderAddForm" :rules="rules" :model="form" :inline="true" class="demo-form-inline">
<!-- <el-row :gutter="20"> -->
<!-- <el-col :span='6'> -->
<el-form-item label="拆分数量" prop="attr3">
<el-input
v-model.number="form.attr3"
oninput="value=value.replace(/[^\d]/g,'')"></el-input>
<el-input v-model.number="form.attr3" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSplit">确定</el-button>
</el-form-item>
<!-- </el-col> -->
<!-- </el-row> -->
<base-table
:table-props="tableProps"
:table-data="list"
@emitFun="inputChange"
:max-height="tableH">
<base-table :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>
</el-form>
</template>
<script>
import {
getOrderCode,
getOrderById,
getProcessFlowList,
orderUpdate,
orderCreate,
orderSplit,
} from '@/api/base/orderManage';
import { getCustomerList } from '@/api/base/customer';
import { parseTime } from '@/utils/ruoyi';
import inputArea from './inputArea.vue';
import selectMember from './selectMember';
import selectTime from './selectTime';
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate, orderSplit } from '@/api/base/orderManage'
import { parseTime } from '@/utils/ruoyi'
import inputArea from './inputArea.vue'
const tableProps = [
{
prop: 'name',
label: '订单名称',
minWidth: 120,
showOverflowtooltip: true,
subcomponent: inputArea,
subcomponent: inputArea
},
{
prop: 'code',
label: '订单编码',
minWidth: 180,
subcomponent: inputArea,
subcomponent: inputArea
},
{
prop: 'productName',
label: '产品',
showOverflowtooltip: true,
subcomponent: inputArea,
},
{
prop: 'specifications',
label: '产品规格',
showOverflowtooltip: true,
subcomponent: inputArea,
subcomponent: inputArea
},
// {
// prop: 'priority',
@ -84,40 +56,40 @@ const tableProps = [
prop: 'planQuantity',
label: '计划加工量',
width: 100,
subcomponent: inputArea,
subcomponent: inputArea
},
{
prop: 'deliveTime',
label: '交货日期',
filter: parseTime,
minWidth: 160,
subcomponent: selectTime,
subcomponent: inputArea
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true,
subcomponent: selectMember,
subcomponent: inputArea
},
{
prop: 'price',
label: '单价',
width: 100,
subcomponent: inputArea,
subcomponent: inputArea
},
{
prop: 'packSpec',
label: '包装规格',
width: 100,
subcomponent: selectMember,
subcomponent: inputArea
},
{
prop: 'remark',
label: '备注',
width: 100,
subcomponent: inputArea,
subcomponent: inputArea
},
];
]
export default {
name: 'OrderAdd',
data() {
@ -133,57 +105,47 @@ export default {
planProductId: '',
price: '',
customerId: '',
attr3: undefined,
attr3:undefined,
priority: '',
packSpec: '',
workers: '',
materialMethod: 1,
remark: '',
deliveTime: undefined,
deliveTime:undefined,
// description: '',
planStartTime: '',
},
rules: {
attr3: [
{ required: true, message: '拆分数量不能为空', trigger: 'blur' },
],
attr3: [{ required: true, message: "拆分数量不能为空", trigger: "blur" }],
},
productList: [],
customerList: [],
processFlowList: [],
isEdit: false, //
};
isEdit: false //
}
},
created() {
created () {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.tableH = this.tableHeight(260)
})
},
methods: {
handleSplit() {
if (this.form.attr3) {
this.list = [];
let obj = {
attr3: this.form.attr3,
id: this.form.id,
};
orderSplit(obj).then((res) => {
this.list = res.data;
this.list.forEach((item, index) => {
item.name = item.name + '-' + (index + 1);
});
});
} else {
this.$message('拆分数量不能为空');
id:this.form.id
}
orderSplit(obj).then((res) => {
this.list = res.data
})
},
init(obj) {
this.getList();
// this.getList()
// if (obj) {
this.isEdit = true;
this.form = {};
this.list = [];
this.form.id = obj.id;
this.isEdit = true
this.form = {}
this.list = []
this.form.id = obj.id
// getOrderById({id: this.form.id}).then(res => {
// if (res.code === 0) {
// this.form.name = res.data.name
@ -212,21 +174,20 @@ export default {
// })
// }
},
getList() {
//
// getList() {
// //
// getProductAll().then(res => {
// this.productList = res.data || []
// })
//
getCustomerList().then((res) => {
this.customerList = res.data || [];
this.$set(this.tableProps[6], 'customerList', this.customerList);
});
//
// //
// 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) {
@ -248,29 +209,11 @@ export default {
// this.form.materialMethod = 1
// }
// },
inputChange(data) {
console.log(data)
switch (data.sType) {
case 1:
this.list[data._pageIndex - 1][data.prop] = data[data.prop];
break;
case 2:
this.list[data._pageIndex - 1][data.prop] = data[data.prop];
break;
case 3:
this.list[data._pageIndex - 1][data.prop] = data.deliveTime;
break;
default:
console.log(val);
}
},
submitForm() {
Promise.all(
this.list.map((ele) => {
Promise.all(this.list.map((ele) => {
return orderCreate(ele);
})
).then((res) => {
this.$modal.msgSuccess('操作成功');
})).then((res) => {
this.$modal.msgSuccess("操作成功");
this.$emit('splitWorkOrderSubmit');
});
@ -307,8 +250,8 @@ export default {
// })
},
formClear() {
this.$refs.orderAddForm.resetFields();
},
},
};
this.$refs.orderAddForm.resetFields()
}
}
}
</script>

View File

@ -1,51 +0,0 @@
<template>
<div class="tableInner">
<el-select
v-model="list[list.prop]"
@change="changeInput">
<el-option
v-for="item in list.prop === 'packSpec'
? getDictDatas(DICT_TYPE.PACK_SPEC)
: list.customerList"
:key="list.prop === 'packSpec' ? item.value : item.id"
:label="list.prop === 'packSpec' ? item.label : item.name"
:value="
list.prop === 'packSpec' ? parseInt(item.value) : item.id
"></el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
};
},
created() {
},
methods: {
changeInput() {
this.list.sType = 2;
this.$emit('emitData', this.list);
},
},
};
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -1,47 +0,0 @@
<template>
<div class="tableInner">
<el-date-picker
@change="changeInput"
v-model="list.deliveTime"
type="datetime"
size="mini"
:style="{width:'100%'}"
format='yyyy-MM-dd'
value-format="timestamp"
prefix-icon="none"
placeholder="选择日期">
</el-date-picker>
</div>
</template>
<script>
export default {
name: "InputArea",
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
};
},
methods: {
changeInput() {
this.list.sType = 3
this.$emit("emitData", this.list);
},
},
};
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -39,11 +39,11 @@ import orderNum from './components/orderNum.vue'
import AddWorkOrder from './components/addWorkOrder'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
// {
// prop: 'type',
// label: '',
// showOverflowtooltip: true
// },
{
prop: 'type',
label: '订单类型',
showOverflowtooltip: true
},
{
prop: 'createTime',
label: '添加时间',
@ -59,10 +59,10 @@ const tableProps = [
{
prop: 'code',
label: '订单编码',
minWidth: 160
minWidth: 180
},
{
prop: 'customerName',
prop: 'customerId',
label: '客户',
showOverflowtooltip: true
},
@ -93,7 +93,7 @@ const tableProps = [
},
{
prop: 'deliveTime',
label: '交货时间',
label: '添加时间',
filter: parseTime,
minWidth: 160
},
@ -170,8 +170,8 @@ export default {
this.$auth.hasPermi('base:order-manage:split')
? {
type: 'split',
btnName: '拆分单',
showTip: '拆分单',
btnName: '拆分单',
showTip: '拆分单',
showParam: {
type: '&',
data: [

View File

@ -21,7 +21,7 @@
<div class="lightTip">{{ orderMsg.name }}</div>
</el-col>
<el-col :span="3">
<div class="blodTip">产品名称</div>
<div class="blodTip">产品信息</div>
<div class="lightTip">{{ orderMsg.productName }}</div>
</el-col>
<el-col :span="3">
@ -38,41 +38,37 @@
{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec) }}
</div>
</el-col>
<el-col :span='3'>
<!-- <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.planStartTime) }}</div>
</el-col> -->
</el-row>
<el-row>
<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.deliveTime) }}</div>
<div class="blodTip">计划开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
</el-col>
<!-- <el-col :span="3">
</el-row>
<el-row>
<el-col :span="3">
<div class="blodTip">计划完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
</el-col> -->
</el-col>
<el-col :span="3">
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{ orderMsg.planQuantity }}</div>
</el-col>
<!-- <el-col :span="3">
<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>
<el-col :span="3">
<div class="blodTip">状态</div>
<div class="lightTip">
@ -91,12 +87,12 @@
{{ parseTime(orderMsg.finishProduceTime) }}
</div>
</el-col>
</el-row>
<el-row>
<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>
@ -106,13 +102,9 @@
<div class="lightTip">{{ orderMsg.nokQuantity }}</div>
</el-col>
<el-col :span="3">
<div class="blodTip">备注</div>
<div class="lightTip">{{ orderMsg.remark }}</div>
</el-col>
<!-- <el-col :span="3">
<div class="blodTip">负责人</div>
<div class="lightTip">{{ orderMsg.workers }}</div>
</el-col> -->
</el-col>
<!-- <el-col :span='3'>
<div class="blodTip">关联工艺</div>
<div class="lightTip">{{processFlowName}}</div>
@ -283,11 +275,11 @@ export default {
processFlowName: '',
};
},
activated() {
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2;
});
this.orderId = location.href.split('=')[1];
this.orderId = location.href.split('?')[1].split('=')[1];
this.getMsg();
},
watch: {
@ -308,12 +300,11 @@ export default {
},
initData(to) {
if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('=')[1];
this.orderId = location.href.split('?')[1].split('=')[1];
this.getMsg();
}
},
getMsg() {
console.log(this.orderId)
orderDetail({
id: this.orderId,
}).then((res) => {

View File

@ -122,7 +122,7 @@
<el-form-item label="负责部门" prop="deptId">
<el-select
v-model="dataForm.deptId"
placeholder="请选择负责部门"
placeholder="请选择关联产线"
style="width: 100%">
<el-option
v-for="item in deptList"
@ -142,7 +142,9 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<span class="add-type">物料计算方式</span>
<span style="margin: 0 20px 15px 0; display: inline-block">
物料计算方式
</span>
<el-radio-group
v-model="dataForm.materialMethod"
@change="materialMethodChange">
@ -159,7 +161,7 @@
<div v-if="dataForm.materialMethod === 1">
<el-row :gutter="20">
<el-col :span="24">
<span style="margin: 8px 0;" class="add-type">关联产线</span>
<span style="margin: 8px 0; display: inline-block">关联产线</span>
<el-button style="margin-left: 20px" type="text" @click="addBind">
新增
</el-button>
@ -311,9 +313,6 @@ export default {
planQuantity: [
{ required: true, message: '计划生产数量不能为空', trigger: 'blur' },
],
deptId: [
{ required: true, message: '负责部门不能为空', trigger: 'change' },
],
},
productList: [],
processFlowList: [],
@ -483,14 +482,3 @@ export default {
},
};
</script>
<style scoped>
.add-type {
margin: 0 20px 15px 0;
display: inline-block;
}
.add-type::before {
content: '*';
color: #ff4949;
margin-right: 4px;
}
</style>