|
@@ -1,499 +1,516 @@
|
|
|
<template>
|
|
|
<div class="mainContentBox">
|
|
|
<avue-crud
|
|
|
- :option="option"
|
|
|
- v-model:page="page"
|
|
|
- v-model:search="search"
|
|
|
- :table-loading="loading"
|
|
|
- :permission="permission"
|
|
|
- @search-change="handleQuery"
|
|
|
- @search-reset="resetQuery"
|
|
|
- @size-change="handleQuery"
|
|
|
- @current-change="handleQuery"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @row-del="rowDel"
|
|
|
- :data="pageData"
|
|
|
+ ref="crudRef"
|
|
|
+ v-model:search="search"
|
|
|
+ v-model="form"
|
|
|
+ :data="data"
|
|
|
+ :option="option"
|
|
|
+ v-model:page="page"
|
|
|
+ :permission="permission"
|
|
|
+ @row-save="createRow"
|
|
|
+ @row-update="updateRow"
|
|
|
+ @row-del="deleteRow"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="resetChange"
|
|
|
+ @size-change="dataList"
|
|
|
+ @current-change="dataList"
|
|
|
+ @selection-change="selectionChange"
|
|
|
>
|
|
|
- <template #menu-right="{}">
|
|
|
- <el-dropdown split-button v-hasPerm="['plan:order:import']"
|
|
|
- >导入
|
|
|
- <template #dropdown>
|
|
|
- <el-dropdown-menu>
|
|
|
- <el-dropdown-item @click="downloadTemplate">
|
|
|
- <i-ep-download />下载模板
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item @click="openDialog('obj-import')">
|
|
|
- <i-ep-top />导入数据
|
|
|
- </el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </template>
|
|
|
- </el-dropdown>
|
|
|
+ <template #menu-left="{ size }">
|
|
|
<el-button
|
|
|
- class="ml-3"
|
|
|
- v-hasPerm="['plan:order:export']"
|
|
|
- @click="handleExport"
|
|
|
+ :disabled="toDeleteIds.length < 1"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ :size="size"
|
|
|
+ @click="multipleDelete"
|
|
|
+ >删除</el-button
|
|
|
>
|
|
|
- <template #icon> <i-ep-download /> </template>导出
|
|
|
+ <el-button
|
|
|
+ :disabled="toDeleteIds.length < 1"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-primary"
|
|
|
+ :size="size"
|
|
|
+ @click="aps1"
|
|
|
+ >批量排程</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template #menu="{size,row,index}">
|
|
|
+ <el-button
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_edit]"
|
|
|
+ v-if="row.workOrderState === '0' || row.workOrderState === '1' || row.workOrderState === '2'"
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ size="small"
|
|
|
+ @click="handleEdit(row,0)"
|
|
|
+ ><i-ep-edit />编辑
|
|
|
</el-button>
|
|
|
+ <el-button @click="aps(row.id)"
|
|
|
+ icon="el-icon-setting"
|
|
|
+ text
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
|
|
|
+ v-if="row.workOrderState === '0' || row.workOrderState === '1' || row.workOrderState === '2'"
|
|
|
+ type="primary"
|
|
|
+ :size="size">排程</el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-setting"
|
|
|
+ text
|
|
|
+ v-if="row.workOrderState === '2'"
|
|
|
+ @click="distribute(row.id)"
|
|
|
+ type="primary"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
|
|
|
+ :size="size">下发</el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-setting"
|
|
|
+ text
|
|
|
+ v-if="row.workOrderState !== '0' && row.workOrderState !== '1'"
|
|
|
+ @click="dialog4.visible = true"
|
|
|
+ type="primary"
|
|
|
+ :size="size">流水</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog.visible"
|
|
|
+ :title="dialog.title"
|
|
|
+ width="80%"
|
|
|
+ @close="dialog.visible = false"
|
|
|
+ >
|
|
|
+ <order-page queryType="1" @orderInfo="orderInfo"/>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
|
- v-model="dialog.visible"
|
|
|
- :title="dialog.title"
|
|
|
- width="500px"
|
|
|
- @close="closeDialog"
|
|
|
+ v-model="dialog1.visible"
|
|
|
+ :title="dialog1.title"
|
|
|
+ width="80%"
|
|
|
+ @close="dialog1.visible = false"
|
|
|
+ >
|
|
|
+ <choice-route-page :material-code="form.materialCode" @routeInfo="routeInfo"/>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog2.visible"
|
|
|
+ :title="dialog2.title"
|
|
|
+ width="80%"
|
|
|
+ @close="dialog2.visible = false"
|
|
|
+ >
|
|
|
+ <choice-workshop-page @workShopInfo="workShopInfo"/>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog3.visible"
|
|
|
+ :title="dialog3.title"
|
|
|
+ width="80%"
|
|
|
+ @close="dialog3.visible = false"
|
|
|
+ >
|
|
|
+ <choice-line-page :parentCode="form.workshopCode" :materialCode="form.materialCode" @lineInfo="lineInfo"/>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog4.visible"
|
|
|
+ :title="dialog4.title"
|
|
|
+ width="950px"
|
|
|
+ @close="dialog4.visible = false"
|
|
|
+ >
|
|
|
+ <work-order-seq :workOrderId="form.id"/>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog5.visible"
|
|
|
+ :title="dialog5.title"
|
|
|
+ width="450px"
|
|
|
+ @close="dialog5.visible = false"
|
|
|
>
|
|
|
<el-form
|
|
|
- v-if="dialog.type === 'obj-import'"
|
|
|
- :model="importData"
|
|
|
- label-width="100px"
|
|
|
- >
|
|
|
- <el-form-item label="Excel文件">
|
|
|
- <el-upload
|
|
|
- ref="uploadRef"
|
|
|
- action=""
|
|
|
- drag
|
|
|
- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
- :limit="1"
|
|
|
- :auto-upload="false"
|
|
|
- :file-list="importData.fileList"
|
|
|
- :on-change="handleFileChange"
|
|
|
- :on-exceed="handleFileExceed"
|
|
|
- >
|
|
|
- <el-icon class="el-icon--upload">
|
|
|
- <i-ep-upload-filled />
|
|
|
- </el-icon>
|
|
|
- <div class="el-upload__text">
|
|
|
- 将文件拖到此处,或
|
|
|
- <em>点击上传</em>
|
|
|
- </div>
|
|
|
- <template #tip>
|
|
|
- <div style="color: red">文件类型: xls/xlsx</div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
+ ref="dataFormRef"
|
|
|
+ :model="formData"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="150px">
|
|
|
+ <el-form-item label="排程时间" prop="apsTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData.apsTime"
|
|
|
+ type="date"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ placeholder="请选择时间"
|
|
|
+ format="YYYY/MM/DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ />
|
|
|
+
|
|
|
+<!-- <el-input width="250px" v-model="formData.apsTime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>-->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="排程类型" prop="apsModel">
|
|
|
+ <el-radio-group v-model="formData.apsModel">
|
|
|
+ <el-radio :value="0">排产</el-radio>
|
|
|
+<!-- <el-radio :value="1">停用</el-radio>-->
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
- <!-- 弹窗底部操作按钮 -->
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
|
|
- <el-button @click="closeDialog">取 消</el-button>
|
|
|
+ <el-button @click="dialog5.visible = false">取 消</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script setup lang="ts">
|
|
|
-import { checkPerm } from "@/directive/permission";
|
|
|
-import type { UploadInstance } from "element-plus";
|
|
|
-import { genFileId } from "element-plus";
|
|
|
-import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
+<script setup>
|
|
|
+import { ref, getCurrentInstance } from "vue";
|
|
|
+import { useCrud } from "@/hooks/userCrud";
|
|
|
import buttonPermission from "@/common/configs/buttonPermission";
|
|
|
-import {
|
|
|
- addOrder,
|
|
|
- deleteOrders,
|
|
|
- downloadTemplateApi,
|
|
|
- exportOrder,
|
|
|
- getOrderPage,
|
|
|
- importOrder,
|
|
|
- updateOrder,
|
|
|
- getExpandAlias,
|
|
|
-} from "@/api/order";
|
|
|
-
|
|
|
-// 弹窗对象
|
|
|
+import {apsWorkOrder,distributeWorkOrder} from "@/api/order"
|
|
|
+import { useCommonStoreHook } from "@/store";
|
|
|
+import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
+import ChoiceRoutePage from "./components/choice-route-page.vue";
|
|
|
+import ChoiceWorkshopPage from "./components/choice-workshop-page.vue";
|
|
|
+import WorkOrderSeq from "./components/work-order-seq.vue";
|
|
|
+import { checkPerm } from "@/directive/permission";
|
|
|
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
+const test = () => {
|
|
|
+ isShowTable.value = true;
|
|
|
+ tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
+};
|
|
|
+const permission = reactive({
|
|
|
+ delBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_del),
|
|
|
+ addBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_add),
|
|
|
+ editBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_edit),
|
|
|
+ menu: true,
|
|
|
+});
|
|
|
const dialog = reactive({
|
|
|
+ title: "订单选择",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+const dialog1 = reactive({
|
|
|
+ title: "工艺选择",
|
|
|
visible: false,
|
|
|
- type: "order-form",
|
|
|
- width: 800,
|
|
|
- title: "",
|
|
|
});
|
|
|
-const search = ref({});
|
|
|
-const option = ref({});
|
|
|
-const pageData = ref([]);
|
|
|
-const form = ref({});
|
|
|
-const page = ref({ total: 0, currentPage: 1, pageSize: 10 });
|
|
|
-const loading = ref(false);
|
|
|
-const uploadRef = ref<UploadInstance>(); // 上传组件
|
|
|
-// 导入数据
|
|
|
-const importData = reactive({
|
|
|
- file: undefined,
|
|
|
- fileList: [],
|
|
|
+const dialog2 = reactive({
|
|
|
+ title: "车间选择",
|
|
|
+ visible: false,
|
|
|
});
|
|
|
-const permission = reactive({
|
|
|
- delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
- addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
- editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
- menu: true,
|
|
|
+const dialog3 = reactive({
|
|
|
+ title: "产线选择",
|
|
|
+ visible: false,
|
|
|
});
|
|
|
-option.value = {
|
|
|
- border: true,
|
|
|
- searchIndex: 3,
|
|
|
- searchIcon: true,
|
|
|
- searchMenuSpan: 8,
|
|
|
- align: "center",
|
|
|
- menuAlign: "center",
|
|
|
- search: true,
|
|
|
- refreshBtn: false,
|
|
|
- from: {
|
|
|
- width: "300",
|
|
|
- },
|
|
|
+const dialog4 = reactive({
|
|
|
+ title: "工单流水",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+const dialog5 = reactive({
|
|
|
+ title: "排程确认",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
+const pickerOptions = ref({
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < Date.now() - 8.64e7;
|
|
|
+ }
|
|
|
+})
|
|
|
+const aps =(id)=>{
|
|
|
+ formData.workOrderIds = [id]
|
|
|
+ dialog5.visible = true
|
|
|
+}
|
|
|
+const distribute = (id)=>{
|
|
|
+ ElMessageBox.confirm("当前操作不可逆,确定下发工单吗?")
|
|
|
+ .then(() => {
|
|
|
+ distributeWorkOrder(id).then((data)=>{
|
|
|
+ ElMessage.success(data.msg);
|
|
|
+ dataList()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // catch error
|
|
|
+ });
|
|
|
+}
|
|
|
+const handleEdit = (row, index) =>{
|
|
|
+ crudRef.value && crudRef.value.rowEdit(row, index);
|
|
|
+}
|
|
|
+const aps1 =()=>{
|
|
|
+ formData.workOrderIds = toDeleteIds
|
|
|
+ dialog5.visible = true
|
|
|
+}
|
|
|
+const dataFormRef = ref(ElForm);
|
|
|
+
|
|
|
+const formData = reactive({
|
|
|
+ apsTime: null,
|
|
|
+ apsModel: 0,
|
|
|
+ workOrderId: 0
|
|
|
+});
|
|
|
+
|
|
|
+const rules = reactive({
|
|
|
+ apsTime: [{ required: true, message: "排程时间不能为空", trigger: "blur" }],
|
|
|
+ apsModel: [{ required: true, message: "排程类型不能为空", trigger: "blur" }],
|
|
|
+});
|
|
|
+const handleSubmit =()=>{
|
|
|
+ dataFormRef.value.validate((isValid) => {
|
|
|
+ if (isValid) {
|
|
|
+ apsWorkOrder(formData).then((data)=>{
|
|
|
+ if(data.code === '200'){
|
|
|
+ ElMessage.success(data.msg);
|
|
|
+ dialog5.visible = false
|
|
|
+ dataList()
|
|
|
+ }else{
|
|
|
+ ElMessage.error(data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+const orderInfo = (value) => {
|
|
|
+ form.value.orderCode = value.orderCode
|
|
|
+ form.value.orderName = value.orderName
|
|
|
+ form.value.materialCode = value.materialCode
|
|
|
+ form.value.materialName = value.materialName
|
|
|
+ form.value.materialModel = value.materialModel
|
|
|
+ form.value.priority = value.priority
|
|
|
+ dialog.visible = false
|
|
|
+}
|
|
|
+const lineInfo = (value) => {
|
|
|
+ form.value.productLineId = value.id
|
|
|
+ form.value.productLineName = value.name
|
|
|
+ dialog3.visible = false
|
|
|
+}
|
|
|
+const workShopInfo = (value) => {
|
|
|
+ form.value.workshopName = value.id
|
|
|
+ form.value.workshopCode = value.code
|
|
|
+ form.value.workshopName = value.name
|
|
|
+ dialog2.visible = false
|
|
|
+}
|
|
|
+const routeInfo = (value) => {
|
|
|
+ form.value.processRouteId = value.id
|
|
|
+ form.value.processRouteCode = value.processRouteCode
|
|
|
+ form.value.processRouteName = value.processRouteName
|
|
|
+ dialog1.visible = false
|
|
|
+}
|
|
|
+// 传入一个url,后面不带/
|
|
|
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
+ useCrud({
|
|
|
+ src: "/api/v1/plan/workOrder",
|
|
|
+ });
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
|
|
|
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
+
|
|
|
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
+
|
|
|
+// 设置表格列或者其他自定义的option
|
|
|
+option.value = Object.assign(option.value, {
|
|
|
+ delBtn: false,
|
|
|
+ selection: true,
|
|
|
+ editBtn: false,
|
|
|
column: [
|
|
|
{
|
|
|
- label: "订单编号",
|
|
|
- prop: "orderCode",
|
|
|
+ label: "工单编号",
|
|
|
+ prop: "workOrderCode",
|
|
|
search: true,
|
|
|
- width: "100",
|
|
|
display: false,
|
|
|
+ width: 125,
|
|
|
},
|
|
|
{
|
|
|
- label: "订单名称",
|
|
|
- prop: "orderName",
|
|
|
+ label: "订单编号",
|
|
|
+ prop: "orderCode",
|
|
|
search: true,
|
|
|
- width: "100",
|
|
|
+ width: 125,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "订单名称不能为空",
|
|
|
+ message: "订单编号不能为空",
|
|
|
trigger: "trigger",
|
|
|
},
|
|
|
],
|
|
|
+ click: ({ value, column }) => {
|
|
|
+ if(column.boxType){
|
|
|
+ dialog.visible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- label: "ERP号",
|
|
|
- prop: "erpCode",
|
|
|
+ label: "订单名称",
|
|
|
+ prop: "orderName",
|
|
|
search: true,
|
|
|
- width: "100",
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "订单编号不能为空",
|
|
|
- trigger: "trigger",
|
|
|
- },
|
|
|
- ],
|
|
|
+ disabled: true,
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
- label: "产品编码",
|
|
|
- prop: "materialCode",
|
|
|
+ label: "产品编号",
|
|
|
+ width: 120,
|
|
|
search: true,
|
|
|
- width: "100",
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "订单编号不能为空",
|
|
|
- trigger: "trigger",
|
|
|
- },
|
|
|
- ],
|
|
|
- focus: ({ value, column }) => {
|
|
|
- //todo
|
|
|
- },
|
|
|
+ disabled: true,
|
|
|
+ prop: "materialCode",
|
|
|
},
|
|
|
{
|
|
|
label: "产品名称",
|
|
|
- prop: "materialName",
|
|
|
+ width: 120,
|
|
|
search: true,
|
|
|
- width: "100",
|
|
|
+ disabled: true,
|
|
|
+ prop: "materialName",
|
|
|
},
|
|
|
{
|
|
|
label: "产品规格",
|
|
|
- width: "100",
|
|
|
+ width: 120,
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ disabled: true,
|
|
|
prop: "materialModel",
|
|
|
},
|
|
|
{
|
|
|
- label: "订单状态",
|
|
|
- prop: "orderState",
|
|
|
+ label: "优先级",
|
|
|
+ prop: "priority",
|
|
|
display: false,
|
|
|
- width: "100",
|
|
|
+ width: "80",
|
|
|
type: "select", //类型为下拉选择框
|
|
|
dicUrl:
|
|
|
- dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_state,
|
|
|
+ dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
|
|
|
props: {
|
|
|
label: "dictLabel",
|
|
|
value: "dictValue",
|
|
|
},
|
|
|
- searchClearable: false, //可清空的输入框,默认为true
|
|
|
- filterable: true, //添加filterable属性即可启用搜索功能
|
|
|
},
|
|
|
{
|
|
|
- label: "订单类型",
|
|
|
- prop: "orderType",
|
|
|
+ label: "状态",
|
|
|
+ prop: "workOrderState",
|
|
|
+ width: "80",
|
|
|
+ display: false,
|
|
|
type: "select", //类型为下拉选择框
|
|
|
- width: "100",
|
|
|
- dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_type,
|
|
|
+ dicUrl:
|
|
|
+ dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_work_order_state,
|
|
|
props: {
|
|
|
label: "dictLabel",
|
|
|
value: "dictValue",
|
|
|
},
|
|
|
- searchClearable: false, //可清空的输入框,默认为true
|
|
|
- filterable: true, //添加filterable属性即可启用搜索功能
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "工艺路线",
|
|
|
+ prop: "processRouteName",
|
|
|
+ width: 120,
|
|
|
+ overHidden: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "订单类型不能为空",
|
|
|
+ message: "工艺路线不能为空",
|
|
|
trigger: "trigger",
|
|
|
},
|
|
|
],
|
|
|
+ click: ({ value, column }) => {
|
|
|
+ if(column.boxType){
|
|
|
+ if(!form.value.materialCode){
|
|
|
+ ElMessage({
|
|
|
+ message: "请先选择订单",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dialog1.visible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- label: "订单数量",
|
|
|
- prop: "orderNum",
|
|
|
- type: "number",
|
|
|
- width: "100",
|
|
|
- min: 0,
|
|
|
- max: 99999,
|
|
|
+ label: "生产车间",
|
|
|
+ prop: "workshopName",
|
|
|
+ width: 120,
|
|
|
+ overHidden: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "订单数量不能为空",
|
|
|
+ message: "生产车间不能为空",
|
|
|
trigger: "trigger",
|
|
|
},
|
|
|
],
|
|
|
+ click: ({ value, column }) => {
|
|
|
+ if(column.boxType){
|
|
|
+ dialog2.visible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- label: "排产数量",
|
|
|
- prop: "scheduledNum",
|
|
|
- width: "100",
|
|
|
- display: false,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "优先级",
|
|
|
- prop: "priority",
|
|
|
- width: "100",
|
|
|
- type: "select", //类型为下拉选择框
|
|
|
- dicUrl:
|
|
|
- dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
|
|
|
- props: {
|
|
|
- label: "dictLabel",
|
|
|
- value: "dictValue",
|
|
|
- },
|
|
|
- searchClearable: false, //可清空的输入框,默认为true
|
|
|
- filterable: true, //添加filterable属性即可启用搜索功能
|
|
|
+ label: "产线名称",
|
|
|
+ prop: "productLineName",
|
|
|
+ width: 120,
|
|
|
+ overHidden: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "订单类型不能为空",
|
|
|
+ message: "产线名称不能为空",
|
|
|
trigger: "trigger",
|
|
|
},
|
|
|
],
|
|
|
+ click: ({ value, column }) => {
|
|
|
+ if(column.boxType){
|
|
|
+ if(!form.value.workshopCode){
|
|
|
+ ElMessage({
|
|
|
+ message: "请先选择生产车间",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dialog3.visible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "开始时间",
|
|
|
+ prop: "planStartWhen",
|
|
|
+ width: 180,
|
|
|
+ overHidden: true,
|
|
|
+ display: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "结束时间",
|
|
|
+ prop: "planStartEnd",
|
|
|
+ width: 180,
|
|
|
+ display: false,
|
|
|
+ overHidden: true,
|
|
|
},
|
|
|
{
|
|
|
- label: "交付日期",
|
|
|
- prop: "deliverTime",
|
|
|
- type: "date",
|
|
|
- width: "100",
|
|
|
- format: "YYYY-MM-DD", //前端展示格式
|
|
|
- valueFormat: "YYYY-MM-DD", //设置后端接收的日期格式
|
|
|
+ label: "工单数量",
|
|
|
+ prop: "planNum",
|
|
|
+ width: 85,
|
|
|
+ type: "number",
|
|
|
+ min: 1,
|
|
|
+ max: 99999,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择交付日期",
|
|
|
+ message: "工单数量不能为空",
|
|
|
trigger: "trigger",
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- label: "所属公司",
|
|
|
- prop: "companyId",
|
|
|
- width: "100",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "项目号",
|
|
|
- width: "100",
|
|
|
- prop: "projectCode",
|
|
|
+ label: "完成数量",
|
|
|
+ width: 85,
|
|
|
+ display: false,
|
|
|
+ prop: "completeNum",
|
|
|
+
|
|
|
},
|
|
|
{
|
|
|
- label: "绑定铭牌",
|
|
|
- prop: "nameplated",
|
|
|
- width: "100",
|
|
|
- type: "radio", //类型为单选框
|
|
|
- dicData: [
|
|
|
- {
|
|
|
- label: "否",
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "是",
|
|
|
- value: 1,
|
|
|
- },
|
|
|
- ],
|
|
|
- value: 0,
|
|
|
+ label: "下线数量",
|
|
|
+ width: 85,
|
|
|
+ display: false,
|
|
|
+ prop: "beforeNum",
|
|
|
},
|
|
|
{
|
|
|
- label: "备注",
|
|
|
- prop: "remark",
|
|
|
- width: "100",
|
|
|
- minRows: 2, //最小行/最小值
|
|
|
- type: "textarea", //类型为多行文本域框
|
|
|
- maxlength: 512, //最大输入长度
|
|
|
+ label: "报废数量",
|
|
|
+ width: 85,
|
|
|
+ display: false,
|
|
|
+ prop: "scrapNum",
|
|
|
},
|
|
|
{
|
|
|
label: "创建时间",
|
|
|
- prop: "created",
|
|
|
- width: "140",
|
|
|
- overHidden: true,
|
|
|
+ width: 180,
|
|
|
display: false,
|
|
|
- type: "datetime",
|
|
|
- valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ prop: "created",
|
|
|
},
|
|
|
{
|
|
|
label: "创建人",
|
|
|
- prop: "creator",
|
|
|
+ width: 90,
|
|
|
display: false,
|
|
|
- width: 80,
|
|
|
- overHidden: true,
|
|
|
+ prop: "creator",
|
|
|
},
|
|
|
],
|
|
|
-};
|
|
|
-
|
|
|
-const queryExpandAlias = () => {
|
|
|
- getExpandAlias(dictDataUtil.EXPAND_FIELD_TABLE.plan_order_info).then(
|
|
|
- (data: any) => {
|
|
|
- if (data.data) {
|
|
|
- data.data.forEach((item: any) => {
|
|
|
- option.value.column.push({
|
|
|
- label: item.label,
|
|
|
- prop: item.field,
|
|
|
- width: "100",
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
-};
|
|
|
+});
|
|
|
|
|
|
-const handleQuery = (params, done) => {
|
|
|
- console.log(JSON.stringify(option.value.column));
|
|
|
- loading.value = true;
|
|
|
- const querySearch = {
|
|
|
- pageSize: page.value.pageSize,
|
|
|
- pageNo: page.value.currentPage,
|
|
|
- ...params,
|
|
|
- };
|
|
|
- getOrderPage(querySearch)
|
|
|
- .then(({ data }) => {
|
|
|
- pageData.value = data.records;
|
|
|
- page.value.total = data.totalCount;
|
|
|
- page.value.currentPage = data.pageNo;
|
|
|
- page.value.pageSize = data.pageSize;
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- loading.value = false;
|
|
|
- if (done) {
|
|
|
- done();
|
|
|
- }
|
|
|
- });
|
|
|
-};
|
|
|
-const resetQuery = () => {};
|
|
|
-const rowSave = (form, done, loading) => {
|
|
|
- loading();
|
|
|
- addOrder(form).then((data: any) => {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- done();
|
|
|
- handleQuery(null, null);
|
|
|
- });
|
|
|
-};
|
|
|
-const rowUpdate = (form, index, done, loading) => {
|
|
|
- loading();
|
|
|
- updateOrder(form).then((data: any) => {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- done();
|
|
|
- handleQuery(null, null);
|
|
|
- });
|
|
|
-};
|
|
|
-const rowDel = (form: any, index) => {
|
|
|
- ElMessageBox.confirm("当前操作会删除数据,你确认要继续吗?")
|
|
|
- .then(() => {
|
|
|
- deleteOrders([form.id])
|
|
|
- .then((data: any) => {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- handleQuery(null, null);
|
|
|
- })
|
|
|
- .finally(() => {});
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- // catch error
|
|
|
- });
|
|
|
-};
|
|
|
-const openDialog = (type) => {
|
|
|
- dialog.visible = true;
|
|
|
- dialog.type = type;
|
|
|
- if (dialog.type === "obj-import") {
|
|
|
- // 导入弹窗
|
|
|
- dialog.title = "数据导入";
|
|
|
- dialog.width = 600;
|
|
|
- }
|
|
|
-};
|
|
|
-const closeDialog = () => {
|
|
|
- dialog.visible = false;
|
|
|
- if (dialog.type === "obj-import") {
|
|
|
- importData.file = undefined;
|
|
|
- importData.fileList = [];
|
|
|
- }
|
|
|
-};
|
|
|
-const downloadTemplate = () => {
|
|
|
- downloadTemplateApi().then((response) => {
|
|
|
- downFile(response);
|
|
|
- });
|
|
|
-};
|
|
|
-/** 弹窗提交 */
|
|
|
-const handleSubmit = () => {
|
|
|
- importOrder(importData).then((data: any) => {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- dialog.visible = false;
|
|
|
- handleQuery(null, null);
|
|
|
- });
|
|
|
-};
|
|
|
-/** Excel文件 Change */
|
|
|
-const handleFileChange = (file) => {
|
|
|
- importData.file = file.raw;
|
|
|
-};
|
|
|
-/** 文件下载 */
|
|
|
-const downFile = (response: any) => {
|
|
|
- const fileData = response.data;
|
|
|
- const fileName = decodeURI(
|
|
|
- response.headers["content-disposition"].split(";")[1].split("=")[1]
|
|
|
- );
|
|
|
- const fileType =
|
|
|
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
|
|
|
- const blob = new Blob([fileData], { type: fileType });
|
|
|
- const downloadUrl = window.URL.createObjectURL(blob);
|
|
|
- const downloadLink = document.createElement("a");
|
|
|
- downloadLink.href = downloadUrl;
|
|
|
- downloadLink.download = fileName;
|
|
|
- document.body.appendChild(downloadLink);
|
|
|
- downloadLink.click();
|
|
|
- document.body.removeChild(downloadLink);
|
|
|
- window.URL.revokeObjectURL(downloadUrl);
|
|
|
-};
|
|
|
-/** Excel文件 Exceed */
|
|
|
-const handleFileExceed = (files) => {
|
|
|
- uploadRef.value!.clearFiles();
|
|
|
- const file = files[0];
|
|
|
- file.uid = genFileId();
|
|
|
- uploadRef.value!.handleStart(file);
|
|
|
- importData.file = file;
|
|
|
-};
|
|
|
-/** 导出 */
|
|
|
-const handleExport = () => {
|
|
|
- exportOrder(search.value).then((response: any) => {
|
|
|
- downFile(response);
|
|
|
- });
|
|
|
-};
|
|
|
-onMounted?.(() => {
|
|
|
- queryExpandAlias();
|
|
|
- handleQuery(null, null);
|
|
|
+onMounted(() => {
|
|
|
+ // console.log("crudRef", crudRef)
|
|
|
+ dataList();
|
|
|
});
|
|
|
</script>
|