This commit is contained in:
‘937886381’ 2024-08-13 08:36:23 +08:00
parent 0029af4ffa
commit d6acfa4fd7
5 changed files with 265 additions and 129 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-07-31 14:57:31 # @LastEditTime: 2024-08-02 16:01:31
# @LastEditors: zhp # @LastEditors: zhp
# @Description: # @Description:
### ###
@ -13,7 +13,7 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082' # VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082' VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080' # VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.81:48082' # VUE_APP_BASE_API = 'http://192.168.1.81:48082'
@ -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.1.56:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.64:48082' # VUE_APP_BASE_API = 'http://192.168.1.64:48082'
VUE_APP_BASE_API = 'http://192.168.1.99:48082' # VUE_APP_BASE_API = 'http://192.168.1.99:48082'

View File

@ -165,3 +165,11 @@ export function orderVoid(data) {
data data
}) })
} }
export function orderSplit(data) {
return request({
url: '/base/order/split',
method: 'post',
data
})
}

View File

@ -0,0 +1,37 @@
<template>
<div class="tableInner">
<el-input v-model="list[itemProp]" @blur="changeInput" />
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeInput() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -1,29 +1,105 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-08-01 16:27:30 * @Date: 2024-08-01 16:27:30
* @LastEditTime: 2024-08-01 16:29:31 * @LastEditTime: 2024-08-02 15:27:58
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'> <el-form ref="orderAddForm" :rules="rules" :model="form" :inline="true" class="demo-form-inline">
<el-row :gutter="20"> <!-- <el-row :gutter="20"> -->
<el-col :span='6'> <!-- <el-col :span='6'> -->
<el-form-item label="订单名称" prop="name"> <el-form-item label="拆分数量" prop="attr3">
<el-input v-model="form.name"></el-input> <el-input v-model.number="form.attr3" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
</el-form-item> </el-form-item>
</el-col> <el-form-item>
</el-row> <el-button type="primary" @click="handleSplit">确定</el-button>
</el-form-item>
<!-- </el-col> -->
<!-- </el-row> -->
<base-table @emitFun="inputChange" :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> </el-form>
</template> </template>
<script> <script>
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage' import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate, orderSplit } from '@/api/base/orderManage'
import { getProductAll } from '@/api/base/product' import { getProductAll } from '@/api/base/product'
import { getCustomerList } from '@/api/base/customer' import { getCustomerList } from '@/api/base/customer'
import { parseTime } from '@/utils/ruoyi'
// import { publicFormatter } from '@/utils/dict'
import inputArea from './inputArea.vue'
const tableProps = [
{
prop: 'name',
label: '订单名称',
minWidth: 120,
showOverflowtooltip: true,
subcomponent: inputArea
},
{
prop: 'code',
label: '订单编码',
minWidth: 180,
subcomponent: inputArea
},
{
prop: 'productName',
label: '产品',
showOverflowtooltip: true,
subcomponent: inputArea
},
// {
// prop: 'priority',
// label: '',
// filter: publicFormatter('order_priority')
// },
{
prop: 'planQuantity',
label: '计划加工量',
width: 100,
subcomponent: inputArea
},
{
prop: 'deliveTime',
label: '交货日期',
filter: parseTime,
minWidth: 160,
subcomponent: inputArea
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true,
subcomponent: inputArea
},
{
prop: 'price',
label: '单价',
width: 100,
subcomponent: inputArea
},
{
prop: 'packSpec',
label: '包装规格',
width: 100,
subcomponent: inputArea
},
{
prop: 'remark',
label: '备注',
width: 100,
subcomponent: inputArea
},
]
export default { export default {
name: 'OrderAdd', name: 'OrderAdd',
data() { data() {
return { return {
tableProps,
list: [],
tableH: this.tableHeight(260),
form: { form: {
id: '', id: '',
name: '', name: '',
@ -32,6 +108,7 @@ export default {
planProductId: '', planProductId: '',
price: '', price: '',
customerId: '', customerId: '',
attr3:undefined,
priority: '', priority: '',
packSpec: '', packSpec: '',
workers: '', workers: '',
@ -42,10 +119,7 @@ export default {
planStartTime: '', planStartTime: '',
}, },
rules: { rules: {
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }], attr3: [{ required: true, message: "拆分数量不能为空", trigger: "blur" }],
code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
}, },
productList: [], productList: [],
customerList: [], customerList: [],
@ -53,12 +127,26 @@ export default {
isEdit: false // isEdit: false //
} }
}, },
created () {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
},
methods: { methods: {
init(id) { handleSplit() {
this.getList() let obj = {
if (id) { attr3: this.form.attr3,
id:this.form.id
}
orderSplit(obj).then((res) => {
this.list = res.data
})
},
init(obj) {
// this.getList()
if (obj) {
this.isEdit = true this.isEdit = true
this.form.id = id this.form.id = obj.id
getOrderById({id: this.form.id}).then(res => { getOrderById({id: this.form.id}).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.form.name = res.data.name this.form.name = res.data.name
@ -87,73 +175,80 @@ export default {
}) })
} }
}, },
getList() { // getList() {
// // //
getProductAll().then(res => { // getProductAll().then(res => {
this.productList = res.data || [] // this.productList = res.data || []
}) // })
// // //
getCustomerList().then(res => { // getCustomerList().then(res => {
this.customerList = res.data || [] // this.customerList = res.data || []
}) // })
// // //
getProcessFlowList().then(res => { // getProcessFlowList().then(res => {
this.processFlowList = res.data || [] // this.processFlowList = res.data || []
}) // })
}, // },
timeChange() { // timeChange() {
if (this.form.planStartTime && this.form.planFinishTime) { // if (this.form.planStartTime && this.form.planFinishTime) {
if (this.form.planStartTime > this.form.planFinishTime) { // if (this.form.planStartTime > this.form.planFinishTime) {
this.$modal.msgError('计划开始时间不能大于结束时间') // this.$modal.msgError('')
} // }
} // }
}, // },
// // //
materialMethodChange(val) { // materialMethodChange(val) {
if (val === 2 && !this.form.processFlowId) { // if (val === 2 && !this.form.processFlowId) {
this.form.materialMethod = 1 // this.form.materialMethod = 1
this.$modal.msgError("请先选择关联工艺"); // this.$modal.msgError("");
} // }
}, // },
// // //
processFlowIdChange(val) { // processFlowIdChange(val) {
console.log(val) // console.log(val)
if (!val) { // if (!val) {
this.form.materialMethod = 1 // this.form.materialMethod = 1
} // }
}, // },
submitForm() { submitForm() {
this.$refs['orderAddForm'].validate((valid) => { Promise.all(this.list.forEach((ele) => {
if (valid) { orderCreate(ele)
if (this.form.planStartTime && this.form.planFinishTime) { })).then((res) => {
if (this.form.planStartTime > this.form.planFinishTime) { this.$modal.msgSuccess("操作成功");
this.$modal.msgError('计划开始时间不能大于结束时间') this.$emit('successSubmit')
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
}
}) })
// 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() { formClear() {
this.$refs.orderAddForm.resetFields() this.$refs.orderAddForm.resetFields()

View File

@ -1,57 +1,30 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo" :max-height="tableH">
:limit="queryParams.pageSize" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="240" label="操作" :method-list="tableBtn"
:table-props="tableProps" @clickBtn="handleClick" />
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="240"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table> </base-table>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 --> <!-- 新增&编辑 -->
<base-dialog <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
:dialogTitle="addOrEditTitle" @confirm="handleConfirm" :before-close="handleCancel" width='60%'>
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='60%'
>
<order-add ref="orderAdd" @successSubmit="successSubmit" /> <order-add ref="orderAdd" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
<!-- 查看详情 --> <!-- 查看详情 -->
<!-- 新增工单 --> <!-- 新增工单 -->
<base-dialog <base-dialog :dialogTitle="workIssueTitle" :dialogVisible="addWorkOrdervisible" @cancel="addWorkOrderCancel"
:dialogTitle="workIssueTitle" @confirm="addWorkOrderConfirm" :before-close="addWorkOrderCancel" width='70%'>
:dialogVisible="addWorkOrdervisible"
@cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel"
width='70%'
>
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" /> <add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
</base-dialog> </base-dialog>
<base-dialog :dialogTitle="splitTitle" :dialogVisible="splitWorkOrdervisible" @cancel="splitWorkOrderCancel"
@confirm="splitWorkOrderConfirm" :before-close="splitWorkOrderCancel" width='70%'>
<order-split ref="splitWorkOrder" @splitWorkOrderSubmit="splitWorkOrderSubmit" />
</base-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -175,6 +148,8 @@ export default {
plain: true plain: true
} }
], ],
splitTitle: '拆分订单',
splitWorkOrdervisible:false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@ -338,7 +313,7 @@ export default {
orderDetailVisible: false orderDetailVisible: false
} }
}, },
components: { OrderAdd, AddWorkOrder }, components: { OrderAdd, AddWorkOrder,orderSplit },
created() { created() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
@ -419,6 +394,16 @@ export default {
console.log(res) console.log(res)
}) })
break break
case 'split':
this.splitTitle = '拆分订单'
this.splitWorkOrdervisible = true
this.$nextTick(() => {
this.$refs.splitWorkOrder.init(val.data)
})
// orderVoid({ id: val.data.id }).then((res) => {
// console.log(res)
// })
break
case 'bind': case 'bind':
this.workIssueTitle = '绑定工单' this.workIssueTitle = '绑定工单'
this.addWorkOrdervisible = true this.addWorkOrdervisible = true
@ -468,12 +453,23 @@ export default {
this.$refs.addWorkOrder.formClear() this.$refs.addWorkOrder.formClear()
this.addWorkOrdervisible = false this.addWorkOrdervisible = false
}, },
splitWorkOrderCancel() {
this.$refs.splitWorkOrder.formClear()
this.splitWorkOrdervisible = false
},
addWorkOrderConfirm() { addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit() this.$refs.addWorkOrder.addWorkOrderSubmit()
}, },
addWorkOrderSubmit() { addWorkOrderSubmit() {
this.addWorkOrderCancel() this.addWorkOrderCancel()
this.getList() this.getList()
},
splitWorkOrderConfirm() {
this.$refs.splitWorkOrder.splitWorkOrderSubmit()
},
splitWorkOrderSubmit() {
this.splitWorkOrderCancel()
this.getList()
} }
// bindWorkOrderCancel() { // bindWorkOrderCancel() {
// this.$refs.bindWorkOrder.formClear() // this.$refs.bindWorkOrder.formClear()