|
|
@ -4,18 +4,20 @@
|
|
|
|
<el-form-item label="计划日期" prop="planTime">
|
|
|
|
<el-form-item label="计划日期" prop="planTime">
|
|
|
|
<el-date-picker
|
|
|
|
<el-date-picker
|
|
|
|
v-model="timeList"
|
|
|
|
v-model="timeList"
|
|
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
type="daterange"
|
|
|
|
type="daterange"
|
|
|
|
range-separator="至"
|
|
|
|
range-separator="至"
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
end-placeholder="结束日期">
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
|
|
|
>
|
|
|
|
</el-date-picker>
|
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<!-- <el-form-item label="同步状态">-->
|
|
|
|
<el-form-item label="同步状态">
|
|
|
|
<!-- <el-select v-model="queryParams.syncFlag" placeholder="请选择同步状态">-->
|
|
|
|
<el-select v-model="queryParams.syncFlag" placeholder="请选择同步状态">
|
|
|
|
<!-- <el-option label="已同步" value="1"></el-option>-->
|
|
|
|
<el-option label="已同步" value="1"></el-option>
|
|
|
|
<!-- <el-option label="未同步" value="0"></el-option>-->
|
|
|
|
<el-option label="未同步" value="0"></el-option>
|
|
|
|
<!-- </el-select>-->
|
|
|
|
</el-select>
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
@ -31,7 +33,8 @@
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleAdd"
|
|
|
|
@click="handleAdd"
|
|
|
|
v-hasPermi="['mes:plan:add']"
|
|
|
|
v-hasPermi="['mes:plan:add']"
|
|
|
|
>新增</el-button>
|
|
|
|
>新增
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
|
<!-- <el-button-->
|
|
|
|
<!-- <el-button-->
|
|
|
@ -53,7 +56,8 @@
|
|
|
|
:disabled="multiple"
|
|
|
|
:disabled="multiple"
|
|
|
|
@click="handleDelete"
|
|
|
|
@click="handleDelete"
|
|
|
|
v-hasPermi="['mes:plan:remove']"
|
|
|
|
v-hasPermi="['mes:plan:remove']"
|
|
|
|
>删除</el-button>
|
|
|
|
>删除
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
@ -63,7 +67,8 @@
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleExport"
|
|
|
|
@click="handleExport"
|
|
|
|
v-hasPermi="['mes:plan:export']"
|
|
|
|
v-hasPermi="['mes:plan:export']"
|
|
|
|
>导出</el-button>
|
|
|
|
>导出
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
@ -98,7 +103,8 @@
|
|
|
|
icon="el-icon-edit"
|
|
|
|
icon="el-icon-edit"
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
v-hasPermi="['mes:plan:edit']"
|
|
|
|
v-hasPermi="['mes:plan:edit']"
|
|
|
|
>修改</el-button>
|
|
|
|
>修改
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
<!-- <el-button-->
|
|
|
|
<!-- <el-button-->
|
|
|
|
<!-- size="mini"-->
|
|
|
|
<!-- size="mini"-->
|
|
|
|
<!-- type="text"-->
|
|
|
|
<!-- type="text"-->
|
|
|
@ -129,7 +135,8 @@
|
|
|
|
@change="workOrderTimeChange"
|
|
|
|
@change="workOrderTimeChange"
|
|
|
|
v-model="workOrderTime"
|
|
|
|
v-model="workOrderTime"
|
|
|
|
type="date"
|
|
|
|
type="date"
|
|
|
|
placeholder="工单日期">
|
|
|
|
placeholder="工单日期"
|
|
|
|
|
|
|
|
>
|
|
|
|
</el-date-picker>
|
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
@ -144,12 +151,14 @@
|
|
|
|
tooltip-effect="dark"
|
|
|
|
tooltip-effect="dark"
|
|
|
|
style="width: 100%"
|
|
|
|
style="width: 100%"
|
|
|
|
max-height="240"
|
|
|
|
max-height="240"
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip
|
|
|
|
|
|
|
|
></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="" label="物料"></el-table-column>
|
|
|
|
<el-table-column prop="" label="物料"></el-table-column>
|
|
|
@ -162,7 +171,8 @@
|
|
|
|
<el-form-item size="small" label="选择料罐:">
|
|
|
|
<el-form-item size="small" label="选择料罐:">
|
|
|
|
<el-select v-model="form.bucketId" placeholder="请选择料罐">
|
|
|
|
<el-select v-model="form.bucketId" placeholder="请选择料罐">
|
|
|
|
<el-option v-for="item in selectBucketList" :key="item.bucketId" :label="item.bucketName"
|
|
|
|
<el-option v-for="item in selectBucketList" :key="item.bucketId" :label="item.bucketName"
|
|
|
|
:value="item.bucketId"></el-option>
|
|
|
|
:value="item.bucketId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
@ -171,14 +181,16 @@
|
|
|
|
<el-form-item size="small" label="选择物料:">
|
|
|
|
<el-form-item size="small" label="选择物料:">
|
|
|
|
<el-select v-model="form.productId" placeholder="请选择物料">
|
|
|
|
<el-select v-model="form.productId" placeholder="请选择物料">
|
|
|
|
<el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"
|
|
|
|
<el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"
|
|
|
|
:value="item.productId"></el-option>
|
|
|
|
:value="item.productId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<!-- 选择日期 -->
|
|
|
|
<!-- 选择日期 -->
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item size="small" label="计划日期: ">
|
|
|
|
<el-form-item size="small" label="计划日期: ">
|
|
|
|
<el-date-picker @change="checkDate" v-model="form.planTime" type="date" placeholder="选择日期"></el-date-picker>
|
|
|
|
<el-date-picker @change="checkDate" v-model="form.planTime" type="date" placeholder="选择日期"
|
|
|
|
|
|
|
|
></el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
@ -198,12 +210,14 @@
|
|
|
|
tooltip-effect="dark"
|
|
|
|
tooltip-effect="dark"
|
|
|
|
style="width: 100%"
|
|
|
|
style="width: 100%"
|
|
|
|
max-height="240"
|
|
|
|
max-height="240"
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip
|
|
|
|
|
|
|
|
></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料"></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料"></el-table-column>
|
|
|
@ -242,12 +256,14 @@
|
|
|
|
tooltip-effect="dark"
|
|
|
|
tooltip-effect="dark"
|
|
|
|
style="width: 100%"
|
|
|
|
style="width: 100%"
|
|
|
|
max-height="240"
|
|
|
|
max-height="240"
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip
|
|
|
|
|
|
|
|
></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料"></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料"></el-table-column>
|
|
|
@ -260,7 +276,8 @@
|
|
|
|
<el-form-item size="small" label="选择料罐:">
|
|
|
|
<el-form-item size="small" label="选择料罐:">
|
|
|
|
<el-select v-model="form.bucketId" placeholder="请选择料罐">
|
|
|
|
<el-select v-model="form.bucketId" placeholder="请选择料罐">
|
|
|
|
<el-option v-for="item in selectBucketList" :key="item.bucketId" :label="item.bucketName"
|
|
|
|
<el-option v-for="item in selectBucketList" :key="item.bucketId" :label="item.bucketName"
|
|
|
|
:value="item.bucketId"></el-option>
|
|
|
|
:value="item.bucketId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
@ -269,14 +286,16 @@
|
|
|
|
<el-form-item size="small" label="选择物料:">
|
|
|
|
<el-form-item size="small" label="选择物料:">
|
|
|
|
<el-select v-model="form.productId" placeholder="请选择物料">
|
|
|
|
<el-select v-model="form.productId" placeholder="请选择物料">
|
|
|
|
<el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"
|
|
|
|
<el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"
|
|
|
|
:value="item.productId"></el-option>
|
|
|
|
:value="item.productId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<!-- 选择日期 -->
|
|
|
|
<!-- 选择日期 -->
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item size="small" label="计划日期: ">
|
|
|
|
<el-form-item size="small" label="计划日期: ">
|
|
|
|
<el-date-picker readonly @change="checkDate" v-model="form.planTime" type="date" placeholder="选择日期"></el-date-picker>
|
|
|
|
<el-date-picker readonly @change="checkDate" v-model="form.planTime" type="date" placeholder="选择日期"
|
|
|
|
|
|
|
|
></el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
@ -296,12 +315,14 @@
|
|
|
|
tooltip-effect="dark"
|
|
|
|
tooltip-effect="dark"
|
|
|
|
style="width: 100%"
|
|
|
|
style="width: 100%"
|
|
|
|
max-height="240"
|
|
|
|
max-height="240"
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip
|
|
|
|
|
|
|
|
></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料"></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料"></el-table-column>
|
|
|
@ -318,10 +339,24 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { updatePlanDetail,getPlanDetailList,addWetPlan,getBMSList,getProductList,getBucketList,getWorkOrderList,listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/plan/plan";
|
|
|
|
import {
|
|
|
|
|
|
|
|
updatePlanDetail,
|
|
|
|
|
|
|
|
getPlanDetailList,
|
|
|
|
|
|
|
|
addWetPlan,
|
|
|
|
|
|
|
|
getBMSList,
|
|
|
|
|
|
|
|
getProductList,
|
|
|
|
|
|
|
|
getBucketList,
|
|
|
|
|
|
|
|
getWorkOrderList,
|
|
|
|
|
|
|
|
listPlan,
|
|
|
|
|
|
|
|
getPlan,
|
|
|
|
|
|
|
|
delPlan,
|
|
|
|
|
|
|
|
addPlan,
|
|
|
|
|
|
|
|
updatePlan
|
|
|
|
|
|
|
|
} from '@/api/plan/plan'
|
|
|
|
|
|
|
|
import moment from 'moment'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "Plan",
|
|
|
|
name: 'Plan',
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
// 湿料计划详情list
|
|
|
|
// 湿料计划详情list
|
|
|
@ -349,7 +384,7 @@ export default {
|
|
|
|
// 新增-查询-工单日期
|
|
|
|
// 新增-查询-工单日期
|
|
|
|
workOrderTime: null,
|
|
|
|
workOrderTime: null,
|
|
|
|
// 首日期查询
|
|
|
|
// 首日期查询
|
|
|
|
timeList: null,
|
|
|
|
timeList: [],
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
|
loading: true,
|
|
|
|
loading: true,
|
|
|
|
// 选中数组
|
|
|
|
// 选中数组
|
|
|
@ -365,7 +400,7 @@ export default {
|
|
|
|
// 湿料计划管理表格数据
|
|
|
|
// 湿料计划管理表格数据
|
|
|
|
planList: [],
|
|
|
|
planList: [],
|
|
|
|
// 弹出层标题
|
|
|
|
// 弹出层标题
|
|
|
|
title: "",
|
|
|
|
title: '',
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
// 查询参数
|
|
|
|
// 查询参数
|
|
|
@ -375,21 +410,23 @@ export default {
|
|
|
|
planTime: null,
|
|
|
|
planTime: null,
|
|
|
|
syncFlag: null,
|
|
|
|
syncFlag: null,
|
|
|
|
startTime: null,
|
|
|
|
startTime: null,
|
|
|
|
endTime: null,
|
|
|
|
endTime: null
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单参数
|
|
|
|
// 表单参数
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
bucketId: null,
|
|
|
|
bucketId: null,
|
|
|
|
productId: null,
|
|
|
|
productId: null,
|
|
|
|
planTime: null,
|
|
|
|
planTime: null
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单校验
|
|
|
|
// 表单校验
|
|
|
|
rules: {
|
|
|
|
rules: {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getList();
|
|
|
|
this.timeList = [new Date(),new Date()]
|
|
|
|
|
|
|
|
this.queryParams.startTime = moment(this.timeList[0]).format('YYYY-MM-DD')
|
|
|
|
|
|
|
|
this.queryParams.endTime = moment(this.timeList[1]).format('YYYY-MM-DD')
|
|
|
|
|
|
|
|
this.getList()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
/** 修改-确定按钮 */
|
|
|
|
/** 修改-确定按钮 */
|
|
|
@ -400,14 +437,14 @@ export default {
|
|
|
|
message: '请选择工单!',
|
|
|
|
message: '请选择工单!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.form.bucketId == null || this.form.productId == null) {
|
|
|
|
if (this.form.bucketId == null || this.form.productId == null) {
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
message: '数据不能为空!',
|
|
|
|
message: '数据不能为空!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 数据校验班次冲突问题
|
|
|
|
// 数据校验班次冲突问题
|
|
|
|
if (this.checkSelect === false) {
|
|
|
|
if (this.checkSelect === false) {
|
|
|
@ -415,15 +452,15 @@ export default {
|
|
|
|
message: '班次冲突请重新选择!',
|
|
|
|
message: '班次冲突请重新选择!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 校验数据班次、物料、料罐
|
|
|
|
// 校验数据班次、物料、料罐
|
|
|
|
var bms = {
|
|
|
|
var bms = {
|
|
|
|
bucketId: this.form.bucketId,
|
|
|
|
bucketId: this.form.bucketId,
|
|
|
|
materialId: this.form.productId,
|
|
|
|
materialId: this.form.productId,
|
|
|
|
shiftId: this.selectList[0].shiftId,
|
|
|
|
shiftId: this.selectList[0].shiftId
|
|
|
|
};
|
|
|
|
}
|
|
|
|
if (this.bmsList != null || this.bmsList === undefined) {
|
|
|
|
if (this.bmsList != null || this.bmsList === undefined) {
|
|
|
|
for (let i = 0; i < this.bmsList.length; i++) {
|
|
|
|
for (let i = 0; i < this.bmsList.length; i++) {
|
|
|
|
if (bms.shiftId == this.bmsList[i].shiftId && bms.bucketId == this.bmsList[i].bucketId && bms.materialId != this.bmsList[i].materialId) {
|
|
|
|
if (bms.shiftId == this.bmsList[i].shiftId && bms.bucketId == this.bmsList[i].bucketId && bms.materialId != this.bmsList[i].materialId) {
|
|
|
@ -431,46 +468,46 @@ export default {
|
|
|
|
message: '同班次同料罐下不能混料!',
|
|
|
|
message: '同班次同料罐下不能混料!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.bmsList.push(bms);
|
|
|
|
this.bmsList.push(bms)
|
|
|
|
// 数据保存(仅前端)
|
|
|
|
// 数据保存(仅前端)
|
|
|
|
// 创建料罐对象
|
|
|
|
// 创建料罐对象
|
|
|
|
var bucket;
|
|
|
|
var bucket
|
|
|
|
for (let i = 0; i < this.selectBucketList.length; i++) {
|
|
|
|
for (let i = 0; i < this.selectBucketList.length; i++) {
|
|
|
|
if (this.form.bucketId == this.selectBucketList[i].bucketId) {
|
|
|
|
if (this.form.bucketId == this.selectBucketList[i].bucketId) {
|
|
|
|
bucket = this.selectBucketList[i];
|
|
|
|
bucket = this.selectBucketList[i]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 创建物料对象
|
|
|
|
// 创建物料对象
|
|
|
|
var material;
|
|
|
|
var material
|
|
|
|
for (let i = 0; i < this.selectProductList.length; i++) {
|
|
|
|
for (let i = 0; i < this.selectProductList.length; i++) {
|
|
|
|
if (this.form.productId == this.selectProductList[i].productId) {
|
|
|
|
if (this.form.productId == this.selectProductList[i].productId) {
|
|
|
|
material = this.selectProductList[i];
|
|
|
|
material = this.selectProductList[i]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 将选择的信息放入newList
|
|
|
|
// 将选择的信息放入newList
|
|
|
|
for (let i = 0; i < this.selectList.length; i++) {
|
|
|
|
for (let i = 0; i < this.selectList.length; i++) {
|
|
|
|
this.selectList[i].bucketName = bucket.bucketName;
|
|
|
|
this.selectList[i].bucketName = bucket.bucketName
|
|
|
|
this.selectList[i].bucketId = bucket.bucketId;
|
|
|
|
this.selectList[i].bucketId = bucket.bucketId
|
|
|
|
this.selectList[i].bucketCode = bucket.bucketCode;
|
|
|
|
this.selectList[i].bucketCode = bucket.bucketCode
|
|
|
|
this.selectList[i].materialId = material.productId;
|
|
|
|
this.selectList[i].materialId = material.productId
|
|
|
|
this.selectList[i].materialCode = material.productCode;
|
|
|
|
this.selectList[i].materialCode = material.productCode
|
|
|
|
this.selectList[i].materialName = material.productDesc;
|
|
|
|
this.selectList[i].materialName = material.productDesc
|
|
|
|
this.selectList[i].planTime = this.form.planTime;
|
|
|
|
this.selectList[i].planTime = this.form.planTime
|
|
|
|
this.newWorkOrderList.push(this.selectList[i]);
|
|
|
|
this.newWorkOrderList.push(this.selectList[i])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 将选择的数据在上方的列表中删除
|
|
|
|
// 将选择的数据在上方的列表中删除
|
|
|
|
const selectedCodes = this.selectList.map(item => item.workorderCode);
|
|
|
|
const selectedCodes = this.selectList.map(item => item.workorderCode)
|
|
|
|
this.wetMaterialPlanList = this.wetMaterialPlanList.filter(item => !selectedCodes.includes(item.workorderCode));
|
|
|
|
this.wetMaterialPlanList = this.wetMaterialPlanList.filter(item => !selectedCodes.includes(item.workorderCode))
|
|
|
|
|
|
|
|
|
|
|
|
// 重置数据
|
|
|
|
// 重置数据
|
|
|
|
this.form.bucketId = null;
|
|
|
|
this.form.bucketId = null
|
|
|
|
this.form.productId = null;
|
|
|
|
this.form.productId = null
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 新增-确定按钮 */
|
|
|
|
/** 新增-确定按钮 */
|
|
|
|
batchBtn() {
|
|
|
|
batchBtn() {
|
|
|
@ -480,14 +517,14 @@ export default {
|
|
|
|
message: '请选择工单!',
|
|
|
|
message: '请选择工单!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.form.bucketId == null || this.form.productId == null) {
|
|
|
|
if (this.form.bucketId == null || this.form.productId == null) {
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
message: '数据不能为空!',
|
|
|
|
message: '数据不能为空!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 数据校验班次冲突问题
|
|
|
|
// 数据校验班次冲突问题
|
|
|
|
if (this.checkSelect === false) {
|
|
|
|
if (this.checkSelect === false) {
|
|
|
@ -495,15 +532,15 @@ export default {
|
|
|
|
message: '班次冲突请重新选择!',
|
|
|
|
message: '班次冲突请重新选择!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 校验数据班次、物料、料罐
|
|
|
|
// 校验数据班次、物料、料罐
|
|
|
|
var bms = {
|
|
|
|
var bms = {
|
|
|
|
bucketId: this.form.bucketId,
|
|
|
|
bucketId: this.form.bucketId,
|
|
|
|
materialId: this.form.productId,
|
|
|
|
materialId: this.form.productId,
|
|
|
|
shiftId: this.selectList[0].shiftId,
|
|
|
|
shiftId: this.selectList[0].shiftId
|
|
|
|
};
|
|
|
|
}
|
|
|
|
if (this.bmsList != null || this.bmsList === undefined) {
|
|
|
|
if (this.bmsList != null || this.bmsList === undefined) {
|
|
|
|
for (let i = 0; i < this.bmsList.length; i++) {
|
|
|
|
for (let i = 0; i < this.bmsList.length; i++) {
|
|
|
|
if (bms.shiftId == this.bmsList[i].shiftId && bms.bucketId == this.bmsList[i].bucketId && bms.materialId != this.bmsList[i].materialId) {
|
|
|
|
if (bms.shiftId == this.bmsList[i].shiftId && bms.bucketId == this.bmsList[i].bucketId && bms.materialId != this.bmsList[i].materialId) {
|
|
|
@ -511,120 +548,112 @@ export default {
|
|
|
|
message: '同班次同料罐下不能混料!',
|
|
|
|
message: '同班次同料罐下不能混料!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.bmsList.push(bms);
|
|
|
|
this.bmsList.push(bms)
|
|
|
|
// 数据保存(仅前端)
|
|
|
|
// 数据保存(仅前端)
|
|
|
|
// 创建料罐对象
|
|
|
|
// 创建料罐对象
|
|
|
|
var bucket;
|
|
|
|
var bucket
|
|
|
|
for (let i = 0; i < this.selectBucketList.length; i++) {
|
|
|
|
for (let i = 0; i < this.selectBucketList.length; i++) {
|
|
|
|
if (this.form.bucketId == this.selectBucketList[i].bucketId) {
|
|
|
|
if (this.form.bucketId == this.selectBucketList[i].bucketId) {
|
|
|
|
bucket = this.selectBucketList[i];
|
|
|
|
bucket = this.selectBucketList[i]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 创建物料对象
|
|
|
|
// 创建物料对象
|
|
|
|
var material;
|
|
|
|
var material
|
|
|
|
for (let i = 0; i < this.selectProductList.length; i++) {
|
|
|
|
for (let i = 0; i < this.selectProductList.length; i++) {
|
|
|
|
if (this.form.productId == this.selectProductList[i].productId) {
|
|
|
|
if (this.form.productId == this.selectProductList[i].productId) {
|
|
|
|
material = this.selectProductList[i];
|
|
|
|
material = this.selectProductList[i]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 将选择的信息放入newList
|
|
|
|
// 将选择的信息放入newList
|
|
|
|
for (let i = 0; i < this.selectList.length; i++) {
|
|
|
|
for (let i = 0; i < this.selectList.length; i++) {
|
|
|
|
this.selectList[i].bucketName = bucket.bucketName;
|
|
|
|
this.selectList[i].bucketName = bucket.bucketName
|
|
|
|
this.selectList[i].bucketId = bucket.bucketId;
|
|
|
|
this.selectList[i].bucketId = bucket.bucketId
|
|
|
|
this.selectList[i].bucketCode = bucket.bucketCode;
|
|
|
|
this.selectList[i].bucketCode = bucket.bucketCode
|
|
|
|
this.selectList[i].materialId = material.productId;
|
|
|
|
this.selectList[i].materialId = material.productId
|
|
|
|
this.selectList[i].materialCode = material.productCode;
|
|
|
|
this.selectList[i].materialCode = material.productCode
|
|
|
|
this.selectList[i].materialName = material.productDesc;
|
|
|
|
this.selectList[i].materialName = material.productDesc
|
|
|
|
this.selectList[i].planTime = this.form.planTime;
|
|
|
|
this.selectList[i].planTime = this.form.planTime
|
|
|
|
this.newWorkOrderList.push(this.selectList[i]);
|
|
|
|
this.newWorkOrderList.push(this.selectList[i])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 将选择的数据在上方的列表中删除
|
|
|
|
// 将选择的数据在上方的列表中删除
|
|
|
|
const selectedCodes = this.selectList.map(item => item.workorderCode);
|
|
|
|
const selectedCodes = this.selectList.map(item => item.workorderCode)
|
|
|
|
this.workOrderList = this.workOrderList.filter(item => !selectedCodes.includes(item.workorderCode));
|
|
|
|
this.workOrderList = this.workOrderList.filter(item => !selectedCodes.includes(item.workorderCode))
|
|
|
|
|
|
|
|
|
|
|
|
// 重置数据
|
|
|
|
// 重置数据
|
|
|
|
this.form.bucketId = null;
|
|
|
|
this.form.bucketId = null
|
|
|
|
this.form.productId = null;
|
|
|
|
this.form.productId = null
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 校验计划日期 */
|
|
|
|
/** 校验计划日期 */
|
|
|
|
checkDate(e){
|
|
|
|
checkDate: function(e) {
|
|
|
|
if (this.newWorkOrderList.length > 0) {
|
|
|
|
if (this.newWorkOrderList.length > 0) {
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
message: '您已生成数据不能更改日期!',
|
|
|
|
message: '您已生成数据不能更改日期!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var now = new Date();
|
|
|
|
var now = new Date()
|
|
|
|
if (e < now) {
|
|
|
|
if (e < now) {
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
message: '日期不得早于今天',
|
|
|
|
message: '日期不得早于今天',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
e = now;
|
|
|
|
e = now
|
|
|
|
this.form.planTime = now;
|
|
|
|
this.form.planTime = now
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 获取计划日期下已分配的班次、料罐、物料信息list
|
|
|
|
// 获取计划日期下已分配的班次、料罐、物料信息list
|
|
|
|
const year = this.form.planTime.getFullYear(); // 获取年份
|
|
|
|
var planTime = moment(this.form.planTime).format('YYYY-MM-DD')
|
|
|
|
const month = String(this.form.planTime.getMonth() + 1).padStart(2, '0'); // 获取月份
|
|
|
|
|
|
|
|
const day = String(this.form.planTime.getDate()).padStart(2, '0'); // 获取日期
|
|
|
|
|
|
|
|
const planTime = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
getBMSList(planTime).then(response => {
|
|
|
|
getBMSList(planTime).then(response => {
|
|
|
|
console.log("w这里是改变日期")
|
|
|
|
|
|
|
|
console.log(response.data)
|
|
|
|
|
|
|
|
if (response.data !== undefined) {
|
|
|
|
if (response.data !== undefined) {
|
|
|
|
this.bmsList = response.data;
|
|
|
|
this.bmsList = response.data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 新增-选择工单日期 */
|
|
|
|
/** 新增-选择工单日期 */
|
|
|
|
workOrderTimeChange(e) {
|
|
|
|
workOrderTimeChange(e) {
|
|
|
|
// 校验日期并进行计划日期同步
|
|
|
|
// 校验日期并进行计划日期同步
|
|
|
|
var now = new Date();
|
|
|
|
var now = new Date()
|
|
|
|
if (e < now) {
|
|
|
|
if (e < now) {
|
|
|
|
this.form.planTime = now;
|
|
|
|
this.form.planTime = now
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.form.planTime = e;
|
|
|
|
this.form.planTime = e
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 转换日期格式
|
|
|
|
// 转换日期格式
|
|
|
|
const year = e.getFullYear(); // 获取年份
|
|
|
|
var productDate = moment(e).format('YYYY-MM-DD')
|
|
|
|
const month = String(e.getMonth() + 1).padStart(2, '0'); // 获取月份
|
|
|
|
|
|
|
|
const day = String(e.getDate()).padStart(2, '0'); // 获取日期
|
|
|
|
|
|
|
|
const productDate = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getWorkOrderList(productDate).then(response => {
|
|
|
|
getWorkOrderList(productDate).then(response => {
|
|
|
|
this.workOrderList = response.data;
|
|
|
|
this.workOrderList = response.data
|
|
|
|
// 刷新表格
|
|
|
|
// 刷新表格
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
this.workLoading = true; // 设置加载状态为true,表示正在加载
|
|
|
|
this.workLoading = true // 设置加载状态为true,表示正在加载
|
|
|
|
this.refreshWorkTable = false; // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
this.refreshWorkTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
this.refreshWorkTable = true; // 立即将refreshProTable设置为true,显示表格
|
|
|
|
this.refreshWorkTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
this.workLoading = false; // 设置加载状态为false,表示加载完成
|
|
|
|
this.workLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 查询湿料计划管理列表 */
|
|
|
|
/** 查询湿料计划管理列表 */
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true
|
|
|
|
listPlan(this.queryParams).then(response => {
|
|
|
|
listPlan(this.queryParams).then(response => {
|
|
|
|
this.planList = response.rows;
|
|
|
|
this.planList = response.rows
|
|
|
|
this.total = response.total;
|
|
|
|
this.total = response.total
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
|
this.open = false;
|
|
|
|
this.open = false
|
|
|
|
this.reset();
|
|
|
|
this.reset()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单重置
|
|
|
|
// 表单重置
|
|
|
|
reset() {
|
|
|
|
reset() {
|
|
|
@ -649,142 +678,133 @@ export default {
|
|
|
|
status: null,
|
|
|
|
status: null,
|
|
|
|
prodType: null,
|
|
|
|
prodType: null,
|
|
|
|
planCode: null
|
|
|
|
planCode: null
|
|
|
|
};
|
|
|
|
}
|
|
|
|
this.resetForm("form");
|
|
|
|
this.resetForm('form')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 首-搜索按钮操作 */
|
|
|
|
/** 首-搜索按钮操作 */
|
|
|
|
handleQuery() {
|
|
|
|
handleQuery() {
|
|
|
|
if (this.timeList.length-1>1){
|
|
|
|
if (this.timeList.length > 0) {
|
|
|
|
// 赋值
|
|
|
|
this.queryParams.startTime = moment(this.timeList[0]).format('YYYY-MM-DD')
|
|
|
|
const year = this.timeList[0].getFullYear(); // 获取年份
|
|
|
|
this.queryParams.endTime = moment(this.timeList[1]).format('YYYY-MM-DD')
|
|
|
|
const month = String(this.timeList[0].getMonth() + 1).padStart(2, '0'); // 获取月份
|
|
|
|
|
|
|
|
const day = String(this.timeList[0].getDate()).padStart(2, '0'); // 获取日期
|
|
|
|
|
|
|
|
const startTime = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.queryParams.startTime = startTime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const year1 = this.timeList[1].getFullYear(); // 获取年份
|
|
|
|
|
|
|
|
const month1 = String(this.timeList[1].getMonth() + 1).padStart(2, '0'); // 获取月份
|
|
|
|
|
|
|
|
const day1 = String(this.timeList[1].getDate()).padStart(2, '0'); // 获取日期
|
|
|
|
|
|
|
|
const endTime = `${year1}-${month1}-${day1}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.queryParams.endTime = endTime;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
this.queryParams.startTime = null;
|
|
|
|
|
|
|
|
this.queryParams.endTime = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
this.getList()
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 首-重置按钮操作 */
|
|
|
|
/** 首-重置按钮操作 */
|
|
|
|
resetQuery() {
|
|
|
|
resetQuery() {
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
this.resetForm('queryForm')
|
|
|
|
this.timeList = [];
|
|
|
|
this.timeList = []
|
|
|
|
this.handleQuery();
|
|
|
|
this.queryParams.syncFlag = null
|
|
|
|
|
|
|
|
this.handleQuery()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 多选框选中数据
|
|
|
|
// 多选框选中数据
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
// 初始化
|
|
|
|
// 初始化
|
|
|
|
this.checkSelect = true;
|
|
|
|
this.checkSelect = true
|
|
|
|
// 如果选择中班次冲突
|
|
|
|
// 如果选择中班次冲突
|
|
|
|
for (let i = 0; i < selection.length; i++) {
|
|
|
|
for (let i = 0; i < selection.length; i++) {
|
|
|
|
if (selection[0].shiftId != selection[i].shiftId) {
|
|
|
|
if (selection[0].shiftId != selection[i].shiftId) {
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
message: '班次冲突!',
|
|
|
|
message: '班次冲突!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
});
|
|
|
|
})
|
|
|
|
this.checkSelect = false;
|
|
|
|
this.checkSelect = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
this.multiple = !selection.length
|
|
|
|
this.multiple = !selection.length
|
|
|
|
// 将选择的信息放入selectList
|
|
|
|
// 将选择的信息放入selectList
|
|
|
|
this.selectList = selection;
|
|
|
|
this.selectList = selection
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
handleAdd() {
|
|
|
|
handleAdd() {
|
|
|
|
// 刷新缓存
|
|
|
|
// 刷新缓存
|
|
|
|
this.reset();
|
|
|
|
this.reset()
|
|
|
|
this.selectBucketList = null;
|
|
|
|
this.selectBucketList = null
|
|
|
|
this.workOrderTime = null;
|
|
|
|
this.workOrderTime = null
|
|
|
|
this.workOrderList = [];
|
|
|
|
this.workOrderList = []
|
|
|
|
this.selectProductList = null;
|
|
|
|
this.selectProductList = null
|
|
|
|
this.newWorkOrderList = [];
|
|
|
|
this.newWorkOrderList = []
|
|
|
|
this.bmapId = null;
|
|
|
|
this.bmapId = null
|
|
|
|
// 数据初始化
|
|
|
|
// 数据初始化
|
|
|
|
this.workOrderTime = new Date();
|
|
|
|
this.workOrderTime = new Date()
|
|
|
|
this.form.planTime = new Date();
|
|
|
|
this.form.planTime = new Date()
|
|
|
|
// 获取当前日期下的未被分配的工单list
|
|
|
|
// 获取当前日期下的未被分配的工单list
|
|
|
|
// 转换日期格式
|
|
|
|
var productDate = moment(this.workOrderTime).format('YYYY-MM-DD')
|
|
|
|
const year = this.workOrderTime.getFullYear(); // 获取年份
|
|
|
|
|
|
|
|
const month = String(this.workOrderTime.getMonth() + 1).padStart(2, '0'); // 获取月份
|
|
|
|
|
|
|
|
const day = String(this.workOrderTime.getDate()).padStart(2, '0'); // 获取日期
|
|
|
|
|
|
|
|
const productDate = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
|
|
|
|
this.workLoading = true // 设置加载状态为true,表示正在加载
|
|
|
|
getWorkOrderList(productDate).then(response => {
|
|
|
|
getWorkOrderList(productDate).then(response => {
|
|
|
|
this.workOrderList = response.data;
|
|
|
|
this.workOrderList = response.data
|
|
|
|
// 刷新表格
|
|
|
|
// 刷新表格
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
|
|
|
|
this.workLoading = true; // 设置加载状态为true,表示正在加载
|
|
|
|
this.refreshWorkTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
this.refreshWorkTable = false; // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
this.refreshWorkTable = true; // 立即将refreshProTable设置为true,显示表格
|
|
|
|
this.refreshWorkTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
this.workLoading = false; // 设置加载状态为false,表示加载完成
|
|
|
|
this.workLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 获取今天已分配的班次、料罐、物料信息list
|
|
|
|
// 获取今天已分配的班次、料罐、物料信息list
|
|
|
|
getBMSList(productDate).then(response => {
|
|
|
|
getBMSList(productDate).then(response => {
|
|
|
|
if (response.data !== undefined) {
|
|
|
|
if (response.data !== undefined) {
|
|
|
|
this.bmsList = response.data;
|
|
|
|
this.bmsList = response.data
|
|
|
|
console.log("这里是bms开始")
|
|
|
|
console.log('这里是bms开始')
|
|
|
|
console.log(this.bmsList)
|
|
|
|
console.log(this.bmsList)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 一会完成下方数据同步
|
|
|
|
// 一会完成下方数据同步
|
|
|
|
// 获取料罐list
|
|
|
|
// 获取料罐list
|
|
|
|
getBucketList().then(response => {
|
|
|
|
getBucketList().then(response => {
|
|
|
|
this.selectBucketList = response.data;
|
|
|
|
this.selectBucketList = response.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 获取物料信息list
|
|
|
|
// 获取物料信息list
|
|
|
|
getProductList().then(response => {
|
|
|
|
getProductList().then(response => {
|
|
|
|
this.selectProductList = response.data;
|
|
|
|
this.selectProductList = response.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.open = true;
|
|
|
|
this.open = true
|
|
|
|
this.title = "新增湿料计划";
|
|
|
|
this.title = '新增湿料计划'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
handleUpdate(row) {
|
|
|
|
handleUpdate(row) {
|
|
|
|
console.log("这里是修改操作区域")
|
|
|
|
console.log('这里是修改操作区域')
|
|
|
|
console.log(row)
|
|
|
|
console.log(row)
|
|
|
|
// 清除缓存
|
|
|
|
// 清除缓存
|
|
|
|
this.reset();
|
|
|
|
this.reset()
|
|
|
|
this.selectBucketList = null;
|
|
|
|
this.selectBucketList = null
|
|
|
|
this.workOrderTime = null;
|
|
|
|
this.workOrderTime = null
|
|
|
|
this.workOrderList = [];
|
|
|
|
this.workOrderList = []
|
|
|
|
this.selectProductList = null;
|
|
|
|
this.selectProductList = null
|
|
|
|
this.newWorkOrderList = [];
|
|
|
|
this.newWorkOrderList = []
|
|
|
|
this.bmapId = null;
|
|
|
|
this.bmapId = null
|
|
|
|
// 初始化数据
|
|
|
|
// 初始化数据
|
|
|
|
this.form.planTime = new Date();
|
|
|
|
this.form.planTime = new Date()
|
|
|
|
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
|
|
|
|
this.workLoading = true // 设置加载状态为true,表示正在加载
|
|
|
|
// 获取订单详情list
|
|
|
|
// 获取订单详情list
|
|
|
|
getPlanDetailList(row.id).then(response => {
|
|
|
|
getPlanDetailList(row.id).then(response => {
|
|
|
|
if (response.data !== undefined) {
|
|
|
|
if (response.data !== undefined) {
|
|
|
|
this.wetMaterialPlanList = response.data;
|
|
|
|
this.wetMaterialPlanList = response.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.refreshWorkTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
|
|
|
this.refreshWorkTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
|
|
|
this.workLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 获取料罐list
|
|
|
|
// 获取料罐list
|
|
|
|
getBucketList().then(response => {
|
|
|
|
getBucketList().then(response => {
|
|
|
|
this.selectBucketList = response.data;
|
|
|
|
this.selectBucketList = response.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 获取物料信息list
|
|
|
|
// 获取物料信息list
|
|
|
|
getProductList().then(response => {
|
|
|
|
getProductList().then(response => {
|
|
|
|
this.selectProductList = response.data;
|
|
|
|
this.selectProductList = response.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
this.dialogVisible = true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 修改-提交按钮 */
|
|
|
|
/** 修改-提交按钮 */
|
|
|
|
updateForm() {
|
|
|
|
updateForm() {
|
|
|
@ -794,7 +814,7 @@ export default {
|
|
|
|
message: '提交数据不能为空!',
|
|
|
|
message: '提交数据不能为空!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
updatePlanDetail(this.newWorkOrderList).then(response => {
|
|
|
|
updatePlanDetail(this.newWorkOrderList).then(response => {
|
|
|
@ -806,8 +826,8 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
this.dialogVisible = false
|
|
|
|
this.getList();
|
|
|
|
this.getList()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 新增-提交按钮 */
|
|
|
|
/** 新增-提交按钮 */
|
|
|
|
addSubmitForm() {
|
|
|
|
addSubmitForm() {
|
|
|
@ -817,10 +837,10 @@ export default {
|
|
|
|
message: '提交数据不能为空!',
|
|
|
|
message: '提交数据不能为空!',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log("这里是工单list")
|
|
|
|
console.log('这里是工单list')
|
|
|
|
console.log(this.newWorkOrderList)
|
|
|
|
console.log(this.newWorkOrderList)
|
|
|
|
addWetPlan(this.newWorkOrderList).then(response => {
|
|
|
|
addWetPlan(this.newWorkOrderList).then(response => {
|
|
|
|
if (response.code === 200) {
|
|
|
|
if (response.code === 200) {
|
|
|
@ -830,18 +850,19 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.open = false;
|
|
|
|
this.open = false
|
|
|
|
this.getList();
|
|
|
|
this.getList()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
handleDelete(row) {
|
|
|
|
handleDelete(row) {
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
const ids = row.id || this.ids
|
|
|
|
this.$modal.confirm('是否确认删除湿料计划管理编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
this.$modal.confirm('是否确认删除湿料计划管理编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
return delPlan(ids);
|
|
|
|
return delPlan(ids)
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
this.getList();
|
|
|
|
this.getList()
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
this.$modal.msgSuccess('删除成功')
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
handleExport() {
|
|
|
|
handleExport() {
|
|
|
@ -850,31 +871,38 @@ export default {
|
|
|
|
}, `plan_${new Date().getTime()}.xlsx`)
|
|
|
|
}, `plan_${new Date().getTime()}.xlsx`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
.el-row {
|
|
|
|
.el-row {
|
|
|
|
margin-bottom: 20px;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
&:last-child {
|
|
|
|
margin-bottom: 0;
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-col {
|
|
|
|
.el-col {
|
|
|
|
border-radius: 4px;
|
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bg-purple-dark {
|
|
|
|
.bg-purple-dark {
|
|
|
|
background: #99a9bf;
|
|
|
|
background: #99a9bf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bg-purple {
|
|
|
|
.bg-purple {
|
|
|
|
background: #d3dce6;
|
|
|
|
background: #d3dce6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bg-purple-light {
|
|
|
|
.bg-purple-light {
|
|
|
|
background: #e5e9f2;
|
|
|
|
background: #e5e9f2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.grid-content {
|
|
|
|
.grid-content {
|
|
|
|
border-radius: 4px;
|
|
|
|
border-radius: 4px;
|
|
|
|
min-height: 36px;
|
|
|
|
min-height: 36px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.row-bg {
|
|
|
|
.row-bg {
|
|
|
|
padding: 10px 0;
|
|
|
|
padding: 10px 0;
|
|
|
|
background-color: #f9fafc;
|
|
|
|
background-color: #f9fafc;
|
|
|
|