计划模块(新增逻辑修改初版)

yangwl
wws 1 year ago
parent 50e20c3e0c
commit 80469ad421

@ -1,5 +1,13 @@
import request from '@/utils/request' import request from '@/utils/request'
// 获取物料list
export function selectMaterielList() {
return request({
url: '/plan/product/list',
method: 'get'
})
}
// 通过木订单code获取级联订单信息并封装 // 通过木订单code获取级联订单信息并封装
export function getCascadeProOrder(orderCode) { export function getCascadeProOrder(orderCode) {
return request({ return request({

@ -231,18 +231,77 @@
</el-dialog> </el-dialog>
<!-- 新增模块 --> <!-- 新增模块 -->
<el-dialog title="新增订单" :visible.sync="dialogVisible" width="900px" append-to-body :before-close="handleClose"> <el-dialog title="新增订单" :visible.sync="dialogVisible" width="900px" append-to-body>
<el-dialog
width="800px"
title="物料选择"
:visible.sync="innerVisible"
append-to-body>
<el-form :model="materielQueryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="物料编码" prop="productCode">
<el-input
v-model="materielQueryParams.productCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="productCode">
<el-input
v-model="materielQueryParams.productDescZh"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterielQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- 物料列表展示 -->
<el-table v-loading="loading" :data="materielList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column label="物料编码" align="center" prop="productCode" />
<el-table-column label="物料名称" align="center" prop="productDescZh" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="materielQueryParams.pageNum"
:limit.sync="materielQueryParams.pageSize"
@pagination="getMaterielList"
/>
<el-button @click="subMateriel" class="my-materiel-btn" type="primary">确定</el-button>
</el-dialog>
<el-form ref="form" :model="form" :rules="addrules" label-width="80px"> <el-form ref="form" :model="form" :rules="addrules" label-width="80px">
<!-- 第一行 --> <!-- 第一行 -->
<el-row> <el-row>
<!-- 第一列 --> <!-- 第一列 -->
<el-col :offset="1" :span="8"> <el-col :offset="1" :span="9">
<el-form-item label-width="100px" label="物料号" prop="prodCode"> <el-form-item label-width="100px" label="物料号" prop="prodCode">
<el-input v-model="form.prodCode" placeholder="请输入物料号"/> <el-input @focus="selectMateriel" readonly v-model="form.prodCode" placeholder="点击选择物料"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 第二列 --> <!-- 第二列 -->
<el-col :offset="2" :span="8"> <el-col :offset="1" :span="9">
<el-form-item label-width="100px" label="物料名称" prop="prodDesc">
<el-input @focus="selectMateriel" readonly v-model="form.prodDesc" placeholder="点击选择物料"/>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行 -->
<el-row>
<!-- 第一列 -->
<el-col :offset="1" :span="8">
<el-form-item label-width="100px" label="计划生产日期" prop="planProDate"> <el-form-item label-width="100px" label="计划生产日期" prop="planProDate">
<el-date-picker clearable <el-date-picker clearable
v-model="form.planProDate" v-model="form.planProDate"
@ -253,15 +312,6 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<!-- 第二行 -->
<el-row>
<!-- 第一列 -->
<el-col :offset="1" :span="8">
<el-form-item label-width="100px" label="物料名称" prop="prodDesc">
<el-input v-model="form.prodDesc" placeholder="请输入物料名称"/>
</el-form-item>
</el-col>
<!-- 第二列 --> <!-- 第二列 -->
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label-width="100px" label="计划完成日期" prop="planComplete"> <el-form-item label-width="100px" label="计划完成日期" prop="planComplete">
@ -278,20 +328,21 @@
<!-- 第三行 --> <!-- 第三行 -->
<el-row> <el-row>
<!-- 第一列 --> <!-- 第一列 -->
<el-col :offset="1" :span="8"> <el-col :offset="1" :span="9">
<el-form-item label-width="100px" label="订单数量" prop="quantity"> <el-form-item label-width="100px" label="订单数量" prop="quantity">
<el-input @change="addQuantity" type="number" v-model="form.quantity" placeholder="请输入订单数量"/> <el-input @change="addQuantity" type="number" v-model="form.quantity" placeholder="请输入订单数量"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 第二列 --> <!-- 第二列 -->
<el-col :offset="2" :span="9"> <el-col :offset="1" :span="9">
<el-form-item label-width="100px" label="单位" prop="unit"> <el-form-item label-width="100px" label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位"/> <el-input v-model="form.unit" placeholder="请输入单位"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第四行 -->
<el-row> <el-row>
<el-col :offset="1" :span="8"> <el-col :offset="1" :span="9">
<el-form-item label-width="100px" label="产品类型" prop="prodType"> <el-form-item label-width="100px" label="产品类型" prop="prodType">
<el-select v-model="form.prodType" placeholder="请选择产品类型"> <el-select v-model="form.prodType" placeholder="请选择产品类型">
<el-option <el-option
@ -450,12 +501,13 @@ import {
delOrder, delOrder,
addOrder, addOrder,
updateOrder, updateOrder,
syncSAP syncSAP, selectMaterielList
} from '@/api/plan/order' } from '@/api/plan/order'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import moment from 'moment' import moment from 'moment'
import { getToken } from "@/utils/auth" import { getToken } from "@/utils/auth"
import {listUser} from "@/api/system/user";
export default { export default {
name: 'Order', name: 'Order',
@ -465,6 +517,18 @@ export default {
}, },
data() { data() {
return { return {
materiel: [],
materielList:[],
total: 0,
//
materielQueryParams: {
productCode: undefined,
productDescZh: undefined,
pageNum: 1,
pageSize: 10,
},
// -
innerVisible: false,
// //
upload: { upload: {
// //
@ -578,6 +642,43 @@ export default {
}) })
}, },
methods: { methods: {
//
subMateriel() {
if (this.materiel.length > 1) {
this.$message({
message: '物料只能选择一个!',
type: 'warning'
})
return
}
this.form.prodCode = this.materiel[0].productCode;
this.form.prodDesc = this.materiel[0].productDescZh;
this.innerVisible = false;
console.log(this.materiel)
console.log(12312)
console.log(this.form)
},
//
handleSelectionChange(e) {
console.log("选中了物料信息")
this.materiel = e;
},
//
getMaterielList() {
this.loading = true;
selectMaterielList(this.addDateRange(this.materielQueryParams, this.dateRange)).then(response => {
this.materielList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
//
selectMateriel() {
console.log("点击了选择物料")
this.innerVisible = true;
this.getMaterielList();
},
// //
changeRoute(routeCode) { changeRoute(routeCode) {
getProEquipment(routeCode).then(response => { getProEquipment(routeCode).then(response => {
@ -1097,10 +1198,19 @@ export default {
batchQuantity: '' batchQuantity: ''
}] }]
}, },
//
handleMaterielQuery() {
console.log("进行了查询功能")
this.getMaterielList();
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.getList() this.getList()
}, },
//
resetMaterielQuery() {
console.log("进行了物料重置")
},
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams = { this.queryParams = {
@ -1235,4 +1345,8 @@ export default {
margin-top: 40px; margin-top: 40px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.my-materiel-btn{
margin-top: 20px;
margin-left: 650px;
}
</style> </style>

Loading…
Cancel
Save