qinhb 3 ヶ月 前
コミット
ef663b0df6

+ 2 - 0
src/common/configs/dictDataUtil.ts

@@ -19,6 +19,8 @@ const DictDataUtil = {
     plan_work_order_state: "plan_work_order_state",
     //订单状态
     plan_order_state: "plan_order_state",
+    //预警角色
+    warning_role: "warning_role",
     //设备类型
     device_type: "device_type",
     //设备状态

+ 3 - 0
src/layout/components/NavBar/components/NavbarRight.vue

@@ -153,6 +153,9 @@ const clickItem =(row) =>{
   if(row.msgId === '4'){
     window.open("/outsource",'_blank')
   }
+  if(row.msgId === '5'){
+    window.open("/storage/warningInfo",'_blank')
+  }
 }
 const openMessageDialog = () => {
   handleQuery();

+ 161 - 0
src/views/storage/warningInfo/index.vue

@@ -0,0 +1,161 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @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="{ size, row, index }">
+        <el-button
+            v-if="row.state === '0' && row.userName === userStore.user.username"
+            type="primary"
+            link
+            size="small"
+            @click="test(row, 0)"
+        ><i-ep-edit />处理
+        </el-button>
+      </template>
+    </avue-crud>
+    <el-dialog
+        v-model="dialog1.visible"
+        :title="dialog1.title"
+        width="950px"
+        @close="dialog1.visible = false"
+    >
+      <choice-item-page enabled="" @materialInfo="materialInfo"/>
+    </el-dialog>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook,useUserStoreHook} from "@/store";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const userStore = useUserStoreHook();
+const test = (row) => {
+  ElMessageBox.confirm("你确定要处理当前消息吗", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    row.state = 1;
+    form.value = row
+    updateRow(row).then((res)=>{
+      dataList()
+    });
+  });
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/warningInfo",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+const dialog1 = reactive({
+  title: "物料选择",
+  visible: false,
+});
+const materialInfo = (value) => {
+  form.value.code = value.materialCode
+  form.value.name = value.materialName
+  form.value.unit = value.unitDictValue
+  dialog1.visible = false
+}
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  editBtn: false,
+  viewBtn: false,
+  addBtn: false,
+  column: [
+    {
+      label: "物料编码",
+      prop: "materialCode",
+      width: 150,
+      overHidden: true,
+      search: true,
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      search: true,
+      width: 150,
+      overHidden: true,
+      disabled: true,
+    },
+    {
+      label: "物料型号",
+      prop: "materialModel",
+      search: true,
+      width: 150,
+      overHidden: true,
+      disabled: true,
+      rules: [
+        {
+          required: true,
+          message: "物料名称不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "预警信息",
+      prop: "warningInfo",
+
+    },
+    {
+      label: "处理人",
+      prop: "userName",
+      search: true,
+      display: false
+    },
+    {
+      label: "状态",
+      prop: "state",
+      type: 'select',
+      dicData: [{label: '未处理',value : '0'},{label: '已处理', value : '1'}],
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      width: 180,
+      display: false
+    },
+    {
+      label: "处理时间",
+      prop: "updated",
+      width: 180,
+      html: true,
+      formatter: (val) => {
+        if (val.state === "1") {
+          return val.updated
+        } else {
+          return '';
+        }
+      },
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+</script>

+ 101 - 0
src/views/storage/warningRole/index.vue

@@ -0,0 +1,101 @@
+<template>
+  <div class="mainContentBox" style="width:50%; float: left;">
+    <avue-crud
+        ref="crudRef"
+        v-model="form"
+        :data="data"
+        :option="option"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @row-click="rowClick"
+    >
+    </avue-crud>
+  </div>
+  <div class="mainContentBox" style="width:50%;float: left;">
+    <avue-crud
+        ref="crudRef"
+        v-model="form"
+        :data="data1"
+        :option="option1"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import {queryDictDataByType } from "@/api/system/dict"
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const rowClick = (row) => {
+
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wmsOrder",
+  });
+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: false,
+  viewBtn: false,
+  editBtn: true,
+  menu: true,
+  addBtn: false,
+  searchBtn: false,
+  column: [
+    {
+      label: "角色名称",
+      prop: "dictLabel",
+      overHidden: true,
+      type: "select",
+    },
+  ],
+});
+const data1 = ref([])
+const option1 = ref({
+  delBtn: true,
+  selection: false,
+  viewBtn: false,
+  editBtn: false,
+  menu: true,
+  addBtn: false,
+  searchBtn: false,
+  column: [
+    {
+      label: "用户名称",
+      prop: "dictLabel",
+      overHidden: true,
+      type: "select",
+      dicUrl:
+          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.warning_role,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+    },
+  ],
+});
+const queryRoles = () => {
+  queryDictDataByType("warning_role").then((res)=>{
+    data.value =res.data
+  });
+};
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  //search.value.type = '2'
+  queryRoles();
+});
+</script>

+ 7 - 0
src/views/storage/wmsOrder/index.vue

@@ -142,6 +142,13 @@ option.value = Object.assign(option.value, {
       }
     },
     {
+      label: "操作日志",
+      prop: "message",
+      width: 180,
+      overHidden: true,
+      display: false
+    },
+    {
       label: "操作时间",
       prop: "created",
       width: 180,