Browse Source

新需求

cz 1 năm trước cách đây
mục cha
commit
cfa62392f1

+ 112 - 0
src/components/PDF/productDemandPDF.vue

@@ -0,0 +1,112 @@
+<template>
+  <div>
+    <div id="pdfDom" ref="pdfDom" style="font-family: 'msyh'">
+      <div>
+        <div class="title">双拓科技有限公司</div>
+        <div class="titleTwo">产品要求单</div>
+        <div
+          style="
+            display: flex;
+            justify-content: space-between;
+            margin-bottom: 10px;
+          "
+        >
+          <div>签单日期:{{ pdfData.contractCreateTime }}</div>
+          <div>交货日期:{{ pdfData.contractDeliveryDate }}</div>
+        </div>
+        <table border="1" style="width: 100%" class="table">
+          <tr>
+            <td style="width: 20%">产品名称</td>
+            <td colspan="3">{{ pdfData.productName }}</td>
+          </tr>
+          <tr>
+            <td>机型</td>
+            <td style="width: 50%">{{ pdfData.productSpec }}</td>
+            <td style="width: 10%">数量</td>
+            <td style="width: 20%">{{ pdfData.productionQuantity }}</td>
+          </tr>
+
+          <tr>
+            <td>
+              <div>产<br /><br /></div>
+              <div>品<br /><br /></div>
+              <div>要<br /><br /></div>
+              <div>求</div>
+            </td>
+            <td colspan="3" style="vertical-align: top; text-align: left">
+              {{ pdfData.contractProductRemark }}
+            </td>
+          </tr>
+        </table>
+        <div
+          style="
+            display: flex;
+            justify-content: space-between;
+            margin-top: 10px;
+          "
+        >
+          <div>业务员:</div>
+          <div>地址:</div>
+        </div>
+        <div style="margin-top: 30px; height: 1px; background: #000"></div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+const { proxy } = getCurrentInstance();
+const pdfData = ref({});
+const props = defineProps({
+  rowData: Object,
+});
+
+const handlePrintPdf = (row) => {
+  proxy.post("/workOrder/detail", { id: row.id }).then((res) => {
+    console.log(res, "ada");
+
+    pdfData.value = res;
+  });
+};
+
+if (props.rowData && props.rowData.id) {
+  handlePrintPdf(props.rowData);
+}
+
+watch(
+  () => props.rowData.id,
+  (val) => {
+    if (props.rowData && props.rowData.id) {
+      handlePrintPdf(props.rowData);
+    }
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+#pdfDom {
+  font-size: 14px;
+  color: #000000;
+  // padding: 30px 30px;
+  .title {
+    font-size: 25px;
+    font-weight: 700;
+    margin-bottom: 20px;
+    text-align: center;
+    letter-spacing: 10px;
+  }
+  .titleTwo {
+    font-size: 20px;
+    margin-bottom: 20px;
+    text-align: center;
+  }
+  .table {
+    border-collapse: collapse;
+    border-spacing: 0;
+    td {
+      text-align: center;
+      padding: 5px 10px;
+    }
+  }
+}
+</style>

+ 28 - 28
src/components/PDF/productionPDF.vue

@@ -6,21 +6,24 @@
         <table border="1" style="width: 100%" class="table">
           <tr>
             <td style="width: 20%">项目名称</td>
-            <td style="width: 30%"></td>
+            <td style="width: 30%">{{ pdfData.productName }}</td>
             <td style="width: 20%">日期</td>
-            <td style="width: 30%"></td>
+            <td style="width: 30%">{{ pdfData.endCompleteTime }}</td>
           </tr>
           <tr>
             <td>规格</td>
-            <td></td>
+            <td>{{ pdfData.productSpec }}</td>
             <td>数量</td>
-            <td></td>
+            <td>1</td>
           </tr>
-          <tr v-for="item in 3" :key="item">
-            <td>工序{{ item }}开始</td>
-            <td></td>
-            <td>工序{{ item }}结束</td>
-            <td></td>
+          <tr
+            v-for="item in pdfData.productionTaskDetailRecordList"
+            :key="item.id"
+          >
+            <td>{{ item.productionProcessesName }}开始</td>
+            <td>{{ item.receivedTime }}</td>
+            <td>{{ item.productionProcessesName }}结束</td>
+            <td>{{ item.createTime }}</td>
           </tr>
           <tr>
             <td>
@@ -29,24 +32,26 @@
               <div>要<br /><br /></div>
               <div>求</div>
             </td>
-            <td colspan="3"></td>
+            <td colspan="3" style="vertical-align: top; text-align: left">
+              {{ pdfData.productRemark }}
+            </td>
           </tr>
           <tr>
             <td>机型编号</td>
-            <td></td>
+            <td>{{ pdfData.productSn }}</td>
             <td>合格入库</td>
-            <td></td>
+            <td>{{ pdfData.endCompleteTime }}</td>
           </tr>
           <tr>
             <td>入库时间</td>
             <td></td>
             <td>交货时间</td>
-            <td></td>
+            <td>{{ pdfData.contractDeliveryDate }}</td>
           </tr>
           <tr>
             <td>发货确认</td>
             <td></td>
-            <td>仓库时间</td>
+            <td>仓库确认</td>
             <td></td>
           </tr>
         </table>
@@ -63,21 +68,16 @@ const props = defineProps({
 });
 
 const handlePrintPdf = (row) => {
-  proxy.post("/salesContract/detail", { id: row.id }).then((res) => {
+  proxy.post("/productionTaskDetail/detail", { id: row.id }).then((res) => {
     console.log(res, "ada");
-    if (res.customerUserList && res.customerUserList.length > 0) {
-      let data = res.customerUserList[0];
-      if (data.contactJson) {
-        data.contactJson = JSON.parse(data.contactJson);
-        const current = data.contactJson.find((x) => x.type == "mobile");
-        const currentPhone = data.contactJson.find((x) => x.type == "phone");
-        if (current && current.contactNo) {
-          res.contactNo = current.contactNo;
-        }
-        if (currentPhone && currentPhone.contactNo) {
-          res.contactPhoneNo = currentPhone.contactNo;
-        }
-      }
+    res.productionTaskDetailRecordList =
+      res.productionTaskDetailRecordList.reverse();
+    res.endCompleteTime =
+      res.productionTaskDetailRecordList[
+        res.productionTaskDetailRecordList.length - 1
+      ].createTime;
+    if (!res.contractDeliveryDate) {
+      res.contractDeliveryDate = "库存";
     }
     pdfData.value = res;
   });

+ 28 - 11
src/permission.js

@@ -1,17 +1,27 @@
 import router from './router'
-import { ElMessage } from 'element-plus'
+import {
+  ElMessage
+} from 'element-plus'
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
-import { getToken } from '@/utils/auth'
-import { isHttp } from '@/utils/validate'
-import { isRelogin } from '@/utils/request'
+import {
+  getToken
+} from '@/utils/auth'
+import {
+  isHttp
+} from '@/utils/validate'
+import {
+  isRelogin
+} from '@/utils/request'
 import useUserStore from '@/store/modules/user'
 import useSettingsStore from '@/store/modules/settings'
 import usePermissionStore from '@/store/modules/permission'
 
-NProgress.configure({ showSpinner: false });
-
-const whiteList = ['/login', '/register'];
+NProgress.configure({
+  showSpinner: false
+});
+// 配置白名单
+const whiteList = ['/login', '/register', '/jxst/pro/qrDetails'];
 
 router.beforeEach((to, from, next) => {
   NProgress.start()
@@ -19,7 +29,9 @@ router.beforeEach((to, from, next) => {
     to.meta.title && useSettingsStore().setTitle(to.meta.title)
     /* has token*/
     if (to.path === '/login') {
-      next({ path: '/' })
+      next({
+        path: '/'
+      })
       NProgress.done()
     } else {
       if (useUserStore().roles.length === 0) {
@@ -34,12 +46,17 @@ router.beforeEach((to, from, next) => {
                 router.addRoute(route) // 动态添加可访问路由表
               }
             })
-            next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
+            next({
+              ...to,
+              replace: true
+            }) // hack方法 确保addRoutes已完成
           })
         }).catch(err => {
           useUserStore().logOut().then(() => {
             ElMessage.error(err)
-            next({ path: '/' })
+            next({
+              path: '/'
+            })
           })
         })
       } else {
@@ -60,4 +77,4 @@ router.beforeEach((to, from, next) => {
 
 router.afterEach(() => {
   NProgress.done()
-})
+})

+ 81 - 59
src/router/index.js

@@ -1,4 +1,7 @@
-import { createWebHistory, createRouter } from "vue-router";
+import {
+  createWebHistory,
+  createRouter
+} from "vue-router";
 /* Layout */
 import Layout from "@/layout";
 
@@ -25,17 +28,14 @@ import Layout from "@/layout";
  */
 
 // 公共路由
-export const constantRoutes = [
-  {
+export const constantRoutes = [{
     path: "/redirect",
     component: Layout,
     hidden: true,
-    children: [
-      {
-        path: "/redirect/:path(.*)",
-        component: () => import("@/views/redirect/index.vue"),
-      },
-    ],
+    children: [{
+      path: "/redirect/:path(.*)",
+      component: () => import("@/views/redirect/index.vue"),
+    }, ],
   },
   {
     path: "/login",
@@ -57,23 +57,37 @@ export const constantRoutes = [
     component: () => import("@/views/error/401"),
     hidden: true,
   },
+  // 二维码详情页面,白名单的页面
+  {
+    path: "/jxst/pro/qrDetails",
+    component: () => import("@/views/JXSK/production/qrDetails/index"),
+    hidden: false,
+  },
   {
     path: "",
     component: Layout,
     redirect: "/index",
-    children: [
-      {
+    children: [{
         path: "/index",
         component: () => import("@/views/index"),
         name: "Index",
-        meta: { title: "首页", icon: "dashboard", affix: true },
+        meta: {
+          title: "首页",
+          icon: "dashboard",
+          affix: true
+        },
       },
       {
         path: "/platform_manage/process/processApproval",
         component: () => import("@/views/process/processApproval/index.vue"),
         name: "ProcessApproval",
-        meta: { title: "流程审批", icon: "dashboard", affix: false },
+        meta: {
+          title: "流程审批",
+          icon: "dashboard",
+          affix: false
+        },
       },
+
     ],
   },
   {
@@ -81,87 +95,93 @@ export const constantRoutes = [
     component: Layout,
     hidden: true,
     redirect: "noredirect",
-    children: [
-      {
-        path: "profile",
-        component: () => import("@/views/system/user/profile/index"),
-        name: "Profile",
-        meta: { title: "个人中心", icon: "user" },
+    children: [{
+      path: "profile",
+      component: () => import("@/views/system/user/profile/index"),
+      name: "Profile",
+      meta: {
+        title: "个人中心",
+        icon: "user"
       },
-    ],
+    }, ],
   },
+
 ];
 // 动态路由,基于用户权限动态去加载
-export const dynamicRoutes = [
-  {
+export const dynamicRoutes = [{
     path: "/system/user-auth",
     component: Layout,
     hidden: true,
     permissions: ["system:user:edit"],
-    children: [
-      {
-        path: "role/:userId(\\d+)",
-        component: () => import("@/views/system/user/authRole"),
-        name: "AuthRole",
-        meta: { title: "分配角色", activeMenu: "/system/user" },
+    children: [{
+      path: "role/:userId(\\d+)",
+      component: () => import("@/views/system/user/authRole"),
+      name: "AuthRole",
+      meta: {
+        title: "分配角色",
+        activeMenu: "/system/user"
       },
-    ],
+    }, ],
   },
   {
     path: "/system/role-auth",
     component: Layout,
     hidden: true,
     permissions: ["system:role:edit"],
-    children: [
-      {
-        path: "user/:roleId(\\d+)",
-        component: () => import("@/views/system/role/authUser"),
-        name: "AuthUser",
-        meta: { title: "分配用户", activeMenu: "/system/role" },
+    children: [{
+      path: "user/:roleId(\\d+)",
+      component: () => import("@/views/system/role/authUser"),
+      name: "AuthUser",
+      meta: {
+        title: "分配用户",
+        activeMenu: "/system/role"
       },
-    ],
+    }, ],
   },
   {
     path: "/system/dict-data",
     component: Layout,
     hidden: true,
     permissions: ["system:dict:list"],
-    children: [
-      {
-        path: "index/:dictId(\\d+)",
-        component: () => import("@/views/system/dict/data"),
-        name: "Data",
-        meta: { title: "字典数据", activeMenu: "/system/dict" },
+    children: [{
+      path: "index/:dictId(\\d+)",
+      component: () => import("@/views/system/dict/data"),
+      name: "Data",
+      meta: {
+        title: "字典数据",
+        activeMenu: "/system/dict"
       },
-    ],
+    }, ],
   },
   {
     path: "/monitor/job-log",
     component: Layout,
     hidden: true,
     permissions: ["monitor:job:list"],
-    children: [
-      {
-        path: "index/:jobId(\\d+)",
-        component: () => import("@/views/monitor/job/log"),
-        name: "JobLog",
-        meta: { title: "调度日志", activeMenu: "/monitor/job" },
+    children: [{
+      path: "index/:jobId(\\d+)",
+      component: () => import("@/views/monitor/job/log"),
+      name: "JobLog",
+      meta: {
+        title: "调度日志",
+        activeMenu: "/monitor/job"
       },
-    ],
+    }, ],
   },
   {
     path: "/tool/gen-edit",
     component: Layout,
     hidden: true,
     permissions: ["tool:gen:edit"],
-    children: [
-      {
-        path: "index/:tableId(\\d+)",
-        component: () => import("@/views/tool/gen/editTable"),
-        name: "GenEdit",
-        meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
+    children: [{
+      path: "index/:tableId(\\d+)",
+      component: () => import("@/views/tool/gen/editTable"),
+      name: "GenEdit",
+      meta: {
+        title: "修改生成配置",
+        activeMenu: "/tool/gen"
       },
-    ],
+    }, ],
   },
 ];
 
@@ -172,9 +192,11 @@ const router = createRouter({
     if (savedPosition) {
       return savedPosition;
     } else {
-      return { top: 0 };
+      return {
+        top: 0
+      };
     }
   },
 });
 
-export default router;
+export default router;

+ 100 - 11
src/views/JXSK/production/forward/index.vue

@@ -79,18 +79,59 @@
           </div>
         </template>
         <template #fileOne>
-          <div style="width: 100%">
-            <el-upload
-              v-model:fileList="formData.data.fileListOne"
-              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-              :data="uploadData"
-              multiple
-              :before-upload="uploadFile"
-              :on-preview="onPreviewFile"
+          <div
+            style="width: 100%"
+            v-if="
+              formData.data.fileListOne && formData.data.fileListOne.length > 0
+            "
+          >
+            <span
+              v-for="item in formData.data.fileListOne"
+              :key="item.id"
+              @click="onPreviewFile(item)"
+              style="margin-right: 10px; cursor: pointer; color: #409eff"
             >
-              <el-button disabled>选择</el-button>
-            </el-upload>
+              {{ item.name }}
+            </span>
           </div>
+          <div style="width: 100%" v-else>无</div>
+        </template>
+        <template #fileTwo>
+          <div
+            style="width: 100%"
+            v-if="
+              formData.data.fileListTwo && formData.data.fileListTwo.length > 0
+            "
+          >
+            <span
+              v-for="item in formData.data.fileListTwo"
+              :key="item.id"
+              @click="onPreviewFile(item)"
+              style="margin-right: 10px; cursor: pointer; color: #409eff"
+            >
+              {{ item.name }}
+            </span>
+          </div>
+          <div style="width: 100%" v-else>无</div>
+        </template>
+        <template #fileThree>
+          <div
+            style="width: 100%"
+            v-if="
+              formData.data.fileListThree &&
+              formData.data.fileListThree.length > 0
+            "
+          >
+            <span
+              v-for="item in formData.data.fileListThree"
+              :key="item.id"
+              @click="onPreviewFile(item)"
+              style="margin-right: 10px; cursor: pointer; color: #409eff"
+            >
+              {{ item.name }}
+            </span>
+          </div>
+          <div style="width: 100%" v-else>无</div>
         </template>
       </byForm>
       <template #footer>
@@ -299,6 +340,16 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
+      slotName: "fileTwo",
+      label: "工序附件",
+    },
+    {
+      type: "slot",
+      slotName: "fileThree",
+      label: "工单附件",
+    },
+    {
+      type: "slot",
       slotName: "file",
       label: "工序图纸",
     },
@@ -425,6 +476,7 @@ const submitType = ref("");
 const submitText = ref("");
 const printData = ref({});
 const getDtl = (row) => {
+  console.log(row, "asdasd");
   if (
     row.nextProductionProcessesId == "" ||
     row.nextProductionProcessesId == "-1"
@@ -462,7 +514,7 @@ const getDtl = (row) => {
       res.productionTaskDetailRecordList &&
       res.productionTaskDetailRecordList.length > 0
     ) {
-      let id = res.productionTaskDetailRecordList[0].id;
+      let id = res.previousProcessesRecordId;
       proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
         if (res[id] && res[id].length > 0) {
           formData.data.fileListOne = res[id].map((item) => {
@@ -475,6 +527,43 @@ const getDtl = (row) => {
         }
       });
     }
+    proxy
+      .post("/fileInfo/getList", {
+        businessIdList: [res.productionProcessesId],
+      })
+      .then((resOne) => {
+        if (
+          resOne[res.productionProcessesId] &&
+          resOne[res.productionProcessesId].length > 0
+        ) {
+          formData.data.fileListTwo = resOne[res.productionProcessesId].map(
+            (item) => {
+              return {
+                raw: item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            }
+          );
+        }
+      });
+
+    proxy
+      .post("/fileInfo/getList", {
+        businessIdList: [res.workOrderId],
+        fileType: 1,
+      })
+      .then((resOne) => {
+        if (resOne[res.workOrderId] && resOne[res.workOrderId].length > 0) {
+          formData.data.fileListThree = resOne[res.workOrderId].map((item) => {
+            return {
+              raw: item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          });
+        }
+      });
   });
 };
 

+ 351 - 0
src/views/JXSK/production/qrDetails/index.vue

@@ -0,0 +1,351 @@
+<template>
+  <div style="width: 100vw; height: 100vh">
+    <div style="text-align: center; padding: 40px">
+      <el-card class="box-card" @click="printDialog = true">
+        <div
+          style="
+            cursor: pointer;
+            height: 40vh;
+            line-height: 40vh;
+            font-size: 25px;
+          "
+        >
+          工单详情
+        </div>
+      </el-card>
+      <el-card class="box-card" @click="handleAdd" style="margin-top: 20px">
+        <div
+          style="
+            cursor: pointer;
+            height: 40vh;
+            line-height: 40vh;
+            font-size: 25px;
+          "
+        >
+          添加售后
+        </div>
+      </el-card>
+    </div>
+
+    <el-dialog
+      title="登录"
+      v-if="printDialog"
+      v-model="printDialog"
+      :width="width"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        ref="loginRef"
+        :model="loginForm"
+        :rules="loginRules"
+        v-loading="loading"
+      >
+        <div class="form">
+          <el-form-item prop="username">
+            <el-input
+              v-model="loginForm.username"
+              placeholder="账号"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="password">
+            <el-input
+              v-model="loginForm.password"
+              placeholder="密码"
+              type="password"
+            ></el-input>
+          </el-form-item>
+        </div>
+      </el-form>
+
+      <template #footer>
+        <el-button @click="printDialog = false" size="large">取 消</el-button>
+        <el-button @click="login" type="primary" size="large">登 录</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      title="工单详情"
+      v-if="detailsDialog"
+      v-model="detailsDialog"
+      :width="width"
+      :close-on-click-modal="false"
+    >
+      <TitleInfo content="客户信息"></TitleInfo>
+      <div style="padding-left: 20px; margin: 10px 0">
+        客户名称:{{ detailsData.customerName }}
+      </div>
+
+      <TitleInfo content="产品信息"></TitleInfo>
+      <div style="padding-left: 20px; margin-top: 10px">
+        产品名称:{{ detailsData.productName }}({{ detailsData.productSpec }})
+      </div>
+      <div style="padding-left: 20px; margin-bottom: 10px">
+        产品Sn:{{ detailsData.productSn }}
+      </div>
+
+      <TitleInfo content="生产信息"></TitleInfo>
+      <div
+        v-for="(item, index) in detailsData.productionTaskDetailRecordList"
+        :key="item.id"
+        style="margin-top: 10px; margin-bottom: 20px; padding-left: 20px"
+      >
+        <div>工序名称: {{ item.productionProcessesName }}</div>
+        <div>工序开始时间: {{ item.receivedTime }}</div>
+        <div>工序结束时间: {{ item.createTime }}</div>
+      </div>
+
+      <template #footer>
+        <el-button @click="detailsDialog = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      title="售后"
+      v-if="afterSalesDialog"
+      v-model="afterSalesDialog"
+      :width="width"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        ref="afterSalesRef"
+        :model="afterSalesForm"
+        :rules="afterSalesRules"
+        v-loading="loading"
+        label-width="80px"
+      >
+        <div class="form">
+          <TitleInfo content="产品信息"></TitleInfo>
+          <el-form-item prop="productSn" label="产品Sn">
+            <el-input
+              v-model="afterSalesForm.productSn"
+              placeholder=" "
+              disabled
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            prop="productName"
+            label="产品名称"
+            style="margin-top: 20px"
+          >
+            <el-input
+              v-model="afterSalesForm.productName"
+              placeholder=" "
+              disabled
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            prop="productSpec"
+            label="规格型号"
+            style="margin-top: 20px"
+          >
+            <el-input
+              v-model="afterSalesForm.productSpec"
+              placeholder=""
+              disabled
+            ></el-input>
+          </el-form-item>
+          <TitleInfo content="售后信息"></TitleInfo>
+          <el-form-item prop="type" label="售后类型" style="margin-top: 20px">
+            <el-select
+              v-model="afterSalesForm.type"
+              placeholder="请选择售后类型"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in afterSaleType"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="contactName" label="联系人">
+            <el-input
+              v-model="afterSalesForm.contactName"
+              placeholder="请输入联系人"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="contactInfo" label="联系方式">
+            <el-input
+              v-model="afterSalesForm.contactInfo"
+              placeholder="请输入联系方式"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="remark" label="售后说明">
+            <el-input
+              v-model="afterSalesForm.remark"
+              placeholder="请输入售后说明"
+              type="textarea"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="fileList" label="售后附件">
+            <div style="width: 100%">
+              <el-upload
+                v-model:fileList="afterSalesForm.fileList"
+                action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+                :data="uploadData"
+                multiple
+                :before-upload="uploadFile"
+                :on-preview="onPreviewFile"
+              >
+                <el-button>选择</el-button>
+              </el-upload>
+            </div>
+          </el-form-item>
+        </div>
+      </el-form>
+
+      <template #footer>
+        <el-button @click="afterSalesDialog = false" size="large"
+          >取 消</el-button
+        >
+        <el-button @click="submit" type="primary" size="large"
+          >提交售后</el-button
+        >
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import TitleInfo from "@/components/TitleInfo/index.vue";
+import useUserStore from "@/store/modules/user";
+import request from "@/utils/request";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const userStore = useUserStore();
+const route = useRoute();
+const width = ref(200);
+width.value = (window.innerWidth || document.documentElement.clientWidth) - 80;
+const { proxy } = getCurrentInstance();
+const printDialog = ref(false);
+const loading = ref(false);
+const loginForm = ref({
+  tenantId: "jxsttest",
+  username: "",
+  password: "",
+});
+const loginRules = {
+  username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
+  password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
+};
+const detailsDialog = ref(false);
+const detailsData = ref({});
+const login = () => {
+  proxy.$refs.loginRef.validate((valid) => {
+    if (valid) {
+      loading.value = true;
+      userStore
+        .login(loginForm.value)
+        .then(() => {
+          loading.value = false;
+          detailsDialog.value = true;
+          proxy
+            .post("/productionTaskDetail/snInfo", {
+              productSn: route.query.productSn,
+            })
+            .then((res) => {
+              printDialog.value = false;
+              detailsData.value = res;
+            });
+        })
+        .catch(() => {
+          loading.value = false;
+        });
+    }
+  });
+};
+const afterSalesDialog = ref(false);
+const afterSalesForm = ref({});
+const afterSalesRules = {
+  type: [{ required: true, trigger: "change", message: "请选择售后类型" }],
+  remark: [{ required: true, trigger: "blur", message: "请输入售后说明" }],
+  contactName: [{ required: true, trigger: "blur", message: "请输入联系人" }],
+  contactInfo: [{ required: true, trigger: "blur", message: "请输入联系方式" }],
+};
+const afterSaleType = ref([]);
+const otherData = ref({});
+const getDict = () => {
+  request({
+    url: "/open/afterSales/afterSalesTypeList",
+    headers: {
+      isToken: false,
+    },
+    method: "get",
+  }).then((res) => {
+    afterSaleType.value = res.data.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+  request({
+    url: "/open/afterSales/snInfo",
+    headers: {
+      isToken: false,
+    },
+    method: "post",
+    data: {
+      productSn: route.query.productSn,
+    },
+  }).then((res) => {
+    otherData.value = res.data;
+  });
+};
+getDict();
+const handleAdd = () => {
+  afterSalesForm.value = {
+    productSn: otherData.value.productSn,
+    productName: otherData.value.productName,
+    productSpec: otherData.value.productSpec,
+    fileList: [],
+  };
+  afterSalesDialog.value = true;
+};
+const submit = () => {
+  proxy.$refs.afterSalesRef.validate((valid) => {
+    if (valid) {
+      loading.value = true;
+      afterSalesForm.value.fileList = afterSalesForm.value.fileList.map(
+        (x) => x.raw
+      );
+      request({
+        url: "/open/afterSales/add",
+        headers: {
+          isToken: false,
+        },
+        method: "post",
+        data: afterSalesForm.value,
+      }).then((res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        loading.value = false;
+        afterSalesDialog.value = false;
+      });
+    }
+  });
+};
+const uploadData = ref({});
+const uploadFile = async (file) => {
+  const res = await request({
+    url: "/open/afterSales/fileInfo/getSing",
+    headers: {
+      isToken: false,
+    },
+    method: "post",
+    data: { fileName: file.name },
+  });
+  uploadData.value = res.data.uploadBody;
+  file.id = res.data.id;
+  file.fileName = res.data.fileName;
+  file.fileUrl = res.data.fileUrl;
+  return true;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 88 - 3
src/views/JXSK/production/receive/index.vue

@@ -42,6 +42,43 @@
             </el-upload>
           </div>
         </template>
+        <template #fileTwo>
+          <div
+            style="width: 100%"
+            v-if="
+              formData.data.fileListTwo && formData.data.fileListTwo.length > 0
+            "
+          >
+            <span
+              v-for="item in formData.data.fileListTwo"
+              :key="item.id"
+              @click="onPreviewFile(item)"
+              style="margin-right: 10px; cursor: pointer; color: #409eff"
+            >
+              {{ item.name }}
+            </span>
+          </div>
+          <div v-else>无</div>
+        </template>
+        <template #fileThree>
+          <div
+            style="width: 100%"
+            v-if="
+              formData.data.fileListThree &&
+              formData.data.fileListThree.length > 0
+            "
+          >
+            <span
+              v-for="item in formData.data.fileListThree"
+              :key="item.id"
+              @click="onPreviewFile(item)"
+              style="margin-right: 10px; cursor: pointer; color: #409eff"
+            >
+              {{ item.name }}
+            </span>
+          </div>
+          <div v-else>无</div>
+        </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
@@ -53,7 +90,7 @@
         >
           确认接收
         </el-button>
-        <el-button
+        <!-- <el-button
           type="danger"
           @click="submitForm()"
           size="large"
@@ -61,7 +98,7 @@
           v-if="otherBtn"
         >
           退回前道工序
-        </el-button>
+        </el-button> -->
       </template>
     </el-dialog>
   </div>
@@ -240,6 +277,16 @@ const formConfig = computed(() => {
       label: "工序图纸",
     },
     {
+      type: "slot",
+      slotName: "fileTwo",
+      label: "工序附件",
+    },
+    {
+      type: "slot",
+      slotName: "fileThree",
+      label: "工单附件",
+    },
+    {
       type: "input",
       itemType: "text",
       prop: "previousProcessesName",
@@ -365,7 +412,7 @@ const getDtl = (row) => {
       res.productionTaskDetailRecordList &&
       res.productionTaskDetailRecordList.length > 0
     ) {
-      let id = res.productionTaskDetailRecordList[0].id;
+      let id = res.previousProcessesRecordId;
       proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
         if (res[id] && res[id].length > 0) {
           formData.data.fileList = res[id].map((item) => {
@@ -378,7 +425,45 @@ const getDtl = (row) => {
         }
       });
     }
+    proxy
+      .post("/fileInfo/getList", {
+        businessIdList: [res.productionProcessesId],
+      })
+      .then((resOne) => {
+        if (
+          resOne[res.productionProcessesId] &&
+          resOne[res.productionProcessesId].length > 0
+        ) {
+          formData.data.fileListTwo = resOne[res.productionProcessesId].map(
+            (item) => {
+              return {
+                raw: item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            }
+          );
+        }
+      });
+
+    proxy
+      .post("/fileInfo/getList", {
+        businessIdList: [res.workOrderId],
+        fileType: 1,
+      })
+      .then((resOne) => {
+        if (resOne[res.workOrderId] && resOne[res.workOrderId].length > 0) {
+          formData.data.fileListThree = resOne[res.workOrderId].map((item) => {
+            return {
+              raw: item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          });
+        }
+      });
   });
+
   dialogVisible.value = true;
 };
 

+ 61 - 3
src/views/JXSK/production/schedule/index.vue

@@ -53,7 +53,7 @@
     </el-dialog>
 
     <el-dialog
-      :title="'查看工序图纸'"
+      :title="'查看工序附件'"
       v-model="dialogVisibleOne"
       width="700"
       destroy-on-close
@@ -71,7 +71,11 @@
             工序负责人:{{ item.personLiableName }}
           </div>
           <div style="margin-top: 5px">
-            工序图纸:
+            工序开始时间:{{ item.receivedTime }}
+          </div>
+          <div style="margin-top: 5px">工序结束时间:{{ item.createTime }}</div>
+          <div style="margin-top: 5px">
+            上传附件:
             <span
               v-for="file in item.fileList"
               :key="file.id"
@@ -80,6 +84,28 @@
               >{{ file.fileName }}</span
             >
           </div>
+          <div style="margin-top: 5px">
+            工序附件:
+            <span
+              v-for="file in item.fileListOne"
+              :key="file.id"
+              style="margin-right: 20px; cursor: pointer; color: #409eff"
+              @click="handleOpenFile(file)"
+              >{{ file.fileName }}</span
+            >
+          </div>
+        </div>
+        <TitleInfo content="生产资料"></TitleInfo>
+
+        <div style="margin-top: 5px">
+          工单附件:
+          <span
+            v-for="file in fileData.fileListThree"
+            :key="file.id"
+            style="margin-right: 20px; cursor: pointer; color: #409eff"
+            @click="handleOpenFile(file)"
+            >{{ file.fileName }}</span
+          >
         </div>
       </div>
       <template #footer>
@@ -95,6 +121,8 @@
 import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
+import TitleInfo from "@/components/TitleInfo/index.vue";
+
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
 const submitLoading = ref(false);
@@ -449,15 +477,16 @@ const moreSearchReset = () => {
 };
 const dialogVisibleOne = ref(false);
 const allData = ref([]);
+const fileData = ref({});
 const getDtl = (row) => {
   proxy.post("/productionTaskDetail/detail", { id: row.id }).then((res) => {
     if (
       res.productionTaskDetailRecordList &&
       res.productionTaskDetailRecordList.length > 0
     ) {
-      let ids = res.productionTaskDetailRecordList.map((x) => x.id);
       allData.value = res.productionTaskDetailRecordList;
       dialogVisibleOne.value = true;
+      let ids = res.productionTaskDetailRecordList.map((x) => x.id);
       proxy
         .post("/fileInfo/getList", { businessIdList: ids })
         .then((fileObj) => {
@@ -470,12 +499,41 @@ const getDtl = (row) => {
             }
           }
         });
+      let idsTwo = res.productionTaskDetailRecordList.map(
+        (x) => x.productionProcessesId
+      );
+      proxy
+        .post("/fileInfo/getList", { businessIdList: idsTwo })
+        .then((fileObj) => {
+          for (let i = 0; i < allData.value.length; i++) {
+            const e = allData.value[i];
+            for (const key in fileObj) {
+              if (e.productionProcessesId === key) {
+                e.fileListOne = fileObj[key];
+              }
+            }
+          }
+        });
     } else {
       return ElMessage({
         message: "该任务还未开始",
         type: "info",
       });
     }
+    proxy
+      .post("/fileInfo/getList", {
+        businessIdList: [res.workOrderId],
+        fileType: 1,
+      })
+      .then((resOne) => {
+        if (resOne[res.workOrderId] && resOne[res.workOrderId].length > 0) {
+          fileData.value.fileListThree = resOne[res.workOrderId].map((item) => {
+            return {
+              ...item,
+            };
+          });
+        }
+      });
   });
 };
 

+ 6 - 1
src/views/JXSK/production/task/index.vue

@@ -641,6 +641,11 @@ const handlePrint = (row) => {
     key = key.padStart(3, "0");
     let obj = {
       productSn: code + "-" + key,
+      url:
+        "http://139.9.102.170:10020/jxst/pro/qrDetails?productSn=" +
+        code +
+        "-" +
+        key,
     };
     arr.push(obj);
   }
@@ -655,7 +660,7 @@ const handlePrint = (row) => {
       const ele = qrList.value[i];
       proxy.$refs[ele.productSn][0].innerHTML = ""; //清除二维码方法一
       new QRCode(proxy.$refs[ele.productSn][0], {
-        text: ele.productSn, //页面地址 ,如果页面需要参数传递请注意哈希模式#
+        text: ele.url, //页面地址 ,如果页面需要参数传递请注意哈希模式#
         width: 100,
         height: 100,
         colorDark: "#000000",

+ 280 - 7
src/views/JXSK/production/workOrder/index.vue

@@ -51,6 +51,111 @@
             />
           </div>
         </template>
+
+        <template #btns="{ item }">
+          <div style="width: 100%">
+            <div v-if="props.isShowSelect">
+              <el-button text type="primary" @click="handleSelectRow(item)"
+                >选择</el-button
+              >
+            </div>
+            <div v-else>
+              <!-- 制图 -->
+              <div v-if="isZhiTu && item.researchStatus">
+                <span v-if="item.isCustomized == 1">
+                  <el-button
+                    text
+                    type="primary"
+                    @click="getDtl(item, item.bomStatus ? true : false)"
+                    >{{ item.bomStatus ? "查看" : "调整" }}BOM</el-button
+                  >
+                </span>
+                <span v-if="item.isCustomized == 1">
+                  <el-button
+                    text
+                    type="primary"
+                    @click="
+                      getDtlOne(item, item.technologyStatus ? true : false)
+                    "
+                    >{{
+                      item.technologyStatus ? "查看" : "调整"
+                    }}工艺</el-button
+                  >
+                </span>
+                <span v-if="item.productionQuantity == null">
+                  <el-button text type="primary" @click="handleOut(item)"
+                    >下发</el-button
+                  >
+                </span>
+                <span>
+                  <el-button text type="primary" @click="handlePrint(item)"
+                    >打印</el-button
+                  >
+                </span>
+                <span>
+                  <el-button
+                    text
+                    type="primary"
+                    @click="handleUploadFile(item, true)"
+                    >查看设计资料</el-button
+                  >
+                </span>
+              </div>
+              <!-- 研发 -->
+              <span v-if="isYanFa">
+                <el-button
+                  text
+                  type="primary"
+                  @click="handleUploadFile(item, false)"
+                  >{{
+                    item.researchStatus ? "修改" : "上传"
+                  }}设计资料</el-button
+                >
+              </span>
+              <!-- 都不是 -->
+              <div v-if="!isYanFa && !isZhiTu && item.researchStatus">
+                <span v-if="item.isCustomized == 1">
+                  <el-button
+                    text
+                    type="primary"
+                    @click="getDtl(item, item.bomStatus ? true : false)"
+                    >{{ item.bomStatus ? "查看" : "调整" }}BOM</el-button
+                  >
+                </span>
+                <span v-if="item.isCustomized == 1">
+                  <el-button
+                    text
+                    type="primary"
+                    @click="
+                      getDtlOne(item, item.technologyStatus ? true : false)
+                    "
+                    >{{
+                      item.technologyStatus ? "查看" : "调整"
+                    }}工艺</el-button
+                  >
+                </span>
+                <span v-if="item.productionQuantity == null">
+                  <el-button text type="primary" @click="handleOut(item)"
+                    >下发</el-button
+                  >
+                </span>
+                <span>
+                  <el-button text type="primary" @click="handlePrint(item)"
+                    >打印</el-button
+                  >
+                </span>
+                <span>
+                  <el-button
+                    text
+                    type="primary"
+                    @click="handleUploadFile(item, true)"
+                    >查看设计资料</el-button
+                  >
+                </span>
+              </div>
+            </div>
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog
@@ -129,7 +234,6 @@
           @click="submitForm(0)"
           size="large"
           :loading="submitLoading"
-          v-if="!isDetail"
         >
           暂 存
         </el-button>
@@ -224,7 +328,6 @@
                         :before-upload="
                           (file) => handleBeforeUpload(file, $index)
                         "
-                        accept=".pdf"
                       >
                         <el-icon
                           :size="17"
@@ -326,7 +429,6 @@
         <el-button @click="dialogVisibleTwo = false" size="large"
           >取 消</el-button
         >
-
         <el-button
           type="primary"
           @click="submitFormTwo()"
@@ -339,6 +441,77 @@
     </el-dialog>
 
     <el-dialog
+      :title="'上传设计资料'"
+      v-model="informationDialog"
+      width="500"
+      v-loading="submitLoading"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="informationFormConfig"
+        :formOption="informationFormOption"
+        v-model="formData.dataThree"
+      >
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="formData.dataThree.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="handleBeforeUploadOne"
+              :on-success="handleSuccess"
+              :on-preview="onPreviewFile"
+            >
+              <el-button>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="informationDialog = false" size="large"
+          >取 消</el-button
+        >
+        <span v-if="!showUploadSubmitOne">
+          <el-button
+            type="primary"
+            @click="submitInformationForm(0)"
+            size="large"
+            :loading="submitLoading"
+          >
+            暂 存
+          </el-button>
+
+          <el-button
+            type="primary"
+            @click="submitInformationForm(1)"
+            size="large"
+            :loading="submitLoading"
+            v-if="!showUploadSubmit"
+          >
+            提 交
+          </el-button>
+        </span>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      title="打印产品需求单"
+      v-if="printDialog"
+      v-model="printDialog"
+      width="680"
+    >
+      <ProductDemandPDF :rowData="rowData"></ProductDemandPDF>
+
+      <template #footer>
+        <el-button @click="printDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" v-print="printObj" size="large"
+          >打 印</el-button
+        >
+      </template>
+    </el-dialog>
+
+    <el-dialog
       v-model="openMaterial"
       title="选择产品"
       width="70%"
@@ -363,6 +536,9 @@ import { computed, defineComponent, nextTick, ref } from "vue";
 import useUserStore from "@/store/modules/user";
 import SelectMaterial from "@/components/product/SelectMaterial";
 import Sortable from "sortablejs";
+import ProductDemandPDF from "@/components/PDF/productDemandPDF.vue";
+
+const userInfo = useUserStore();
 const props = defineProps({
   isShowSelect: {
     type: Boolean,
@@ -531,6 +707,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
+        slot: "btns",
         width: "220",
         align: "center",
         fixed: "right",
@@ -652,6 +829,14 @@ const formOptionTwo = reactive({
   rules: [],
   disabled: false,
 });
+const informationFormOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+  disabled: false,
+});
+
 const byform = ref(null);
 const byformOne = ref(null);
 
@@ -720,6 +905,13 @@ const formConfigTwo = reactive([
     },
   },
 ]);
+const informationFormConfig = reactive([
+  {
+    type: "slot",
+    slotName: "file",
+    label: "上传设计资料",
+  },
+]);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -741,7 +933,7 @@ const openModal = () => {
 
 const submitForm = (type) => {
   byform.value.handleSubmit((valid) => {
-    if (type) {
+    if (type == 1) {
       ElMessageBox.confirm(`你确定提交吗?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -763,7 +955,7 @@ const submitForm = (type) => {
         );
       });
     } else {
-      formData.data.bomStatus = type;
+      // formData.data.bomStatus = type;
       submitLoading.value = true;
       proxy.post("/workOrderBom/edit", formData.data).then(
         (res) => {
@@ -844,7 +1036,7 @@ const submitFormOne = (type) => {
 const isDetail = ref(false);
 const getDtl = (row, flag) => {
   isDetail.value = flag;
-  formOption.disabled = flag;
+  // formOption.disabled = flag;
   modalType.value = "edit";
   proxy.post("/workOrderBom/list", { workOrderId: row.id }).then((res) => {
     formData.data = {
@@ -916,7 +1108,7 @@ const getDtlOne = (row, flag) => {
         initSort();
       });
       proxy
-        .post("/fileInfo/getList", { businessIdList: [row.id] })
+        .post("/fileInfo/getList", { businessIdList: [row.id], fileType: 1 })
         .then((fileObj) => {
           if (fileObj[row.id] && fileObj[row.id].length > 0) {
             formData.dataOne.fileList = fileObj[row.id].map((item) => {
@@ -943,6 +1135,19 @@ const getDict = () => {
     }));
   });
 };
+const isYanFa = ref(false);
+const isZhiTu = ref(false);
+const checkShow = () => {
+  // 当前账号角色是否是研发
+  if (userInfo.roles.includes("dev")) {
+    isYanFa.value = true;
+  }
+  // 当前角色是否是制图
+  if (userInfo.roles.includes("design")) {
+    isZhiTu.value = true;
+  }
+};
+checkShow();
 getList();
 getDict();
 
@@ -1062,6 +1267,74 @@ const submitFormTwo = (type) => {
     );
   });
 };
+const informationDialog = ref(false);
+const showUploadSubmit = ref(false);
+const showUploadSubmitOne = ref(false);
+
+const handleUploadFile = (row, flag) => {
+  showUploadSubmit.value = row.researchStatus == 1 ? true : false;
+  showUploadSubmitOne.value = flag;
+  formData.dataThree = {
+    id: row.id,
+    fileList: [],
+  };
+  informationDialog.value = true;
+  proxy
+    .post("/fileInfo/getList", {
+      businessIdList: [row.id],
+      fileType: 0,
+    })
+    .then((res) => {
+      if (res[row.id] && res[row.id].length > 0) {
+        formData.dataThree.fileList = res[row.id].map((item) => {
+          return {
+            raw: item,
+            name: item.fileName,
+            url: item.fileUrl,
+          };
+        });
+      }
+    });
+};
+const submitInformationForm = (type) => {
+  if (formData.dataThree.fileList && formData.dataThree.fileList.length > 0) {
+    formData.dataThree.fileList = formData.dataThree.fileList.map((x) => x.raw);
+    formData.dataThree.researchStatus = type == 1 ? "1" : "";
+    submitLoading.value = true;
+    proxy.post("/workOrder/research", formData.dataThree).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        informationDialog.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  } else {
+    return ElMessage({
+      message: "请上传设计资料",
+      type: "info",
+    });
+  }
+};
+const printDialog = ref(false);
+const rowData = ref({});
+const handlePrint = (row) => {
+  rowData.value = {
+    id: row.id,
+  };
+  printDialog.value = true;
+};
+const printObj = ref({
+  id: "pdfDom",
+  popTitle: "",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
 
 const handleSelectRow = (row) => {
   proxy.$emit("handleSelectRow", row);

+ 19 - 0
src/views/product/material/index.vue

@@ -222,6 +222,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "库存阀值",
+        prop: "stockThreshold",
+      },
+    },
+
+    {
+      attrs: {
         label: "操作",
         width: "160",
         align: "center",
@@ -352,6 +359,7 @@ const formConfig = computed(() => {
       required: true,
       data: materialUnit.value,
     },
+
     {
       type: "slot",
       slotName: "productPic",
@@ -365,6 +373,17 @@ const formConfig = computed(() => {
       label: "备注",
       itemType: "textarea",
     },
+    {
+      type: "number",
+      prop: "stockThreshold",
+      label: "库存阀值",
+      precision: 0,
+      min: 1,
+      controls: false,
+      style: {
+        width: "50%",
+      },
+    },
   ];
 });
 const newPassword = () => {

+ 1 - 2
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -199,12 +199,11 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "工单号",
+        label: "关联工单号",
         prop: "workOrderCode",
         width: 120,
       },
     },
-
     {
       attrs: {
         label: "物品编码",

+ 61 - 0
src/views/purchaseSales/outAndInWarehouse/manualWarehousing/index.vue

@@ -33,6 +33,17 @@
         :rules="rules"
         ref="submit"
       >
+        <template #workOrderId>
+          <div style="width: 100%">
+            <el-button type="primary" @click="openOrder = true"
+              >选择工单</el-button
+            >
+            <div style="margin-top: 10px" v-if="selectOrder">
+              已选择: {{ selectOrder }}
+            </div>
+          </div>
+        </template>
+
         <template #details>
           <div style="width: 100%">
             <el-button type="primary" @click="openProduct = true"
@@ -123,6 +134,20 @@
         @pushGoods="pushGoods"
       ></SelectGoods>
     </el-dialog>
+
+    <el-dialog
+      v-model="openOrder"
+      title="工单选择"
+      width="80%"
+      append-to-body
+      destroy-on-close
+    >
+      <WorkOrder :isShowSelect="true" @handleSelectRow="handleSelectRow">
+      </WorkOrder>
+      <template #footer>
+        <el-button @click="openOrder = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -132,6 +157,8 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { ElMessage } from "element-plus";
 import SelectGoods from "@/components/product/SelectGoods";
+import WorkOrder from "@/views/JXSK/production/workOrder/index";
+import useUserStore from "@/store/modules/user";
 
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
@@ -169,6 +196,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "关联工单号",
+        prop: "workOrderCode",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
         label: "物品编码",
         prop: "productCode",
         width: 160,
@@ -281,18 +315,33 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
+      slotName: "workOrderId",
+      label: "绑定工单",
+    },
+    {
+      type: "slot",
       slotName: "details",
       label: "入库明细",
     },
+    {
+      type: "input",
+      prop: "exWarehousePerson",
+      label: "入库人",
+      itemWidth: 50,
+    },
   ];
 });
 const rules = ref({
   warehouseId: [{ required: true, message: "请选择仓库", trigger: "change" }],
+  exWarehousePerson: [
+    { required: true, message: "请输入入库人", trigger: "blur" },
+  ],
 });
 const openModal = () => {
   formData.data = {
     type: "1",
     list: [],
+    exWarehousePerson: useUserStore().user.nickName,
   };
   loadingDialog.value = false;
   dialogVisible.value = true;
@@ -368,6 +417,18 @@ const acquireSelectList = () => {
   }
   return data;
 };
+
+const openOrder = ref(false);
+const selectOrder = ref("");
+const handleSelectRow = (row) => {
+  formData.data.workOrderId = row.id;
+  selectOrder.value = row.code;
+  ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+  openOrder.value = false;
+};
 </script>
 
 <style lang="scss" scoped>

+ 16 - 11
src/views/purchaseSales/outAndInWarehouse/waitingForStorage/index.vue

@@ -252,17 +252,19 @@ const config = computed(() => {
                 },
               }
             : {},
-          {
-            attrs: {
-              label: "打印",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              handlePrint(row);
-            },
-          },
+          row.businessType == 2
+            ? {
+                attrs: {
+                  label: "打印",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handlePrint(row);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -463,6 +465,9 @@ const onPreviewFile = (file) => {
 const printDialog = ref(false);
 const rowData = ref({});
 const handlePrint = (row) => {
+  rowData.value = {
+    id: row.businessId,
+  };
   printDialog.value = true;
 };
 const printObj = ref({