修改订单bug
This commit is contained in:
parent
3ada2c5d08
commit
3812eb38a9
@ -71,3 +71,21 @@ export function deliveryLogDetCreate(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得一条发货详细
|
||||
export function deliveryLogDetGet(query) {
|
||||
return request({
|
||||
url: '/extend/delivery-log-det/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑发货详情
|
||||
export function deliveryLogDetUpdate(data) {
|
||||
return request({
|
||||
url: '/extend/delivery-log-det/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -137,4 +137,13 @@ export function bomUseNum(query) {
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 完成订单
|
||||
export function orderFinish(query) {
|
||||
return request({
|
||||
url: '/base/order/finish',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -1,46 +1,69 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
title="发货清单详情"
|
||||
size="60%"
|
||||
:append-to-body="true"
|
||||
:visible.sync="centervisible"
|
||||
@close='close'>
|
||||
<div class="box1">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<span class="title">订单名:</span>
|
||||
<span class="text">{{orderName ? orderName : '-'}}</span>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<span class="title">发货单号:</span>
|
||||
<span class="text">{{code ? code : '-'}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="box2">
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>详情</span>
|
||||
<div>
|
||||
<el-drawer
|
||||
title="发货清单详情"
|
||||
size="60%"
|
||||
:append-to-body="true"
|
||||
:visible.sync="centervisible"
|
||||
@close='close'>
|
||||
<div class="box1">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<span class="title">订单名:</span>
|
||||
<span class="text">{{orderName ? orderName : '-'}}</span>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<span class="title">发货单号:</span>
|
||||
<span class="text">{{code ? code : '-'}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<div class="box2">
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>详情</span>
|
||||
</div>
|
||||
<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="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="editDetDetail"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<!-- 编辑详情 -->
|
||||
<base-dialog
|
||||
dialogTitle="编辑"
|
||||
:dialogVisible="detailEditVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%"
|
||||
>
|
||||
<edit-detail ref="editDetail" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { deliveryLogDetPage } from '@/api/base/delivery'
|
||||
import EditDetail from './editDetail.vue'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
@ -51,6 +74,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'deliveryCarCode',
|
||||
label: '装车单号',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
@ -96,11 +120,21 @@ export default {
|
||||
total: 0,
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('extend:delivery-log:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
tableH: this.tableHeight(275),
|
||||
orderName: '',
|
||||
code: ''
|
||||
code: '',
|
||||
detailEditVisible: false
|
||||
}
|
||||
},
|
||||
components: { EditDetail },
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(275)
|
||||
@ -128,6 +162,23 @@ export default {
|
||||
this.queryParams.logId = ''
|
||||
this.tableData = []
|
||||
this.total = 0
|
||||
},
|
||||
editDetDetail(val) {
|
||||
this.detailEditVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.editDetail.init(val.data.id)
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.editDetail.formClear()
|
||||
this.detailEditVisible = false
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.editDetail.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
124
src/views/delivery/deliveryLog/components/editDetail.vue
Normal file
124
src/views/delivery/deliveryLog/components/editDetail.vue
Normal file
@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="装车单号" prop="deliveryCarCode">
|
||||
<el-input v-model="form.deliveryCarCode"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="装车时间" prop="loadTime">
|
||||
<el-date-picker
|
||||
v-model="form.loadTime"
|
||||
type="datetime"
|
||||
format='yyyy-MM-dd HH:mm:ss'
|
||||
value-format="timestamp"
|
||||
style="width: 100%;"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="装车产品" prop="productId">
|
||||
<el-select v-model="form.productId" disabled 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-col :span='12'>
|
||||
<el-form-item label="装箱规格(片/箱)" prop="packagingSize">
|
||||
<el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="产品批次" prop="productDate">
|
||||
<el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="箱/托数" prop="packagingNum">
|
||||
<el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="装车总量" prop="quantity">
|
||||
<el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getProductAll } from '@/api/base/product'
|
||||
import { deliveryLogDetGet, deliveryLogDetUpdate } from '@/api/base/delivery'
|
||||
export default {
|
||||
name: 'editDetail',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
logId: '',
|
||||
deliveryCarCode: '',
|
||||
loadTime: null,
|
||||
productId: '',
|
||||
packagingSize: null,
|
||||
productDate: '',
|
||||
packagingNum: null,
|
||||
quantity: null
|
||||
},
|
||||
rules: {
|
||||
deliveryCarCode: [{ required: true, message: "装车单号不能为空", trigger: "blur" }],
|
||||
productId: [{ required: true, message: "装车产品不能为空", trigger: "change" }],
|
||||
packagingSize: [{ required: true, message: "装箱规格不能为空", trigger: "blur" }],
|
||||
packagingNum: [{ required: true, message: "箱/托数不能为空", trigger: "blur" }],
|
||||
quantity: [{ required: true, message: "装车总量不能为空", trigger: "blur" }]
|
||||
},
|
||||
productList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getSelectList()
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
deliveryLogDetGet({id}).then(res => {
|
||||
console.log(res)
|
||||
this.form = res.data
|
||||
})
|
||||
},
|
||||
getSelectList() {
|
||||
getProductAll().then(res => {
|
||||
this.productList = res.data || []
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['addOrUpdate'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(this.form)
|
||||
deliveryLogDetUpdate({ ...this.form }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.addOrUpdate.resetFields()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -302,7 +302,7 @@ export default {
|
||||
successSubmit2() {
|
||||
this.handleCancel2()
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -19,11 +19,11 @@
|
||||
<div class="lightTip">{{orderMsg.num ? orderMsg.num : '-'}}</div>
|
||||
</div>
|
||||
<div class="box_col">
|
||||
<div class="blodTip">累积占比(%)</div>
|
||||
<div class="blodTip">累计占比(%)</div>
|
||||
<div class="lightTip">{{orderMsg.rate ? orderMsg.rate : '-'}}</div>
|
||||
</div>
|
||||
<div class="box_col">
|
||||
<div class="blodTip">累积运输费用</div>
|
||||
<div class="blodTip">累计运输费用</div>
|
||||
<div class="lightTip">{{orderMsg.cost ? orderMsg.cost : '-'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -305,8 +305,11 @@ export default {
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
bottom: '5%',
|
||||
left: 'center',
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: '10%',
|
||||
top: 20,
|
||||
bottom: 20,
|
||||
icon: 'rect',
|
||||
itemHeight: 8,
|
||||
itemWidth: 8
|
||||
|
@ -61,7 +61,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'rate',
|
||||
label: '累积发货比例(%)'
|
||||
label: '累计发货比例(%)'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
|
@ -25,23 +25,18 @@
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" :disabled="isBind" style="width: 100%;" @change="selectProduct">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
: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='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="计划开始时间">
|
||||
<el-date-picker
|
||||
@ -54,6 +49,8 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="计划完成时间">
|
||||
<el-date-picker
|
||||
@ -66,23 +63,21 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<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-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<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-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="关联工艺" prop="processFlowId">
|
||||
<el-select v-model="form.processFlowId" placeholder="请选择" :disabled="isBind" style="width: 100%;">
|
||||
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in processFlowList"
|
||||
:key="item.id"
|
||||
@ -92,16 +87,16 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-radio-group v-model="form.materialMethod" :disabled="isBind">
|
||||
<el-radio-group v-model="form.materialMethod" disabled>
|
||||
<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="priority">
|
||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||
@ -114,6 +109,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||
@ -126,8 +123,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="关联产线" prop="productLineId">
|
||||
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
|
||||
@ -140,6 +135,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="form.workers" :disabled="isBind"></el-input>
|
||||
@ -170,7 +167,6 @@ export default {
|
||||
name: '',
|
||||
code: '',
|
||||
planProductId: '',
|
||||
productSpec: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
planAssignQuantity: 0,
|
||||
@ -205,14 +201,17 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id, param) {
|
||||
this.form.orderId = id
|
||||
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
|
||||
}
|
||||
@ -237,18 +236,6 @@ export default {
|
||||
this.workOrderList = res.data || []
|
||||
})
|
||||
},
|
||||
// 选产品带出规格
|
||||
selectProduct(val) {
|
||||
if (val) {
|
||||
this.productList.map(item => {
|
||||
if (val === item.id) {
|
||||
this.form.productSpec = item.specifications
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.form.productSpec = ''
|
||||
}
|
||||
},
|
||||
addWorkOrderSubmit() {
|
||||
this.$refs['addWorkOrder'].validate((valid) => {
|
||||
if (valid) {
|
||||
@ -298,8 +285,6 @@ export default {
|
||||
if (res.code === 0) {
|
||||
this.form.code = res.data.code
|
||||
this.form.planProductId = res.data.planProductId
|
||||
this.selectProduct(this.form.planProductId)
|
||||
this.form.productSpec = res.data.productSpec
|
||||
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
|
||||
|
@ -8,7 +8,7 @@
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="订单号" prop="code">
|
||||
<el-input v-model="form.code" disabled></el-input>
|
||||
<el-input v-model="form.code"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -20,12 +20,14 @@
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" @change="selectProduct">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
: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>
|
||||
@ -37,13 +39,6 @@
|
||||
<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%;">
|
||||
@ -56,6 +51,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;">
|
||||
@ -68,8 +65,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="包装规格" prop="packSpec">
|
||||
<el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;">
|
||||
@ -82,13 +77,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<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%;">
|
||||
@ -101,6 +96,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-radio-group v-model="form.materialMethod">
|
||||
@ -109,35 +106,33 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="订单计划开始时间">
|
||||
<el-form-item label="订单计划开始时间" prop="planStartTime">
|
||||
<el-date-picker
|
||||
v-model="planStartTime"
|
||||
type="date"
|
||||
format='yyyy-MM-dd'
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%;"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="订单计划完成时间">
|
||||
<el-date-picker
|
||||
v-model="planFinishTime"
|
||||
type="date"
|
||||
format='yyyy-MM-dd'
|
||||
value-format="yyyy-MM-dd"
|
||||
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>
|
||||
<el-col :span='24'>
|
||||
<el-col :span='12'>
|
||||
<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>
|
||||
@ -168,7 +163,6 @@ export default {
|
||||
planQuantity: '',
|
||||
planProductId: '',
|
||||
price: '',
|
||||
productSpec: '',
|
||||
customerId: '',
|
||||
priority: '',
|
||||
packSpec: '',
|
||||
@ -180,8 +174,6 @@ export default {
|
||||
planStartTime: '',
|
||||
planFinishTime: ''
|
||||
},
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
rules: {
|
||||
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
|
||||
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
|
||||
@ -205,16 +197,15 @@ export default {
|
||||
this.form.code = res.data.code
|
||||
this.form.planQuantity = res.data.planQuantity
|
||||
this.form.planProductId = res.data.planProductId
|
||||
this.selectProduct(this.form.planProductId)
|
||||
this.form.price = res.data.price
|
||||
this.form.customerId = res.data.customerId
|
||||
this.form.priority = res.data.priority ? res.data.priority + '' : ''
|
||||
this.planStartTime = res.data.planStartTime ? moment(res.data.planStartTime).format('YYYY-MM-DD') : null
|
||||
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.planFinishTime = res.data.planFinishTime ? moment(res.data.planFinishTime).format('YYYY-MM-DD') : null
|
||||
this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
|
||||
this.form.remark = res.data.remark
|
||||
this.form.description = res.data.description
|
||||
}
|
||||
@ -242,24 +233,23 @@ export default {
|
||||
this.processFlowList = res.data || []
|
||||
})
|
||||
},
|
||||
// 选产品带出规格
|
||||
selectProduct(val) {
|
||||
if (val) {
|
||||
this.productList.map(item => {
|
||||
if (val === item.id) {
|
||||
this.form.productSpec = item.specifications
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.form.productSpec = ''
|
||||
timeChange() {
|
||||
if (this.form.planStartTime && this.form.planFinishTime) {
|
||||
if (this.form.planStartTime > this.form.planFinishTime) {
|
||||
this.$modal.msgError('计划开始时间不能大于结束时间')
|
||||
}
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['orderAddForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.planStartTime = this.planStartTime ? new Date(this.planStartTime).valueOf() : ''
|
||||
this.form.planFinishTime = this.planFinishTime ? new Date(this.planFinishTime).valueOf() : ''
|
||||
console.log(this.form)
|
||||
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) => {
|
||||
@ -288,10 +278,6 @@ export default {
|
||||
this.form.materialMethod = 1
|
||||
this.form.price = 0.00
|
||||
this.form.planQuantity = 0
|
||||
this.planFinishTime = ''
|
||||
this.planStartTime = ''
|
||||
this.form.planFinishTime = ''
|
||||
this.form.planStartTime = ''
|
||||
this.isEdit = false
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="250"
|
||||
:width="320"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
@ -56,7 +56,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getOrderPage, orderDelete, customerList } from '@/api/base/orderManage'
|
||||
import { getOrderPage, orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
|
||||
import OrderAdd from './components/orderAdd'
|
||||
import AddWorkOrder from './components/addWorkOrder'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
@ -115,7 +115,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位'
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
@ -191,13 +192,49 @@ export default {
|
||||
this.$auth.hasPermi('base:order-manage:addWorkOrder')
|
||||
? {
|
||||
type: 'add',
|
||||
btnName: '新增工单'
|
||||
btnName: '新增工单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定工单'
|
||||
btnName: '绑定工单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成工单',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
@ -209,13 +246,43 @@ export default {
|
||||
this.$auth.hasPermi('base:order-manage:edit')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
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: '删除'
|
||||
btnName: '删除',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'triggerOrigin',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
@ -298,7 +365,7 @@ export default {
|
||||
this.workIssueTitle = '新增工单'
|
||||
this.addWorkOrdervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addWorkOrder.init(val.data.id, 'add')
|
||||
this.$refs.addWorkOrder.init(val.data, 'add')
|
||||
})
|
||||
break
|
||||
case 'bind':
|
||||
@ -308,6 +375,9 @@ export default {
|
||||
this.$refs.addWorkOrder.init(val.data.id, 'bind')
|
||||
})
|
||||
break
|
||||
case 'complete':
|
||||
this.handleComplete(val.data)
|
||||
break
|
||||
default:
|
||||
}
|
||||
},
|
||||
@ -320,6 +390,15 @@ export default {
|
||||
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()
|
||||
|
@ -3,86 +3,94 @@
|
||||
<div class="box1">
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>订单编码: 432784632747238</span>
|
||||
<span>订单编码: {{orderMsg.code}}</span>
|
||||
</div>
|
||||
<div style="padding-left: 14px;">
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">订单名</div>
|
||||
<div class="lightTip">{{orderMsg.name}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">产品信息</div>
|
||||
<div class="lightTip">{{orderMsg.productName}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">产品规格</div>
|
||||
<div class="lightTip">{{orderMsg.specifications}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">客户</div>
|
||||
<div class="lightTip">{{orderMsg.customerName}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">包装规格</div>
|
||||
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">物料计算方式</div>
|
||||
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">创建时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.triggerTime) }}</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">计划开始时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">计划完成时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">计划加工数量</div>
|
||||
<div class="lightTip">{{orderMsg.planQuantity}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">加工平方数(平方米)</div>
|
||||
<div class="lightTip">{{orderMsg.planArea}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">预计用时(时)</div>
|
||||
<div class="lightTip">{{ orderMsg.expectTime }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">状态</div>
|
||||
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">实际开始时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">实际完成时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">实际生产数量</div>
|
||||
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">完成比%</div>
|
||||
<div class="lightTip">{{orderMsg.completeProp}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<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>
|
||||
@ -118,7 +126,8 @@
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { getProcessFlowList } from '@/api/base/orderManage'
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'issueTime',
|
||||
@ -172,7 +181,7 @@ const tableProps1 = [
|
||||
{
|
||||
prop: 'productLineNames',
|
||||
label: '关联产线',
|
||||
filter: (val) => val.join(','),
|
||||
filter: (val) => val ? val.join(',') : '',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
@ -215,7 +224,8 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 500
|
||||
},
|
||||
orderMsg: {}
|
||||
orderMsg: {},
|
||||
processFlowName: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -256,6 +266,17 @@ export default {
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -278,12 +299,14 @@ export default {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user