qinhb 1 anno fa
parent
commit
22e4b5384b

+ 35 - 5
src/views/plan/schedule/index.vue

@@ -16,6 +16,16 @@
       @current-change="dataList"
       @selection-change="selectionChange"
     >
+
+      <template #menu="{size,row,index}">
+        <el-button
+            icon="el-icon-edit"
+            text
+            v-if="row.state === '-1' || row.state ==='0'"
+            @click="handleEdit(row,index)"
+            type="primary"
+            :size="size">编辑</el-button>
+      </template>
       <template #menu-left>
         <div id="charts"></div>
       </template>
@@ -47,7 +57,9 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
 const charts = ref(null);
-
+const handleEdit =(row,index) =>{
+  crudRef.value && crudRef.value.rowEdit(row, index);
+}
 onMounted(() => {
   charts.value = echarts.init(document.getElementById("charts"));
 
@@ -86,52 +98,64 @@ onMounted(() => {
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: true,
-  menu: false,
+  menu: true,
+  menuWidth: 100,
   addBtn: false,
   filterBtn: false,
   searchShowBtn: false,
   columnBtn: false,
   gridBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
   column: [
     {
       label: "序列号",
       prop: "seqNo",
+      editDisabled: true,
       search: true,
     },
     {
       label: "工位名称",
       prop: "stationName",
       search: true,
+      editDisabled: true,
     },
     {
       label: "工单编码",
       prop: "workOrderCode",
       search: true,
       width: 125,
+      editDisabled: true,
     },
 
     {
       label: "产线名称",
       prop: "productLineName",
+      editDisabled: true,
     },
     {
-      label: "工艺路线名称",
+      label: "工艺路线",
       prop: "routeName",
+      editDisabled: true,
     },
     {
       label: "物料编号",
       prop: "materialCode",
       search: true,
+      editDisabled: true,
     },
 
     {
       label: "工序编码",
       prop: "operationCode",
+      editDisabled: true,
       search: true,
     },
     {
       label: "工序名称",
       prop: "operationName",
+      editDisabled: true,
     },
     {
       label: "排序",
@@ -139,6 +163,7 @@ option.value = Object.assign(option.value, {
       formatter: (val) => {
         return val.operationSort + 1;
       },
+      editDisabled: true,
       width: 60,
     },
     {
@@ -147,6 +172,7 @@ option.value = Object.assign(option.value, {
       type: "select",
       search: true,
       width: 80,
+      editDisabled: true,
       dicUrl:
         dictDataUtil.request_url + dictDataUtil.TYPE_CODE.station_task_state,
       props: {
@@ -155,12 +181,16 @@ option.value = Object.assign(option.value, {
       },
     },
     {
-      label: "计划开始时间",
+      label: "开始时间",
       prop: "planStartWhen",
+      type: "datetime",
+      valueFormat: "YYYY-MM-DD HH:mm:ss",
     },
     {
-      label: "计划结束时间",
+      label: "结束时间",
       prop: "planStartEnd",
+      type: "datetime",
+      valueFormat: "YYYY-MM-DD HH:mm:ss",
     },
   ],
 });

+ 39 - 1
src/views/plan/workOrder/components/work-order-seq.vue

@@ -12,7 +12,31 @@
         @size-change="dataList"
         @current-change="dataList"
     >
+      <template #menu-right="{}">
+        <el-dropdown split-button
+        >导入
+          <template #dropdown>
+            <el-dropdown-menu>
+              <el-dropdown-item
+                  @click="downloadTemplate('/api/v1/plan/seq/template')"
+              >
+                <i-ep-download />下载模板
+              </el-dropdown-item>
+              <el-dropdown-item @click="importExcelData">
+                <i-ep-top />导入数据
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown>
+        <el-button
+            class="ml-3"
+            @click="exportData('/api/v1/plan/seq/export')"
+        >
+          <template #icon> <i-ep-download /> </template>导出
+        </el-button>
+      </template>
     </avue-crud>
+    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
 </template>
 <script setup>
@@ -46,7 +70,7 @@ const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   });
 const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
-const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
 // 设置表格列或者其他自定义的option
@@ -85,4 +109,18 @@ onMounted(() => {
   search.value.workOrderCode = props.workOrderCode
   dataList();
 });
+/**
+ * 上传excel相关
+ */
+const uploadRef = ref(null);
+const uploadFinished = () => {
+  // 上传完成后的刷新操作
+  page.currentPage = 1;
+  dataList();
+};
+const importExcelData = () => {
+  if (uploadRef.value) {
+    uploadRef.value.show("/api/v1/plan/seq/import");
+  }
+};
 </script>

+ 17 - 3
src/views/plan/workOrder/index.vue

@@ -63,10 +63,9 @@
         <el-button
             icon="el-icon-setting"
             text
-            v-if="row.workOrderState !== '0' && row.workOrderState !== '1'"
             @click="showSeqPage(row.workOrderCode)"
             type="primary"
-            :size="size">流</el-button>
+            :size="size">流转卡号</el-button>
         <el-button
             icon="el-icon-delete"
             text
@@ -145,6 +144,12 @@
 
 <!--        <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="priority" v-if="apsType === 1">
+          <el-select v-model="formData.priority" placeholder="排程类型"
+                     style="width:200px;">
+            <el-option v-for="item in apsPriority" :label="item.dictLabel" :value="item.dictValue" :key="item.dictValue"></el-option>
+          </el-select>
+        </el-form-item>
       <el-form-item label="排程类型" prop="apsModel">
         <el-select v-model="formData.apsModel" placeholder="排程类型"
                    style="width:200px;">
@@ -205,14 +210,16 @@ const dialog3 = reactive({
   visible: false,
 });
 const dialog4 = reactive({
-  title: "工单流水",
+  title: "流转卡号",
   visible: false,
 });
 const dialog5 = reactive({
   title: "排程确认",
   visible: false,
 });
+const apsType = ref(0)
 const aps =(id)=>{
+  apsType.value = 0
   formData.workOrderIds = [id]
   dialog5.visible = true
 }
@@ -252,18 +259,22 @@ const handleEdit = (row, index) =>{
   crudRef.value && crudRef.value.rowEdit(row, index);
 }
 const aps1 =()=>{
+  apsType.value = 1
   formData.workOrderIds = toDeleteIds
   dialog5.visible = true
 }
 const dataFormRef = ref(ElForm);
 const schedulingTypes = ref([])
+const apsPriority = ref([])
 const formData = reactive({
   apsTime: null,
+  priority: "1",
   apsModel: "0",
   workOrderId: 0
 });
 
 const rules = reactive({
+  priority: [{ required: true, message: "请选择优先级", trigger: "blur" }],
   apsTime: [{ required: true, message: "排程时间不能为空", trigger: "blur" }],
   apsModel: [{ required: true, message: "排程类型不能为空", trigger: "blur" }],
 });
@@ -547,5 +558,8 @@ onMounted(() => {
   queryDictDataByType("order_scheduling_type").then((data)=>{
     schedulingTypes.value = data.data
   })
+  queryDictDataByType("aps_priority").then((data)=>{
+    apsPriority.value = data.data
+  })
 });
 </script>