Selaa lähdekoodia

归档流程页面添加

dengrui 6 kuukautta sitten
vanhempi
commit
5b726e2648

+ 41 - 0
src/api/apply/index.ts

@@ -0,0 +1,41 @@
+import request from "@/utils/request";
+
+export function gerFormList(data: string) {
+  return request({
+    url: "/api/v1/process/examine/procedure/list",
+    method: "post",
+    data,
+  });
+}
+//审核
+export function toCheck(data: string) {
+  return request({
+    url: "/api/v1/process/excel/examine/add",
+    method: "post",
+    data,
+  });
+}
+//获取历史记录
+export function logList(data: string) {
+  return request({
+    url: "/api/v1/process/excel/log/list",
+    method: "post",
+    data,
+  });
+}
+//获取提交审核后的信息
+export function examineList(data: string) {
+  return request({
+    url: "/api/v1/process/excel/examine/list",
+    method: "post",
+    data,
+  });
+}
+//审核
+export function toCheckRes(data: string) {
+  return request({
+    url: "/api/v1/process/excel/log/handle",
+    method: "post",
+    data,
+  });
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
src/assets/icons/jiantou.svg


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
src/assets/icons/jiantoumr.svg


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

@@ -4,8 +4,7 @@ const DictDataUtil = {
   request_url:
     import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dictData/queryByType/",
   dept_tree_url: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/orgTree",
-  dept_list_url:
-    import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/list",
+  dept_list_url: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/list",
   post_list_url: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/post/list",
 
   img_url: import.meta.env.VITE_APP_UPLOAD_URL,

+ 196 - 47
src/views/base/apply/apply.vue

@@ -3,72 +3,221 @@
     <div class="line">
       <div class="el-descriptions__title">流程状态</div>
       <el-timeline style="max-width: 600px; margin-top: 20px">
-        <el-timeline-item center timestamp="2018/4/12" placement="top">
-          <el-card>
-            <h4>Update Github template</h4>
-            <p>Tom committed 2018/4/12 20:46</p>
-          </el-card>
-        </el-timeline-item>
-        <el-timeline-item center timestamp="2018/4/3" placement="top">
-          <el-card>
-            <h4>Update Github template</h4>
-            <p>Tom committed 2018/4/3 20:46</p>
-          </el-card>
-        </el-timeline-item>
+        <template v-if="LogList.length > 0">
+          <el-timeline-item
+            v-for="(item, index) in LogList"
+            :key="index"
+            center
+            :timestamp="item.created"
+            placement="top"
+          >
+            <el-card>
+              <h4>阶段:{{ item.positionName }}</h4>
+              <h4>
+                结果:<span
+                  :class="item.examineResult == 1 ? 'green' : 'red'"
+                  >{{ item.examineResult == 1 ? "通过" : "驳回" }}</span
+                >
+              </h4>
+              <p v-if="item.remark">备注:{{ item.remark }}</p>
+              <p>操作人:{{ item.userName }}</p>
+            </el-card>
+          </el-timeline-item>
+        </template>
+        <template v-else>暂无内容</template>
       </el-timeline>
     </div>
     <div class="form">
       <div class="description">
-        <el-descriptions title="User Info" border>
-          <el-descriptions-item label="Username"
-            >kooriookami</el-descriptions-item
-          >
-          <el-descriptions-item label="Telephone"
-            >18100000000</el-descriptions-item
-          >
-          <el-descriptions-item label="Place">Suzhou</el-descriptions-item>
-          <el-descriptions-item label="Remarks">
-            <el-tag size="small">School</el-tag>
+        <el-descriptions title="基本信息" border>
+          <el-descriptions-item label="物料编号">{{
+            props.rowData.materialCode
+          }}</el-descriptions-item>
+          <el-descriptions-item label="物料名称">{{
+            props.rowData.materialName
+          }}</el-descriptions-item>
+          <el-descriptions-item label="物料型号">{{
+            props.rowData.materialModel
+          }}</el-descriptions-item>
+          <el-descriptions-item label="订单编号">
+            {{ props.rowData.orderCode }}
           </el-descriptions-item>
-          <el-descriptions-item label="Address">
-            No.1188, Wuzhong Avenue, Wuzhong District, Suzhou, Jiangsu Province
+          <el-descriptions-item label="订单名称">
+            {{ props.rowData.orderName }}
+          </el-descriptions-item>
+          <el-descriptions-item label="订单状态">
+            {{ getStatus(props.rowData.state) }}
           </el-descriptions-item>
         </el-descriptions>
       </div>
       <div class="el-descriptions__title">提交申请</div>
-      <div class="applyForm">
-        <el-form :model="form">
-          <el-form-item label="签章人员:">
-            <el-select v-model="form.qzId">
-              <el-option
-                v-for="option in options"
-                :key="option.value"
-                :label="option.label"
-                :value="option.value"
-              />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="工艺路线编号">
-            <el-input v-model="form.processRouteCode" />
-          </el-form-item>
-          <el-form-item label="工艺路线编号">
-            <el-input v-model="form.processRouteCode" />
-          </el-form-item>
-        </el-form>
+      <div class="applyForm" v-if="checkList.length > 0">
+        <template v-for="(item, index) in checkList" :key="item">
+          <el-form :model="item" ref="applyFormRef">
+            <el-row>
+              <el-col :span="12" style="display: flex">
+                <svg-icon
+                  :icon-class="
+                    rowData.state == '3'
+                      ? 'jiantoumr'
+                      : item.sort == rowData.sort
+                        ? 'jiantou'
+                        : 'jiantoumr'
+                  "
+                  v-if="showStatus"
+                  style="margin-right: 10px"
+                  size="30"
+                />
+                <el-form-item
+                  style="flex: 1; align-items: start"
+                  :label="item.positionName + ':'"
+                  :rules="[{ required: true }]"
+                  prop="userName"
+                >
+                  <el-select v-model="item.userName" :disabled="showStatus">
+                    <el-option
+                      v-for="items in userList"
+                      :key="items.userName"
+                      :label="items.userName"
+                      :value="items.userName"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item
+                  style="margin-left: 20px"
+                  label="备注:"
+                  v-if="item.remark"
+                  prop="remark"
+                >
+                  {{ item.remark }}
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </template>
       </div>
       <div class="btns">
-        <el-button type="primary">提交</el-button>
+        <el-button type="primary" @click="submit" v-if="!showStatus"
+          >提交</el-button
+        >
       </div>
     </div>
   </div>
 </template>
 <script setup>
-const form = ref({
-  qzId: 0,
+import { gerFormList, toCheck, logList, examineList } from "@/api/apply";
+import { getUserList } from "@/api/system/user";
+const props = defineProps({
+  rowData: {
+    type: Object,
+  },
+  showStatus: {
+    type: Boolean,
+  },
+});
+const emits = defineEmits(["close", "dataList"]);
+const getStatus = (val) => {
+  switch (val) {
+    case "0":
+      return "待发起";
+      break;
+    case "1":
+      return "驳回";
+      break;
+    case "2":
+      return "审核中";
+      break;
+    case "3":
+      return "已完成";
+      break;
+  }
+};
+const applyFormRef = ref([]);
+const checkList = ref([]);
+const userList = ref([]);
+const submitList = ref([]);
+const LogList = ref([]);
+const getlogList = async () => {
+  const { data } = await logList({ excelFormId: props.rowData.id });
+  console.log(data);
+  LogList.value = data;
+};
+const submit = async () => {
+  const promiseArray = ref([]);
+  applyFormRef.value.forEach((item) => {
+    if (item) {
+      promiseArray.value.push(
+        new Promise((resolve, reject) => {
+          item.validate((valid, fields) => {
+            if (valid) {
+              resolve();
+            } else {
+              reject();
+            }
+          });
+        })
+      );
+    }
+  });
+  Promise.all(promiseArray.value)
+    .then(async () => {
+      //校验成功 进入下层逻辑
+      submitList.value = [];
+      checkList.value.forEach((item, index) => {
+        submitList.value.push({
+          excelFormId: props.rowData.id,
+          isEnd: index == checkList.value.length - 1 ? 1 : 0,
+          positionName: item.positionName,
+          sort: item.sort,
+          userName: item.userName,
+        });
+      });
+      const { data, code } = await toCheck(submitList.value);
+      if (code == "200") {
+        emits("close");
+        emits("dataList");
+        ElMessage.success("提交成功");
+      }
+    })
+    .catch(() => {
+      //校验失败
+      ElMessage.error("请检查表单红项填写");
+    });
+};
+const queryUserList = () => {
+  getUserList({}).then((data) => {
+    userList.value = data.data;
+  });
+};
+const getFormListData = async (type) => {
+  const { data } = await gerFormList({ formType: type });
+  checkList.value = data;
+};
+//获取提交审核后的数据
+const getExamineList = async () => {
+  const { data } = await examineList({ excelFormId: props.rowData.id });
+  console.log(data);
+  checkList.value = data;
+};
+onMounted(async () => {
+  await getlogList();
+  queryUserList();
+  if (props.showStatus == true) {
+    await getExamineList();
+  } else {
+    await getFormListData(props.rowData.formType);
+  }
 });
-const options = ref([]);
 </script>
 <style lang="scss" scoped>
+.green {
+  color: rgb(94, 221, 152);
+}
+.red {
+  color: rgb(255, 106, 106);
+}
 .body {
   display: flex;
 

+ 91 - 197
src/views/base/apply/index.vue

@@ -7,87 +7,81 @@
       :data="data"
       :option="option"
       v-model:page="page"
-      @row-save="addRow"
-      @row-update="updateRow"
-      @row-del="deleteRow"
       @search-change="searchChange"
       @search-reset="resetChange"
       @size-change="dataList"
       @current-change="dataList"
       @selection-change="selectionChange"
     >
-      <template #enable="scope">
-        <el-switch
-          active-value="1"
-          inactive-value="0"
-          inline-prompt
-          active-text="启用"
-          inactive-text="禁用"
-          v-model="scope.row.enable"
-          @click="changeItem(scope.row)"
-          class="ml-2"
-          style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
-        />
-      </template>
       <template #menu="{ row, index, type }">
-        <!-- <el-button @click="deleteRecord(row, index, done)" text type="primary"
-          >删除</el-button
-        > -->
+        <el-button
+          @click="addApply(row)"
+          v-if="row.state == '0' || row.state == '1'"
+          text
+          type="primary"
+          >发起申请</el-button
+        >
+        <el-button
+          @click="showApply(row)"
+          v-if="row.state != '0'"
+          text
+          type="primary"
+          >查看</el-button
+        >
       </template>
     </avue-crud>
-
-    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
-  <CommonTable
-    ref="ctableRef"
-    tableTitle="BOM添加"
-    tableType="MARTERIAL"
-    @selected-sure="onSelectedFinish"
-  />
   <el-dialog
     v-model="dialog.visible"
     :title="dialog.title"
     width="80%"
     @close="dialog.visible = false"
-    ><Apply />
+  >
+    <Apply
+      :rowData="rowData"
+      @close="dialog.visible = false"
+      :showStatus
+      @data-list="getList"
+      :key="applyKey"
+    />
   </el-dialog>
 </template>
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import { useCommonStoreHook, useDictionaryStore } from "@/store";
-import { updateDrawaing } from "@/api/drawing";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import Apply from "./apply.vue";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 // 数据字典相关
 const { dicts } = useDictionaryStore();
-const fileUrl = ref(""); //单文件
-const pdfUrlList = ref([]);
-const srcList = ref([]);
-const fileNameList = ref([]);
+const getList = () => {
+  dataList();
+};
+const rowData = ref({});
+const showStatus = ref(false);
+const applyKey = ref(false);
+const addApply = (row) => {
+  applyKey.value = !applyKey.value;
+  rowData.value = row;
+  showStatus.value = false;
+  dialog.value.visible = true;
+};
+const showApply = (row) => {
+  applyKey.value = !applyKey.value;
+  rowData.value = row;
+  showStatus.value = true;
+  dialog.value.visible = true;
+};
 const dialog = ref({
-  visible: true,
+  visible: false,
   title: "归档申请",
 });
-const ctableRef = ref(null);
-const changeItem = (row) => {
-  updateDrawaing(row).then(() => {
-    ElMessage.success("操作成功");
-    dataList();
-  });
-};
 
-const addRow = (form2, done) => {
-  createRow(form, done, done);
-  pdfUrlList.value = [];
-  srcList.value = [];
-  fileNameList.value = [];
-};
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
-    src: "/api/v1/base/drawing",
+    src: "/api/v1/ProcessFormData/examine",
   });
 const {
   dataEditList,
@@ -102,136 +96,90 @@ const { selectionChange, multipleDelete } = Methords; //选中和批量删除事
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
-const router = useRouter?.();
-
-onMounted?.(() => {
-  // console.log("crudRef", crudRef)
-  dataEditList();
-});
-
-const onSelectedFinish = (selectedValue) => {
-  form.value.associationCode = selectedValue.materialCode;
-  form.value.associationName = selectedValue.materialName;
-  form.value.materialCode = selectedValue.materialCode;
-};
-
-/**
- * 上传excel相关
- */
-const uploadRef = ref(null);
-
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: false,
   viewBtn: false,
   editBtn: false,
   delBtn: false,
+  addBtn: false,
   menu: true,
   column: [
     {
-      label: "图纸编号",
-      prop: "drawingCode",
-      width: 150,
+      label: "订单编号",
+      prop: "orderCode",
       search: true,
       overHidden: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写图纸编号",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "图纸名称",
-      prop: "drawingTitle",
-      width: 150,
+      label: "订单名称",
+      prop: "orderName",
       overHidden: true,
       search: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写图纸名称",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "物料编号",
-      prop: "associationCode",
-      width: 150,
-      search: true,
+      label: "物料编码",
+      prop: "materialCode",
       overHidden: true,
       editDisplay: false,
       addDisplay: false,
-      rules: [
-        {
-          required: true,
-          message: "请填写物料编号",
-          trigger: "blur",
-        },
-      ],
     },
 
     {
-      label: "物料编号",
-      prop: "materialCode",
-      width: 150,
+      label: "物料型号",
+      prop: "materialModel",
       overHidden: true,
       editDisplay: false,
       hide: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写物料编号",
-          trigger: "blur",
-        },
-      ],
-      click() {
-        if (ctableRef.value) {
-          ctableRef.value.startSelect();
-        }
-      },
     },
     {
       label: "物料名称",
-      prop: "associationName",
-      width: 180,
+      prop: "materialName",
       search: true,
       overHidden: true,
       disabled: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写物料名称",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "图纸类型",
-      prop: "drawingDictValue",
+      label: "表格类型",
+      prop: "formType",
       search: true,
       filterable: true,
       type: "select",
-      width: 100,
-      overHidden: true,
-      dicUrl: dictDataUtil.request_url + "drawing_type",
+      dicData: dicts.excel_type,
       props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "状态",
+      prop: "state",
       rules: [
         {
           required: true,
-          message: "请选择图纸类型",
+          message: "请选择文件",
           trigger: "blur",
         },
       ],
+      dicData: [
+        {
+          label: "待发起",
+          value: "0",
+        },
+        {
+          label: "驳回",
+          value: "1",
+        },
+        {
+          label: "审核中",
+          value: "2",
+        },
+        {
+          label: "完成",
+          value: "3",
+        },
+      ],
     },
     {
-      label: "文件",
-      prop: "drawingPath",
-      span: 24,
-      slot: true,
-      hide: true,
+      label: "是否H级",
+      prop: "hOrder",
       rules: [
         {
           required: true,
@@ -239,75 +187,21 @@ option.value = Object.assign(option.value, {
           trigger: "blur",
         },
       ],
-    },
-    {
-      label: "文件名称",
-      prop: "fileName",
-      span: 24,
-      width: 120,
-      overHidden: true,
-      display: false,
-    },
-    {
-      label: "文件数组",
-      prop: "drawingPathList",
-      span: 24,
-      hide: true,
-      display: false,
-    },
-    {
-      label: "pdf数组",
-      prop: "pdfPathList",
-      span: 24,
-      hide: true,
-      display: false,
-    },
-
-    {
-      label: "文件名称数组",
-      prop: "fileNameList",
-      span: 24,
-      slot: true,
-      hide: true,
-      display: false,
-    },
-    /*{ label: "文件",
-      prop: "drawing",
-      type: 'img',
-      span: 24,
-      display:false,
-      slot: true,
-      formatter: (row, column, cellValue, index) => {
-        return import.meta.env.VITE_APP_UPLOAD_URL + `${row.drawingPath}`;} },*/
-    {
-      label: "版本",
-      prop: "drawingVersion",
-      type: "number",
-      precision: 1,
-      min: 0,
-      rules: [
+      dicData: [
         {
-          required: true,
-          message: "版本号不能为空",
-          trigger: "blur",
+          label: "是",
+          value: "1",
+        },
+        {
+          label: "否",
+          value: "0",
         },
       ],
     },
-    {
-      label: "创建时间",
-      prop: "created",
-      width: 120,
-      overHidden: true,
-      display: false,
-    },
-    {
-      label: "启用状态",
-      slot: true,
-      headerAlign: "center",
-      prop: "enable",
-      width: 100,
-      addDisplay: false,
-    },
   ],
 });
+onMounted(() => {
+  search.value.isExamine = "0";
+  dataList();
+});
 </script>

+ 0 - 20
src/views/base/check/apply.vue

@@ -1,20 +0,0 @@
-<template>
-  <div class="body">
-    <div class="line"></div>
-    <div class="form"></div>
-  </div>
-</template>
-<script setup></script>
-<style lang="scss" scoped>
-.body {
-  display: flex;
-
-  .line {
-    width: 200px;
-
-  }
-  .form {
-    width: calc(100% - 120px);
-  }
-}
-</style>

+ 244 - 0
src/views/base/check/check.vue

@@ -0,0 +1,244 @@
+<template>
+  <div class="body">
+    <div class="line">
+      <div class="el-descriptions__title">流程状态</div>
+      <el-timeline style="max-width: 600px; margin-top: 20px">
+        <template v-if="LogList.length > 0">
+          <el-timeline-item
+            v-for="(item, index) in LogList"
+            :key="index"
+            center
+            :timestamp="item.created"
+            placement="top"
+          >
+            <el-card>
+              <h4>阶段:{{ item.positionName }}</h4>
+              <h4>
+                结果:<span
+                  :class="item.examineResult == 1 ? 'green' : 'red'"
+                  >{{ item.examineResult == 1 ? "通过" : "驳回" }}</span
+                >
+              </h4>
+              <p v-if="item.remark">备注:{{ item.remark }}</p>
+              <p>操作人:{{ item.userName }}</p>
+            </el-card>
+          </el-timeline-item>
+        </template>
+        <template v-else>暂无内容</template>
+      </el-timeline>
+    </div>
+    <div class="form">
+      <div class="description">
+        <el-descriptions title="基本信息" border>
+          <el-descriptions-item label="物料编号">{{
+            props.rowData.materialCode
+          }}</el-descriptions-item>
+          <el-descriptions-item label="物料名称">{{
+            props.rowData.materialName
+          }}</el-descriptions-item>
+          <el-descriptions-item label="物料型号">{{
+            props.rowData.materialModel
+          }}</el-descriptions-item>
+          <el-descriptions-item label="订单编号">
+            {{ props.rowData.orderCode }}
+          </el-descriptions-item>
+          <el-descriptions-item label="订单名称">
+            {{ props.rowData.orderName }}
+          </el-descriptions-item>
+          <el-descriptions-item label="订单状态">
+            {{ getStatus(props.rowData.state) }}
+          </el-descriptions-item>
+        </el-descriptions>
+      </div>
+      <div class="el-descriptions__title">提交申请</div>
+      <div class="applyForm" v-if="checkList.length > 0">
+        <template v-for="(item, index) in checkList" :key="item">
+          <el-form :model="item" ref="applyFormRef">
+            <el-row>
+              <el-col :span="12" style="display: flex">
+                <svg-icon
+                  :icon-class="
+                    item.sort == rowData.sort ? 'jiantou' : 'jiantoumr'
+                  "
+                  style="margin-right: 10px"
+                  size="30"
+                />
+                <el-form-item
+                  style="flex: 1; align-items: start"
+                  :label="item.positionName + ':'"
+                  prop="userName"
+                >
+                  <el-select v-model="item.userName" :disabled="true">
+                    <el-option
+                      v-for="items in userList"
+                      :key="items.userName"
+                      :label="items.userName"
+                      :value="items.userName"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item
+                  style="margin-left: 20px"
+                  label="备注:"
+                  v-if="item.remark"
+                  prop="remark"
+                >
+                  {{ item.remark }}
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </template>
+        <el-form :model="checkForm" v-if="!showStatus" ref="checkFormRef">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item
+                label="审核结果:"
+                prop="examineResult"
+                :rules="[{ required: true }]"
+              >
+                <el-select v-model="checkForm.examineResult">
+                  <el-option
+                    v-for="items in checkOption"
+                    :key="items"
+                    :label="items.label"
+                    :value="items.value"
+                  />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-col :span="12">
+            <el-form-item label="备注:" prop="remark">
+              <el-input type="textarea" v-model="checkForm.remark" />
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </div>
+      <div class="btns">
+        <el-button type="primary" @click="submit" v-if="!showStatus"
+          >提交</el-button
+        >
+      </div>
+    </div>
+  </div>
+</template>
+<script setup>
+import { toCheck, logList, examineList, toCheckRes } from "@/api/apply";
+import { getUserList } from "@/api/system/user";
+const props = defineProps({
+  rowData: {
+    type: Object,
+  },
+  //true为查看状态
+  //false为审核状态
+  showStatus: {
+    type: Boolean,
+  },
+});
+
+const emits = defineEmits(["close", "dataList"]);
+const getStatus = (val) => {
+  switch (val) {
+    case "0":
+      return "待发起";
+      break;
+    case "1":
+      return "驳回";
+      break;
+    case "2":
+      return "申请中";
+      break;
+    case "3":
+      return "已完成";
+      break;
+  }
+};
+const applyFormRef = ref([]);
+const checkList = ref([]);
+const userList = ref([]);
+const LogList = ref([]);
+const checkForm = ref({
+  examineResult: 1,
+  remark: "",
+});
+const checkOption = [
+  {
+    label: "通过",
+    value: 1,
+  },
+  {
+    label: "驳回",
+    value: 2,
+  },
+];
+const checkFormRef = ref(null);
+const getlogList = async () => {
+  const { data } = await logList({ excelFormId: props.rowData.id });
+  console.log(data);
+  LogList.value = data;
+};
+const submit = async () => {
+  checkFormRef.value.validate(async (valid, fields) => {
+    if (valid) {
+      const { code } = await toCheckRes({
+        ...checkForm.value,
+        excelFormId: props.rowData.id,
+        sort: props.rowData.sort,
+      });
+      if (code == "200") {
+        ElMessage.success("审核成功!");
+        emits("dataList");
+        emits("close");
+      }
+    } else {
+      ElMessage.error("请检查表达必填项");
+    }
+  });
+};
+const queryUserList = () => {
+  getUserList({}).then((data) => {
+    userList.value = data.data;
+  });
+};
+//获取提交审核后的数据
+const getExamineList = async () => {
+  const { data } = await examineList({ excelFormId: props.rowData.id });
+  checkList.value = data;
+};
+onMounted(async () => {
+  await getlogList();
+  queryUserList();
+  await getExamineList();
+});
+</script>
+<style lang="scss" scoped>
+.green {
+  color: rgb(94, 221, 152);
+}
+.red {
+  color: rgb(255, 106, 106);
+}
+.body {
+  display: flex;
+
+  .line {
+    width: 400px;
+  }
+  .form {
+    width: calc(100% - 400px);
+    padding-left: 20px;
+    .description {
+      margin-bottom: 20px;
+    }
+  }
+  .applyForm {
+    margin: 20px auto;
+    border: 1px solid rgb(235, 238, 245);
+    border-radius: 16px;
+    padding: 20px;
+  }
+}
+</style>

+ 101 - 240
src/views/base/check/index.vue

@@ -7,104 +7,81 @@
       :data="data"
       :option="option"
       v-model:page="page"
-      @row-save="addRow"
-      @row-update="updateRow"
-      @row-del="deleteRow"
       @search-change="searchChange"
       @search-reset="resetChange"
       @size-change="dataList"
       @current-change="dataList"
       @selection-change="selectionChange"
     >
-      <template #drawingPath-form="scope">
-        <!--        <single-upload v-model="form.drawingPath" :generatePdf="true"/>-->
-        <FilesUpload
-          v-model:src-list="srcList"
-          v-model:pdf-list="pdfUrlList"
-          v-model:file-name-list="fileNameList"
-          :limit="10"
-          :generate-pdf="true"
-          @finished="testFiles"
-        />
-      </template>
-      <template #enable="scope">
-        <el-switch
-          active-value="1"
-          inactive-value="0"
-          inline-prompt
-          active-text="启用"
-          inactive-text="禁用"
-          v-model="scope.row.enable"
-          @click="changeItem(scope.row)"
-          class="ml-2"
-          style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
-        />
-      </template>
       <template #menu="{ row, index, type }">
-        <PDFView
-          :need-to-show-pdf="true"
-          content-type="button"
-          :is-link="true"
-          :pdf-source="filePath + row.pdfPath"
-        />
-        <el-button @click="deleteRecord(row, index, done)" text type="primary"
-          >删除</el-button
+        <el-button
+          @click="checkApply(row)"
+          v-if="row.state == '2'"
+          text
+          type="primary"
+          >处理</el-button
+        >
+        <el-button
+          @click="showApply(row)"
+          v-if="row.state != '0'"
+          text
+          type="primary"
+          >查看</el-button
         >
       </template>
     </avue-crud>
-
-    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
-  <CommonTable
-    ref="ctableRef"
-    tableTitle="BOM添加"
-    tableType="MARTERIAL"
-    @selected-sure="onSelectedFinish"
-  />
+  <el-dialog
+    v-model="dialog.visible"
+    :title="dialog.title"
+    width="80%"
+    @close="dialog.visible = false"
+  >
+    <Check
+      :rowData="rowData"
+      @close="dialog.visible = false"
+      :showStatus
+      @data-list="getList"
+      :key="checkKey"
+    />
+  </el-dialog>
 </template>
-<script setup lang="ts">
+<script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import { useCommonStoreHook, useDictionaryStore } from "@/store";
-import { updateDrawaing } from "@/api/drawing";
 import dictDataUtil from "@/common/configs/dictDataUtil";
-import PDFView from "@/components/PDFView/index.vue";
+import Check from "./check.vue";
+const checkKey = ref(false);
+const getList = () => {
+  dataList();
+};
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 // 数据字典相关
 const { dicts } = useDictionaryStore();
-const fileUrl = ref(""); //单文件
-const pdfUrlList = ref([]);
-const srcList = ref([]);
-const fileNameList = ref([]);
-const testFiles = () => {
-  form.value.pdfPathList = pdfUrlList.value;
-  form.value.drawingPathList = srcList.value;
-  form.value.drawingPath = srcList.value[0];
-  form.value.fileNameList = fileNameList.value;
-};
-const filePath = import.meta.env.VITE_APP_UPLOAD_URL;
-const test = () => {
-  isShowTable.value = true;
-  tableType.value = tableType.value == 1 ? 2 : 1;
+const rowData = ref({});
+const showStatus = ref(false);
+const checkApply = (row) => {
+  checkKey.value = !checkKey.value;
+  rowData.value = row;
+  showStatus.value = false;
+  dialog.value.visible = true;
 };
-const ctableRef = ref(null);
-const changeItem = (row) => {
-  updateDrawaing(row).then(() => {
-    ElMessage.success("操作成功");
-    dataList();
-  });
-};
-const form2 = ref(null);
-const addRow = (form2, done) => {
-  createRow(form, done, done);
-  pdfUrlList.value = [];
-  srcList.value = [];
-  fileNameList.value = [];
+const showApply = (row) => {
+  checkKey.value = !checkKey.value;
+  rowData.value = row;
+  showStatus.value = true;
+  dialog.value.visible = true;
 };
+const dialog = ref({
+  visible: false,
+  title: "归档申请",
+});
+
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
-    src: "/api/v1/base/drawing",
+    src: "/api/v1/ProcessFormData/examine",
   });
 const {
   dataEditList,
@@ -117,150 +94,93 @@ const {
 } = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
-// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
-// 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 crudRef = ref(null); //crudRef.value 获取avue-crud对象
-const router = useRouter?.();
-
-onMounted?.(() => {
-  // console.log("crudRef", crudRef)
-  dataEditList();
-});
-
-const onSelectedFinish = (selectedValue) => {
-  form.value.associationCode = selectedValue.materialCode;
-  form.value.associationName = selectedValue.materialName;
-  form.value.materialCode = selectedValue.materialCode;
-};
-
-/**
- * 上传excel相关
- */
-const uploadRef = ref(null);
-const uploadFinished = () => {
-  // 上传完成后的刷新操作
-  page.currentPage = 1;
-  dataEditList();
-};
-
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: false,
   viewBtn: false,
   editBtn: false,
   delBtn: false,
+  addBtn: false,
   menu: true,
   column: [
     {
-      label: "图纸编号",
-      prop: "drawingCode",
-      width: 150,
+      label: "订单编号",
+      prop: "orderCode",
       search: true,
       overHidden: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写图纸编号",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "图纸名称",
-      prop: "drawingTitle",
-      width: 150,
+      label: "订单名称",
+      prop: "orderName",
       overHidden: true,
       search: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写图纸名称",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "物料编号",
-      prop: "associationCode",
-      width: 150,
-      search: true,
+      label: "物料编码",
+      prop: "materialCode",
       overHidden: true,
       editDisplay: false,
       addDisplay: false,
-      rules: [
-        {
-          required: true,
-          message: "请填写物料编号",
-          trigger: "blur",
-        },
-      ],
     },
 
     {
-      label: "物料编号",
-      prop: "materialCode",
-      width: 150,
+      label: "物料型号",
+      prop: "materialModel",
       overHidden: true,
       editDisplay: false,
       hide: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写物料编号",
-          trigger: "blur",
-        },
-      ],
-      click() {
-        if (ctableRef.value) {
-          ctableRef.value.startSelect();
-        }
-      },
     },
     {
       label: "物料名称",
-      prop: "associationName",
-      width: 180,
+      prop: "materialName",
       search: true,
       overHidden: true,
       disabled: true,
-      rules: [
-        {
-          required: true,
-          message: "请填写物料名称",
-          trigger: "blur",
-        },
-      ],
     },
     {
-      label: "图纸类型",
-      prop: "drawingDictValue",
+      label: "表格类型",
+      prop: "formType",
       search: true,
       filterable: true,
       type: "select",
-      width: 100,
-      overHidden: true,
-      dicUrl: dictDataUtil.request_url + "drawing_type",
+      dicData: dicts.excel_type,
       props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "状态",
+      prop: "state",
+
       rules: [
         {
           required: true,
-          message: "请选择图纸类型",
+          message: "请选择文件",
           trigger: "blur",
         },
       ],
+      dicData: [
+        {
+          label: "待发起",
+          value: "0",
+        },
+        {
+          label: "驳回",
+          value: "1",
+        },
+        {
+          label: "审核中",
+          value: "2",
+        },
+        {
+          label: "完成",
+          value: "3",
+        },
+      ],
     },
     {
-      label: "文件",
-      prop: "drawingPath",
-      span: 24,
-      slot: true,
-      hide: true,
+      label: "是否H级",
+      prop: "hOrder",
       rules: [
         {
           required: true,
@@ -268,80 +188,21 @@ option.value = Object.assign(option.value, {
           trigger: "blur",
         },
       ],
-    },
-    {
-      label: "文件名称",
-      prop: "fileName",
-      span: 24,
-      width: 120,
-      overHidden: true,
-      display: false,
-    },
-    {
-      label: "文件数组",
-      prop: "drawingPathList",
-      span: 24,
-      hide: true,
-      display: false,
-    },
-    {
-      label: "pdf数组",
-      prop: "pdfPathList",
-      span: 24,
-      hide: true,
-      display: false,
-    },
-
-    {
-      label: "文件名称数组",
-      prop: "fileNameList",
-      span: 24,
-      slot: true,
-      hide: true,
-      display: false,
-    },
-    /*{ label: "文件",
-      prop: "drawing",
-      type: 'img',
-      span: 24,
-      display:false,
-      slot: true,
-      formatter: (row, column, cellValue, index) => {
-        return import.meta.env.VITE_APP_UPLOAD_URL + `${row.drawingPath}`;} },*/
-    {
-      label: "版本",
-      prop: "drawingVersion",
-      type: "number",
-      precision: 1,
-      min: 0,
-      rules: [
+      dicData: [
         {
-          required: true,
-          message: "版本号不能为空",
-          trigger: "blur",
+          label: "是",
+          value: "1",
+        },
+        {
+          label: "否",
+          value: "0",
         },
       ],
     },
-    {
-      label: "创建时间",
-      prop: "created",
-      width: 120,
-      overHidden: true,
-      display: false,
-    },
-    {
-      label: "启用状态",
-      slot: true,
-      headerAlign: "center",
-      prop: "enable",
-      width: 100,
-      addDisplay: false,
-    },
   ],
 });
-
-const deleteRecord = (row, index, done) => {
-  deleteRow(row, index, done);
-  dataEditList();
-};
+onMounted(() => {
+  search.value.isExamine = "1";
+  dataList();
+});
 </script>

+ 10 - 13
src/views/storage/semi/index.vue

@@ -109,6 +109,7 @@ const selectId = ref(null);
 const materialInfo1 = (value) => {
   if (form.value.stockType == "1") {
     form.value.inWorkOrderId = value.workOrderCode;
+    form.value.outWorkOrderId = "-";
   } else if (form.value.stockType == "2") {
     form.value.outWorkOrderId = value.workOrderCode;
   }
@@ -123,6 +124,12 @@ const materialInfo2 = (value) => {
 const seqDisabled = computed(() => {
   return !form.value.workOrderId;
 });
+const displayIn = computed(() => {
+  return form.value.stockType == "2" || !form.value.stockType;
+});
+const displayOut = computed(() => {
+  return form.value.stockType == "1" || !form.value.stockType;
+});
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   delBtn: false,
@@ -167,7 +174,6 @@ option.value = Object.assign(option.value, {
         },
       ],
     },
-
     {
       label: "出库/入库数量",
       prop: "operateNum",
@@ -185,6 +191,7 @@ option.value = Object.assign(option.value, {
       label: "出入库类型",
       prop: "stockType",
       editDisabled: true,
+
       addDisplay: true,
       rules: [
         {
@@ -203,23 +210,13 @@ option.value = Object.assign(option.value, {
           value: "2",
         },
       ],
-      control: (val, form) => {
-        return {
-          inWorkOrderId: {
-            display: val == "1",
-          },
-          outWorkOrderId: {
-            display: val == "2",
-          },
-        };
-      },
     },
     {
       label: "入库工单",
       prop: "inWorkOrderId",
       editDisabled: true,
+      disabled: displayIn,
       display: true,
-      addDisplay: false,
       rules: [
         {
           required: true,
@@ -242,8 +239,8 @@ option.value = Object.assign(option.value, {
       label: "出库工单",
       prop: "outWorkOrderId",
       editDisabled: true,
-      addDisplay: false,
       display: true,
+      disabled: displayOut,
       rules: [
         {
           required: true,