Browse Source

新需求

cz 1 year ago
parent
commit
db6e6fd54a

+ 183 - 49
src/components/headerBar/header-bar.vue

@@ -3,47 +3,97 @@
     <header>
       <ul class="nav">
         <!-- <div class="logo">嘉兴双拓</div> -->
-        <div class="logo" style="display: flex; align-items: center; justify-content: center">
+        <div
+          class="logo"
+          style="display: flex; align-items: center; justify-content: center"
+        >
           <img v-if="!logoUrl" :src="'/img/logo2.png'" />
-          <el-image v-else style="width: 120px; height: 30px" :src="logoUrl" fit="scale-down" />
+          <el-image
+            v-else
+            style="width: 120px; height: 30px"
+            :src="logoUrl"
+            fit="scale-down"
+          />
         </div>
-        <li class="header-bar-hover-warp nav-li" :class="isChildMenu ? 'active' : ''">
+        <li
+          class="header-bar-hover-warp nav-li"
+          :class="isChildMenu ? 'active' : ''"
+        >
           <div @click.stop="isChildMenu = !isChildMenu" class="menu-modal">
-            <i class="iconfont icon-icomx_gongndh" style="margin: 0 5px 0 0"></i>
-            {{$t('header.functionGuide')}}
-            <i class="iconfont icon-iconm_xialan1" style="margin: 0 0 0 3px"></i>
+            <i
+              class="iconfont icon-icomx_gongndh"
+              style="margin: 0 5px 0 0"
+            ></i>
+            {{ $t("header.functionGuide") }}
+            <i
+              class="iconfont icon-iconm_xialan1"
+              style="margin: 0 0 0 3px"
+            ></i>
           </div>
         </li>
         <div class="auto-list">
-          <li class="nav-li" @click="commonsBannerToRouter(i)" v-for="(i, index) in commonsRouterList" v-show="index < autoListChidrenNum - 1" :key="i.id">
+          <li
+            class="nav-li"
+            @click="commonsBannerToRouter(i)"
+            v-for="(i, index) in commonsRouterList"
+            v-show="index < autoListChidrenNum - 1"
+            :key="i.id"
+          >
             <span>{{ i.menuName }}</span>
           </li>
-          <li class="nav-li more-box" v-show="commonsRouterList.length > autoListChidrenNum - 1">
-            {{$t('header.more')}}
+          <li
+            class="nav-li more-box"
+            v-show="commonsRouterList.length > autoListChidrenNum - 1"
+          >
+            {{ $t("header.more") }}
             <i class="iconfont icon-iconm_xialan1"></i>
             <ul class="more-list">
-              <li v-for="(i, index) in commonsRouterList" v-show="index >= autoListChidrenNum - 1" :key="i.id">
+              <li
+                v-for="(i, index) in commonsRouterList"
+                v-show="index >= autoListChidrenNum - 1"
+                :key="i.id"
+              >
                 <span @click="commonsBannerToRouter(i)">{{ i.menuName }}</span>
               </li>
             </ul>
           </li>
         </div>
-        <div class="header-bar-warp" v-if="isChildMenu" @click.stop="isChildMenu = false">
+        <div
+          class="header-bar-warp"
+          v-if="isChildMenu"
+          @click.stop="isChildMenu = false"
+        >
           <div class="header-bar-hover" @click.stop>
             <div class="header-bar-hover-content">
               <div class="left-banner">
                 <!-- :style="leftBanerType == 2 ? 'color:#0084ff' : ''" -->
-                <div class="first-order" @click="leftBanerType = 2" >
-                  <i class="iconfont icon-iconm_changycd" style="position: relative;top:-1px;"></i>
-                  {{$t('header.commonFunctions')}}
+                <div class="first-order" @click="leftBanerType = 2">
+                  <i
+                    class="iconfont icon-iconm_changycd"
+                    style="position: relative; top: -1px"
+                  ></i>
+                  {{ $t("header.commonFunctions") }}
                 </div>
                 <div class="first-order">
-                  <i class="iconfont icon-iconm_gongncd" style="position: relative;top:-1px;"></i>
-                  {{$t('header.functionMenu')}}
+                  <i
+                    class="iconfont icon-iconm_gongncd"
+                    style="position: relative; top: -1px"
+                  ></i>
+                  {{ $t("header.functionMenu") }}
                 </div>
                 <ul>
-                  <li :class="menuName == i.menuName ? 'active' : ''" @click="openLeftBaner(i, index)" v-for="(i, index) in sidebarRoutersCopy" :key="i.name" v-show="i.type == 1 && i.status == '0'">
-                    <i :class="'iconfont icon-' + i.icon" style="position: relative;top:-1px;"></i>{{ i.menuName }}
+                  <li
+                    :class="menuName == i.menuName ? 'active' : ''"
+                    @click="openLeftBaner(i, index)"
+                    v-for="(i, index) in sidebarRoutersCopy"
+                    :key="i.name"
+                    v-show="i.type == 1 && i.status == '0'"
+                  >
+                    <i
+                      :class="'iconfont icon-' + i.icon"
+                      style="position: relative; top: -1px"
+                    ></i
+                    >{{ i.menuName }}
                   </li>
                 </ul>
                 <!-- <div class="first-order">
@@ -70,50 +120,104 @@
 								</ul> -->
                 <ul class="second-level">
                   <div v-for="(i, index) in activeLeftData" :key="index">
-                    <li v-if="i.isNone" class="menu-ul" style="cursor: auto"></li>
+                    <li
+                      v-if="i.isNone"
+                      class="menu-ul"
+                      style="cursor: auto"
+                    ></li>
                     <li class="menu-title" v-else-if="i.isTitle">
-                      <a v-if="i.icon && i.icon !== '#'" :class="'iconfont icon-' + i.icon" style="margin-right: 4px"></a><span>{{ i.menuName }}</span>
+                      <a
+                        v-if="i.icon && i.icon !== '#'"
+                        :class="'iconfont icon-' + i.icon"
+                        style="margin-right: 4px"
+                      ></a
+                      ><span>{{ i.menuName }}</span>
                     </li>
-                    <li v-else class="menu-ul" @click="commonsBannerToRouter(i)" style="cursor: pointer;display: flex;">
-                      <a :class="'iconfont icon-' + i.icon" style="margin-right: 4px;width:20px;min-height: 20px;display: block;"></a>
+                    <li
+                      v-else
+                      class="menu-ul"
+                      @click="commonsBannerToRouter(i)"
+                      style="cursor: pointer; display: flex"
+                    >
+                      <a
+                        :class="'iconfont icon-' + i.icon"
+                        style="
+                          margin-right: 4px;
+                          width: 20px;
+                          min-height: 20px;
+                          display: block;
+                        "
+                      ></a>
                       <span>{{ i.menuName }}</span>
                     </li>
                   </div>
                 </ul>
               </div>
               <div class="menu-warp" v-show="leftBanerType == 2">
-                <div class="first-order-title">{{$t('header.commonFunctions')}}</div>
+                <div class="first-order-title">
+                  {{ $t("header.commonFunctions") }}
+                </div>
                 <div class="commons-warp">
                   <div>
-                    <div class="header-button-box cp" v-for="(i, index) in commonsRouterList" :key="i.name" @click="commonsBannerToRouter(i)">
+                    <div
+                      class="header-button-box cp"
+                      v-for="(i, index) in commonsRouterList"
+                      :key="i.name"
+                      @click="commonsBannerToRouter(i)"
+                    >
                       <span>{{ i.menuName }}</span>
-                      <div class="right-icon" @click.stop="deleteCommonsRouter(i, index)">
+                      <div
+                        class="right-icon"
+                        @click.stop="deleteCommonsRouter(i, index)"
+                      >
                         <!-- <el-icon color="#46A6FF"><CirclePlus /></el-icon> -->
                         <el-icon color="#BBBBBB" v-show="isEidtType">
                           <Close />
                         </el-icon>
                       </div>
                     </div>
-                    <div class="header-add-button-box" v-if="!isEidtType" @click="isEidtType = true">
+                    <div
+                      class="header-add-button-box"
+                      v-if="!isEidtType"
+                      @click="isEidtType = true"
+                    >
                       <el-icon color="#46A6FF">
                         <CirclePlus />
                       </el-icon>
-                      {{$t('header.edit')}}
+                      {{ $t("header.edit") }}
                     </div>
                   </div>
                 </div>
-                <div class="first-order-title" v-if="isEidtType">{{$t('header.toAdd')}}</div>
+                <div class="first-order-title" v-if="isEidtType">
+                  {{ $t("header.toAdd") }}
+                </div>
                 <div class="all-menu-warp" v-if="isEidtType">
-                  <div v-for="(i, index) in sidebarRoutersCopy" :key="i.name" v-show="i.type === 1">
-                    <div class="all-menu-title" v-for="(j, jindex) in i.children" :key="j.name">
+                  <div
+                    v-for="(i, index) in sidebarRoutersCopy"
+                    :key="i.name"
+                    v-show="i.type === 1"
+                  >
+                    <div
+                      class="all-menu-title"
+                      v-for="(j, jindex) in i.children"
+                      :key="j.name"
+                    >
                       <div class="title">
                         {{ j.menuName }}
                       </div>
                       <div class="all-menu-lists">
-                        <div class="header-button-box" v-for="(n, nindex) in j.children" v-show="n.visible == '0'" :key="n.name">
+                        <div
+                          class="header-button-box"
+                          v-for="(n, nindex) in j.children"
+                          v-show="n.visible == '0'"
+                          :key="n.name"
+                        >
                           <span>{{ n.menuName }}</span>
 
-                          <div class="right-icon" @click="addCommonsRouter(index, jindex, nindex, n)">
+                          <div
+                            class="right-icon"
+                            @click="addCommonsRouter(index, jindex, nindex, n)"
+                          >
                             <el-icon color="#46A6FF">
                               <CirclePlus />
                             </el-icon>
@@ -124,8 +228,12 @@
                   </div>
                 </div>
                 <div class="btn-warp" v-if="isEidtType">
-                  <el-button type="" @click="isEidtType = false">取消</el-button>
-                  <el-button type="primary" @click="userMenuEdit">保存</el-button>
+                  <el-button type="" @click="isEidtType = false"
+                    >取消</el-button
+                  >
+                  <el-button type="primary" @click="userMenuEdit"
+                    >保存</el-button
+                  >
                 </div>
               </div>
             </div>
@@ -134,26 +242,41 @@
       </ul>
       <div class="fr">
         <!-- :value="12" -->
-        <el-badge :value="badgeNum" style="cursor: pointer;" class="badge" @click="noticeTableModal = true">
+        <el-badge
+          :value="badgeNum"
+          style="cursor: pointer"
+          class="badge"
+          @click="noticeTableModal = true"
+        >
           <el-icon :size="20">
             <BellFilled />
           </el-icon>
         </el-badge>
-        <notice v-model='noticeTableModal' @changeNum="(e)=> badgeNum = e"></notice>
-        <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
+        <notice
+          v-model="noticeTableModal"
+          @changeNum="(e) => (badgeNum = e)"
+          @openNotice="noticeTableModal = true"
+        ></notice>
+        <el-dropdown
+          @command="handleCommand"
+          class="right-menu-item hover-effect"
+          trigger="click"
+        >
           <div class="dropdown-box">
             {{ userData }}
           </div>
           <template #dropdown>
             <el-dropdown-menu>
               <router-link to="/user/profile">
-                <el-dropdown-item>{{$t('header.personalCenter')}}</el-dropdown-item>
+                <el-dropdown-item>{{
+                  $t("header.personalCenter")
+                }}</el-dropdown-item>
               </router-link>
               <el-dropdown-item command="setLayout">
-                <span>{{$t('header.layoutSettings')}}</span>
+                <span>{{ $t("header.layoutSettings") }}</span>
               </el-dropdown-item>
               <el-dropdown-item divided command="logout">
-                <span>{{$t('header.logout')}}</span>
+                <span>{{ $t("header.logout") }}</span>
               </el-dropdown-item>
             </el-dropdown-menu>
           </template>
@@ -224,7 +347,7 @@ const addCommonsRouter = (index, jindex, nindex, n) => {
     const element = commonsRouterList.value[i];
     if (element.menuId === n.menuId) {
       ElMessage({
-        message: proxy.t('header.thisDirectoryHasBeenAdded'),
+        message: proxy.t("header.thisDirectoryHasBeenAdded"),
         type: "error",
       });
       return;
@@ -232,13 +355,15 @@ const addCommonsRouter = (index, jindex, nindex, n) => {
   }
   if (n.hidden) {
     ElMessage({
-      message: proxy.t('header.thisDirectoryRequiresAdditionalParameters'),
+      message: proxy.t("header.thisDirectoryRequiresAdditionalParameters"),
       type: "error",
     });
     return;
   }
   commonsRouterList.value.push(n);
-  sidebarRoutersCopy.value[index].children[jindex].children[nindex].isCommonsBanner = true;
+  sidebarRoutersCopy.value[index].children[jindex].children[
+    nindex
+  ].isCommonsBanner = true;
 };
 
 const routerInit = (item) => {
@@ -267,7 +392,12 @@ const routerInit = (item) => {
     const element = arr[i];
     if (element.isTitle) {
       //判断余数加上子项列会不会爆掉
-      if (element.children && element.children.length > 0 && (i % 11) + element.children.length + 1 > 11 && element.children.length < 11) {
+      if (
+        element.children &&
+        element.children.length > 0 &&
+        (i % 11) + element.children.length + 1 > 11 &&
+        element.children.length < 11
+      ) {
         let num = 11 - (i % 11);
         for (let j = 0; j < num; j++) {
           arr.splice(i, 0, { ...element, isNone: true });
@@ -292,11 +422,15 @@ function handleCommand(command) {
 }
 
 function logout() {
-  ElMessageBox.confirm(proxy.t('header.areYouSureYouWantToLogOutAndExitTheSystem'), proxy.t('common.prompt'), {
-    confirmButtonText:  proxy.t('common.confirm'),
-    cancelButtonText: proxy.t('common.cancel'),
-    type: "warning",
-  })
+  ElMessageBox.confirm(
+    proxy.t("header.areYouSureYouWantToLogOutAndExitTheSystem"),
+    proxy.t("common.prompt"),
+    {
+      confirmButtonText: proxy.t("common.confirm"),
+      cancelButtonText: proxy.t("common.cancel"),
+      type: "warning",
+    }
+  )
     .then(() => {
       userStore.logOut().then(() => {
         location.href = "/index";

+ 380 - 343
src/components/notice/index.vue

@@ -1,114 +1,145 @@
 <template>
-	<div class="commons-notice">
-		<el-dialog
-			title="系统公告"
-			v-model="value"
-			width="460px"
-			:align-center="true"
-			:before-close="handleClose"
-		>
-			<div class="title">
-				<!-- {{ data.length == 0 ? '暂无数据' :  data[indexCopy].title}} -->
-			</div>
-			<div
-				class="text-content"
-				v-if="data.length > 0"
-				style="margin-top: 10px"
-			>
-				<h3>{{ data[index].title }}</h3>
-				{{ data[index].businessData }}
-			</div>
-			<template #footer>
-				<span class="dialog-footer">
-					<el-button
-						size="small"
-						@click="index--"
-						:disabled="data.length < 2 || index == 0"
-						>上一条</el-button
-					>
-					<el-button
-						size="small"
-						@click="index++"
-						:disabled="data.length == index + 1"
-						>下一条</el-button
-					>
-					<el-button
-						type="primary"
-						size="small"
-						:disabled="data.length == 0 || data[index].isRead"
-						@click="confirm"
-						>确认已读</el-button
-					>
-					<!-- <span class="more" @click="moreFn">查看更多 &gt;</span> -->
-				</span>
-			</template>
-		</el-dialog>
-		<div
-			class="notice-table-warp"
-			:class="modelValue ? 'notice-table-warp-open' : ''"
-			@click.stop="closeNoticeTableModal"
-		>
-			<div class="notice-table" @click.stop  v-loading="loading" >
-				<div class="tabs">
-					<ul>
-						<li style="padding-left: 0; border: none" @click="pushInfoReq.whetherFlow = '';getPushInfoInit()" :class="pushInfoReq.whetherFlow === '' ? 'active' : ''">
-							全部<span v-if="pushInfoReq.whetherFlow === ''">({{pushInfoReq.total}})</span>
-						</li>
-						<li  @click="pushInfoReq.whetherFlow = 1;getPushInfoInit()" :class="pushInfoReq.whetherFlow === 1 ? 'active' : ''">
-							流程<span v-if="pushInfoReq.whetherFlow === 1">({{pushInfoReq.total}})</span>
-						</li>
-						<li  @click="pushInfoReq.whetherFlow = 0;getPushInfoInit()" :class="pushInfoReq.whetherFlow === 0 ? 'active' : ''">
-							业务<span v-if="pushInfoReq.whetherFlow === 0">({{pushInfoReq.total}})</span>
-						</li>
-					</ul>
-					<div class="more" @click="toDealWith({businessType:'hisMsg'})">查看更多&gt;</div>
-				</div>
-				<el-table :data="noticeData" style="width: 100%" @row-click="rowClick">
-					<el-table-column prop="title" label="标题内容" width="250">
-						<template #default="scope">
-							<el-tooltip
-								class="box-item"
-								effect="dark"
-								:content="scope.row.title"
-								placement="top"
-							>
-								<div class="noticeData-title">{{ scope.row.title }}</div>
-							</el-tooltip>
-							
-						</template>
-					</el-table-column>
-					<el-table-column prop="businessType" label="类型" width="120">
-						<template #default="scope">
-							<span>{{ scope.row.businessType === 0 ? '流程' : '业务' }}</span>
-						</template>
-					</el-table-column>
-					<el-table-column prop="address" label="操作">
-						<template #default="scope">
-							<span style="cursor: pointer;color:#0084ff" @click.stop="readFn(scope)">已读</span>
-						</template>
-					</el-table-column>
-				</el-table>
-				<div >
-					<el-pagination 
-						style="text-align: center;" 
-						:page-size="5" layout="prev, pager, next" 
-						:current-page="pushInfoReq.pageNum" 
-						:total="pushInfoReq.total" 
-						@current-change="handlePageChange" />
-				</div>
-				<div class="notice-btn-box" style="margin-top: 20px">
-					<!-- <el-button plain disabled>点击清空</el-button> -->	
-					<el-button type="primary" @click="allReadFn"  v-if="noticeData.length != 0">全部已读</el-button>
-				</div>
-			</div>
-		</div>
-	</div>
+  <div class="commons-notice">
+    <el-dialog
+      title="系统公告"
+      v-model="value"
+      width="460px"
+      :align-center="true"
+      :before-close="handleClose"
+    >
+      <div class="title">
+        <!-- {{ data.length == 0 ? '暂无数据' :  data[indexCopy].title}} -->
+      </div>
+      <div class="text-content" v-if="data.length > 0" style="margin-top: 10px">
+        <h3>{{ data[index].title }}</h3>
+        {{ data[index].businessData }}
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button
+            size="small"
+            @click="index--"
+            :disabled="data.length < 2 || index == 0"
+            >上一条</el-button
+          >
+          <el-button
+            size="small"
+            @click="index++"
+            :disabled="data.length == index + 1"
+            >下一条</el-button
+          >
+          <el-button
+            type="primary"
+            size="small"
+            :disabled="data.length == 0 || data[index].isRead"
+            @click="confirm"
+            >确认已读</el-button
+          >
+          <!-- <span class="more" @click="moreFn">查看更多 &gt;</span> -->
+        </span>
+      </template>
+    </el-dialog>
+    <div
+      class="notice-table-warp"
+      :class="modelValue ? 'notice-table-warp-open' : ''"
+      @click.stop="closeNoticeTableModal"
+    >
+      <div class="notice-table" @click.stop v-loading="loading">
+        <div class="tabs">
+          <ul>
+            <li
+              style="padding-left: 0; border: none"
+              @click="
+                pushInfoReq.whetherFlow = '';
+                getPushInfoInit();
+              "
+              :class="pushInfoReq.whetherFlow === '' ? 'active' : ''"
+            >
+              全部<span v-if="pushInfoReq.whetherFlow === ''"
+                >({{ pushInfoReq.total }})</span
+              >
+            </li>
+            <li
+              @click="
+                pushInfoReq.whetherFlow = 1;
+                getPushInfoInit();
+              "
+              :class="pushInfoReq.whetherFlow === 1 ? 'active' : ''"
+            >
+              流程<span v-if="pushInfoReq.whetherFlow === 1"
+                >({{ pushInfoReq.total }})</span
+              >
+            </li>
+            <li
+              @click="
+                pushInfoReq.whetherFlow = 0;
+                getPushInfoInit();
+              "
+              :class="pushInfoReq.whetherFlow === 0 ? 'active' : ''"
+            >
+              业务<span v-if="pushInfoReq.whetherFlow === 0"
+                >({{ pushInfoReq.total }})</span
+              >
+            </li>
+          </ul>
+          <div class="more" @click="toDealWith({ businessType: 'hisMsg' })">
+            查看更多&gt;
+          </div>
+        </div>
+        <el-table :data="noticeData" style="width: 100%" @row-click="rowClick">
+          <el-table-column prop="title" label="标题内容" width="250">
+            <template #default="scope">
+              <el-tooltip
+                class="box-item"
+                effect="dark"
+                :content="scope.row.title"
+                placement="top"
+              >
+                <div class="noticeData-title">{{ scope.row.title }}</div>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+          <el-table-column prop="businessType" label="类型" width="120">
+            <template #default="scope">
+              <span>{{ scope.row.businessType === 0 ? "流程" : "业务" }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="address" label="操作">
+            <template #default="scope">
+              <span
+                style="cursor: pointer; color: #0084ff"
+                @click.stop="readFn(scope)"
+                >已读</span
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <div>
+          <el-pagination
+            style="text-align: center"
+            :page-size="5"
+            layout="prev, pager, next"
+            :current-page="pushInfoReq.pageNum"
+            :total="pushInfoReq.total"
+            @current-change="handlePageChange"
+          />
+        </div>
+        <div class="notice-btn-box" style="margin-top: 20px">
+          <!-- <el-button plain disabled>点击清空</el-button> -->
+          <el-button
+            type="primary"
+            @click="allReadFn"
+            v-if="noticeData.length != 0"
+            >全部已读</el-button
+          >
+        </div>
+      </div>
+    </div>
+  </div>
 </template>
 <script setup>
-import { ElMessageBox, ElNotification,ElMessage } from 'element-plus'
-import {
-  getToken
-} from '@/utils/auth'
+import { ElMessageBox, ElNotification, ElMessage } from "element-plus";
+import { getToken } from "@/utils/auth";
 const { proxy } = getCurrentInstance();
 defineProps({
   modelValue: {
@@ -116,291 +147,297 @@ defineProps({
     default: false,
   },
 });
-const emit = defineEmits(["update:modelValue"],'changeNum');
+const emit = defineEmits(["update:modelValue"], "changeNum");
 const closeNoticeTableModal = () => {
-	emit("update:modelValue", false);
+  emit("update:modelValue", false);
 };
-let noticeData = ref([])
-let index = ref(0)
-let data = ref([])
-let value = ref(false)
+let noticeData = ref([]);
+let index = ref(0);
+let data = ref([]);
+let value = ref(false);
 const moreFn = () => {
-	noticeTableModal.value = true
-}
+  noticeTableModal.value = true;
+};
 
 const rowClick = (row) => {
-	commonRead([row.id])
-	toDealWith(row)
-}
+  commonRead([row.id]);
+  toDealWith(row);
+};
 
 const toDealWith = (item) => {
-	
-	let urlConfig = {
-		"0":'DealWith',
-		"5":'Claim',
-		"6":"Abnormal",
-		'hisMsg':'HisMsg'
-	}
-	proxy.$router.push({
-		name:urlConfig[item.businessType],
-	})
-}
+  let urlConfig = {
+    0: "DealWith",
+    5: "Claim",
+    6: "Abnormal",
+    hisMsg: "HisMsg",
+  };
+  proxy.$router.push({
+    name: urlConfig[item.businessType],
+  });
+};
 
 const allReadFn = () => {
-	ElMessageBox.confirm('此操作将会把所有未读消息标记为已读,是否继续?', '提示', {
-		confirmButtonText: '确定',
-		cancelButtonText: '取消',
-		type: 'warning',
-	}).then(() => {
-		let arr = []
-		noticeData.value.filter(item=>{
-			arr.push(item.id)
-		})
-		commonRead(arr)
-	}).catch(() => {
-		ElMessage({
-			type: 'info',
-			message: '已取消操作'
-		});          
-	});
-}
+  ElMessageBox.confirm(
+    "此操作将会把所有未读消息标记为已读,是否继续?",
+    "提示",
+    {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning",
+    }
+  )
+    .then(() => {
+      let arr = [];
+      noticeData.value.filter((item) => {
+        arr.push(item.id);
+      });
+      commonRead(arr);
+    })
+    .catch(() => {
+      ElMessage({
+        type: "info",
+        message: "已取消操作",
+      });
+    });
+};
 
 const readFn = (item) => {
-	commonRead([item.row.id])
-}
-const commonRead = (ids,type) => {
-	proxy.post('/pushInfo/read',{idList:ids}).then(res=>{
-		console.log(res)
-		ElMessage({
-			message: '已读成功',
-			type: 'success',
-		})
-		if(type == 'confirm'){
-			data.value[index].isRead = true
-		}else{
-			
-			getPushInfo()
-		}
-	})
-}
+  commonRead([item.row.id]);
+};
+const commonRead = (ids, type) => {
+  proxy.post("/pushInfo/read", { idList: ids }).then((res) => {
+    console.log(res);
+    ElMessage({
+      message: "已读成功",
+      type: "success",
+    });
+    if (type == "confirm") {
+      data.value[index].isRead = true;
+    } else {
+      getPushInfo();
+    }
+  });
+};
 const confirm = () => {
-	value.value = false
-	commonRead([data.value[index.value].id],'confirm')
-	
-}
+  value.value = false;
+  commonRead([data.value[index.value].id], "confirm");
+};
 // proxy.post('sendMeg/page',{
 // 	pageNum:1,
 // 	pageSize:30,
 // }).then(res=>{
-// 	data.value = res.rows 
+// 	data.value = res.rows
 // })
 
 const socketInit = () => {
-	window.ws = new WebSocket(
-		'ws://'+ import.meta.env.VITE_APP_IP + import.meta.env.VITE_APP_WS_API +'/webStock/' +
-			getToken()
-		// 'ws://192.168.1.97:8300/webStock/' + window.localStorage.getItem('token')
-	)
-	//申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
-	window.ws.onopen = function () {
-		//当WebSocket创建成功时,触发onopen事件
-		console.log('open')
-		//每三十秒向后台发送一次心跳包
-		setInterval(() => {
-			window.ws.send('{"heartbeat":1111111}')
-		}, 30000)
-	}
-	window.ws.onmessage = function (e) {
-		//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
-		//在data.value前面插入
-		const res = JSON.parse(e.data)
-		console.log(res)
-		
-		
-		if(res.type == 1) {
-			index.value = 0
-			data.value = res.list
-			if(res.list.length > 0) value.value = true
-		}
-		if(res.type == 2) {
-			emit('changeNum',res.count * 1)
-			getPushInfo()
-		}
-		if(res.type == 3) {
-			ElNotification({
-				title: '提示',
-				message: res.title,
-				position: 'bottom-right',
-				duration:0,
-			})
-		}
-		
-	}
-	window.ws.onclose = function (e) {
-		//当客户端收到服务端发送的关闭连接请求时,触发onclose事件
-		logger.info(e.code + ' ' + e.reason + ' ' + e.wasClean);
-	}
-	window.ws.onerror = function (e) {
-		//如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
-		console.log(error)
-	}
-	
-}
+  window.ws = new WebSocket(
+    "ws://" +
+      import.meta.env.VITE_APP_IP +
+      import.meta.env.VITE_APP_WS_API +
+      "/webStock/" +
+      getToken()
+    // 'ws://192.168.1.97:8300/webStock/' + window.localStorage.getItem('token')
+  );
+  //申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
+  window.ws.onopen = function () {
+    //当WebSocket创建成功时,触发onopen事件
+    console.log("open");
+    //每三十秒向后台发送一次心跳包
+    setInterval(() => {
+      window.ws.send('{"heartbeat":1111111}');
+    }, 30000);
+  };
+  window.ws.onmessage = function (e) {
+    //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
+    //在data.value前面插入
+    const res = JSON.parse(e.data);
+    console.log(res);
+
+    if (res.type == 1) {
+      index.value = 0;
+      data.value = res.list;
+      if (res.list.length > 0) value.value = true;
+    }
+    if (res.type == 2) {
+      emit("changeNum", res.count * 1);
+      proxy.$emit("openNotice");
+      getPushInfo();
+    }
+    if (res.type == 3) {
+      ElNotification({
+        title: "提示",
+        message: res.title,
+        position: "bottom-right",
+        duration: 0,
+      });
+    }
+  };
+  window.ws.onclose = function (e) {
+    //当客户端收到服务端发送的关闭连接请求时,触发onclose事件
+    logger.info(e.code + " " + e.reason + " " + e.wasClean);
+  };
+  window.ws.onerror = function (e) {
+    //如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
+    console.log(error);
+  };
+};
 let pushInfoReq = ref({
-	pageNum: 1,
-	pageSize: 5,
-	pushRead: 0,
-	type: '',
-	total:0,
-	whetherFlow:'',
-})
+  pageNum: 1,
+  pageSize: 5,
+  pushRead: 0,
+  type: "",
+  total: 0,
+  whetherFlow: "",
+});
 
 const handlePageChange = (val) => {
-	pushInfoReq.value.pageNum = val
-	getPushInfo()
-}
+  pushInfoReq.value.pageNum = val;
+  getPushInfo();
+};
 
-const loading = ref(false)
+const loading = ref(false);
 const getPushInfoInit = () => {
-	pushInfoReq.value.pageNum = 1
-	getPushInfo()
-}
+  pushInfoReq.value.pageNum = 1;
+  getPushInfo();
+};
 const getPushInfo = () => {
-	loading.value = true
-	proxy.post('/pushInfo/page',pushInfoReq.value).then(res=>{
-		noticeData.value = res.rows
-		pushInfoReq.value.total = res.total
-		setTimeout(() => {
-			loading.value = false
-			proxy.post('/pushInfo/page',{
-				pageNum: 1,
-				pageSize: 5,
-				pushRead: 0,
-				type: '',
-				total:0,
-				whetherFlow:'',
-			}).then(res=>{
-				emit('changeNum',res.total * 1)
-			})
-		}, 500);
-	})
-}
-socketInit()
+  loading.value = true;
+  proxy.post("/pushInfo/page", pushInfoReq.value).then((res) => {
+    noticeData.value = res.rows;
+    pushInfoReq.value.total = res.total;
+    loading.value = false;
+    // setTimeout(() => {
+    //   loading.value = false;
+    //   proxy
+    //     .post("/pushInfo/page", {
+    //       pageNum: 1,
+    //       pageSize: 5,
+    //       pushRead: 0,
+    //       type: "",
+    //       total: 0,
+    //       whetherFlow: "",
+    //     })
+    //     .then((res) => {
+    //       emit("changeNum", res.total * 1);
+    //     });
+    // }, 500);
+  });
+};
+socketInit();
 const handleClose = () => {
-	value.value = false
-}
+  value.value = false;
+};
 
 const openBottomBar = (type) => {
-	if (type == 1) {
-		ElNotification({
-			message: '您有一封新的邮件,请注意查收。',
-			type: 'warning',
-			position: 'bottom-right',
-		})
-	} else if (type == 2) {
-		value.value = true
-	} else {
-		noticeTableModal.value = true
-	}
-}
+  if (type == 1) {
+    ElNotification({
+      message: "您有一封新的邮件,请注意查收。",
+      type: "warning",
+      position: "bottom-right",
+    });
+  } else if (type == 2) {
+    value.value = true;
+  } else {
+    noticeTableModal.value = true;
+  }
+};
 </script>
 <style lang="scss">
 .notice-table-warp {
-	position: fixed;
-	right: 0;
-	top: 0;
-	width: 100%;
-	height: 100%;
-	z-index: 1000;
-	background: rgba(0, 0, 0, 0.1);
-	transition: all 0.3s ease-in-out;
-	opacity: 0;
-	display: none;
+  position: fixed;
+  right: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 1000;
+  background: rgba(0, 0, 0, 0.1);
+  transition: all 0.3s ease-in-out;
+  opacity: 0;
+  display: none;
 }
 
 .notice-table-warp-open {
-	opacity: 1;
-	display: block;
+  opacity: 1;
+  display: block;
 }
 .notice-table {
-	position: fixed;
-	right: 2px;
-	top: 52px;
-	padding: 0 20px 20px;
-	width: 500px;
-	background: #fff;
-	box-shadow: 0px 2px 20px 1px rgba(0, 0, 0, 0.1);
-	z-index: 20;
-	.notice-btn-box {
-		text-align: right;
-	}
-	.tabs {
-		display: flex;
-		justify-content: space-between;
-		height: 60px;
-		line-height: 60px;
-		font-size: 14px;
-		font-weight: 400;
-		ul {
-			display: flex;
-			margin: 23px 0;
-			padding: 0;
-			li {
-				list-style: none;
-				padding: 0 20px;
-				cursor: pointer;
-				height: 14px;
-				line-height: 14px;
-				border-left: 1px solid #dcdcdc;
-			}
-			.active {
-				color: #0084ff;
-			}
-		}
-		.more {
-			color: #0084ff;
-			cursor: pointer;
-		}
-	}
+  position: fixed;
+  right: 2px;
+  top: 52px;
+  padding: 0 20px 20px;
+  width: 500px;
+  background: #fff;
+  box-shadow: 0px 2px 20px 1px rgba(0, 0, 0, 0.1);
+  z-index: 20;
+  .notice-btn-box {
+    text-align: right;
+  }
+  .tabs {
+    display: flex;
+    justify-content: space-between;
+    height: 60px;
+    line-height: 60px;
+    font-size: 14px;
+    font-weight: 400;
+    ul {
+      display: flex;
+      margin: 23px 0;
+      padding: 0;
+      li {
+        list-style: none;
+        padding: 0 20px;
+        cursor: pointer;
+        height: 14px;
+        line-height: 14px;
+        border-left: 1px solid #dcdcdc;
+      }
+      .active {
+        color: #0084ff;
+      }
+    }
+    .more {
+      color: #0084ff;
+      cursor: pointer;
+    }
+  }
 }
 </style>
 <style>
-
-.noticeData-title{
-	width: 100%;
-	overflow: hidden;
-	text-overflow: ellipsis;
-	white-space: nowrap;
-	cursor: pointer;
+.noticeData-title {
+  width: 100%;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  cursor: pointer;
 }
 .commons-notice .el-table__row {
-	height: 50px;
+  height: 50px;
 }
 .commons-notice .el-dialog__footer {
-	text-align: left !important;
-	margin-top: 24px;
+  text-align: left !important;
+  margin-top: 24px;
 }
 .commons-notice .more {
-	color: #0084ff;
-	float: right;
-	cursor: pointer;
+  color: #0084ff;
+  float: right;
+  cursor: pointer;
 }
 .commons-notice .el-dialog__header {
-	background: #eeeeee;
+  background: #eeeeee;
 }
 .commons-notice .el-dialog__title {
-	position: relative;
-	padding-left: 30px;
-	color: #333333;
-	font-weight: bold;
+  position: relative;
+  padding-left: 30px;
+  color: #333333;
+  font-weight: bold;
 }
 .commons-notice .el-dialog__title::before {
-	content: ' ';
-	position: absolute;
-	left: 0;
-	top: 0;
-	width: 20px;
-	height: 20px;
-	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAftJREFUOE+tlT9MU1EUxr9zWwgBI/D6Boh/EnbCRiImMhBCGqNhcnDQrbgRAyxGBgYICzXYDbrB4OBENIaY4GAMrmqc3DQxMrxWNGkH0Hv83m0ptvS1EHqTm/fuO+f+zjn3nHueoGYoIFju7kGXGeTrJOd1qlwqq30HdJdzCwX7GY9+7QsX/yO4Ph66gHb0+EkiUzAyRklnrcHyugirb4jKYj/YlgUcHOlVgJrxLkLMHJVSEOmLAFV/Vt2j8SzUrsh0/ncodEDnmec9BswsYV1Vu1RD6+842zmvUR6vkRcAm0Y+vxR6Ku7MVv3bMFir65nVT/gZDNNgBw1+oM7ACe9DTy0e4GHwQnS5uxedbRs8s1t1w1S7I9O5cRfJU/8j9Ybq6ll9ieLhfdFM7w1IfDsyAacFAkXonySB3gokNhuZhNMDGcLfNIGJXWZ3pDVA+z4EfiXwaouA384GzDApEpEUlzXrgI1Dhn7B4cEITOwCYob1aK40iCYMuVlS1BLAY0GMz8ssWxMNdElpVjaaJ+RZCaJ3GbIXASyXTdPC1udAcK8E8TcJvNO4sJtePfsa/bmbDvIj8QrGTDS8ei6QsDkk/Hl2mpm6zUH0bSliGaU8bBLHQ7XA832CXLDomsORxLUvgDfGTJ2pfcGuc1+6qn1VoK1ssBXoOX8B/wDYqv5bje949AAAAABJRU5ErkJggg==);
+  content: " ";
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 20px;
+  height: 20px;
+  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAftJREFUOE+tlT9MU1EUxr9zWwgBI/D6Boh/EnbCRiImMhBCGqNhcnDQrbgRAyxGBgYICzXYDbrB4OBENIaY4GAMrmqc3DQxMrxWNGkH0Hv83m0ptvS1EHqTm/fuO+f+zjn3nHueoGYoIFju7kGXGeTrJOd1qlwqq30HdJdzCwX7GY9+7QsX/yO4Ph66gHb0+EkiUzAyRklnrcHyugirb4jKYj/YlgUcHOlVgJrxLkLMHJVSEOmLAFV/Vt2j8SzUrsh0/ncodEDnmec9BswsYV1Vu1RD6+842zmvUR6vkRcAm0Y+vxR6Ku7MVv3bMFir65nVT/gZDNNgBw1+oM7ACe9DTy0e4GHwQnS5uxedbRs8s1t1w1S7I9O5cRfJU/8j9Ybq6ll9ieLhfdFM7w1IfDsyAacFAkXonySB3gokNhuZhNMDGcLfNIGJXWZ3pDVA+z4EfiXwaouA384GzDApEpEUlzXrgI1Dhn7B4cEITOwCYob1aK40iCYMuVlS1BLAY0GMz8ssWxMNdElpVjaaJ+RZCaJ3GbIXASyXTdPC1udAcK8E8TcJvNO4sJtePfsa/bmbDvIj8QrGTDS8ei6QsDkk/Hl2mpm6zUH0bSliGaU8bBLHQ7XA832CXLDomsORxLUvgDfGTJ2pfcGuc1+6qn1VoK1ssBXoOX8B/wDYqv5bje949AAAAABJRU5ErkJggg==);
 }
 </style>

+ 1 - 1
src/views/JXSK/production/plan/index.vue

@@ -257,7 +257,7 @@ const formConfig = computed(() => {
       prop: "quantity",
       label: "计划数量",
       precision: 0,
-      min: 0,
+      min: 1,
       controls: false,
     },
     {

+ 57 - 19
src/views/JXSK/production/schedule/index.vue

@@ -4,6 +4,7 @@
       <byTable
         :source="sourceList.data"
         :pagination="sourceList.pagination"
+        :tableHeight="tableHeight"
         :config="config"
         :loading="loading"
         highlight-current-row
@@ -14,6 +15,18 @@
         @moreSearch="clickMoreSearch"
         @get-list="getList"
       >
+        <template #finishStatus="{ item }">
+          <div>
+            <span
+              style="padding: 4px; color: #fff"
+              :class="[item.finishStatus == 1 ? 'active' : 'disActive']"
+            >
+              {{
+                proxy.dictValueLabel(item.finishStatus, finishStatusData)
+              }}</span
+            >
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog
@@ -69,6 +82,11 @@ const sourceList = ref({
     getFinishTime: "",
   },
 });
+const tableHeight = ref(0);
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 275;
+};
+getTableHeight();
 const finishStatusData = ref([
   {
     label: "未完成",
@@ -109,7 +127,13 @@ const statusData = ref([
   },
 ]);
 
-const selectConfig = reactive([]);
+const selectConfig = reactive([
+  {
+    label: "完成状态",
+    prop: "getFinishStatus",
+    data: finishStatusData.value,
+  },
+]);
 const config = computed(() => {
   return [
     {
@@ -126,20 +150,20 @@ const config = computed(() => {
         width: 110,
       },
     },
-    {
-      attrs: {
-        label: "计划编号",
-        prop: "productionPlanCode",
-        width: 110,
-      },
-    },
-    {
-      attrs: {
-        label: "任务编号",
-        prop: "productionTaskCode",
-        width: 110,
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "计划编号",
+    //     prop: "productionPlanCode",
+    //     width: 110,
+    //   },
+    // },
+    // {
+    //   attrs: {
+    //     label: "任务编号",
+    //     prop: "productionTaskCode",
+    //     width: 110,
+    //   },
+    // },
     {
       attrs: {
         label: "产品SN",
@@ -163,6 +187,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "产品规格",
+        prop: "productSpec",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
         label: "任务完成期限",
         prop: "dueDate",
         width: 110,
@@ -192,12 +223,13 @@ const config = computed(() => {
     {
       attrs: {
         label: "完成状态",
-        prop: "finishStatus",
+        slot: "finishStatus",
         width: 80,
+        align: "center",
       },
-      render(finishStatus) {
-        return proxy.dictValueLabel(finishStatus, finishStatusData.value);
-      },
+      // render(finishStatus) {
+      //   return proxy.dictValueLabel(finishStatus, finishStatusData.value);
+      // },
     },
     {
       attrs: {
@@ -365,4 +397,10 @@ const moreSearchReset = () => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+.active {
+  background: #a6dd82;
+}
+.disActive {
+  background: #fa9841;
+}
 </style>

+ 222 - 78
src/views/JXSK/production/workOrder/index.vue

@@ -18,7 +18,7 @@
       >
         <template #arrangedQuantity="{ item }">
           <div
-            v-if="item.quantity > item.arrangedQuantity"
+            v-if="Number(item.productionQuantity) > item.arrangedQuantity"
             style="color: red; font-weight: 700"
           >
             {{ item.arrangedQuantity }}
@@ -27,10 +27,34 @@
             {{ item.arrangedQuantity }}
           </div>
         </template>
+
+        <template #isCustomized="{ item }">
+          <div>
+            <span
+              style="padding: 4px"
+              :class="[item.isCustomized == 1 ? 'active' : '']"
+            >
+              {{
+                proxy.dictValueLabel(item.isCustomized, isCustomizedData)
+              }}</span
+            >
+          </div>
+        </template>
+
+        <template #completionRate="{ item }">
+          <div style="width: 100%">
+            <el-progress
+              type="circle"
+              :percentage="Number(item.completionRate)"
+              width="100"
+              :status="Number(item.completionRate) == 100 ? 'success' : ''"
+            />
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog
-      :title="'调整BOM'"
+      :title="!isDetail ? '调整BOM' : '查看BOM'"
       v-model="dialogVisible"
       width="60%"
       v-loading="submitLoading"
@@ -55,6 +79,7 @@
               :rules="rules"
               label-width="0px"
               style="margin-top: 15px"
+              :disabled="formOption.disabled"
             >
               <el-table :data="formData.data.workOrderBomList">
                 <el-table-column prop="productCode" label="物料编码" />
@@ -101,6 +126,7 @@
           @click="submitForm(0)"
           size="large"
           :loading="submitLoading"
+          v-if="!isDetail"
         >
           暂 存
         </el-button>
@@ -109,6 +135,7 @@
           @click="submitForm(1)"
           size="large"
           :loading="submitLoading"
+          v-if="!isDetail"
         >
           提 交
         </el-button>
@@ -116,7 +143,7 @@
     </el-dialog>
 
     <el-dialog
-      title="调整工艺"
+      :title="!isDetailOne ? '调整工艺' : '查看工艺'"
       v-model="dialogVisibleOne"
       width="60%"
       v-loading="loadingOne"
@@ -124,7 +151,7 @@
     >
       <byForm
         :formConfig="formConfigOne"
-        :formOption="formOption"
+        :formOption="formOptionOne"
         v-model="formData.dataOne"
         :rules="rulesOne"
         ref="byformOne"
@@ -261,6 +288,7 @@
           @click="submitFormOne(0)"
           size="large"
           :loading="loadingOne"
+          v-if="!isDetailOne"
         >
           暂 存
         </el-button>
@@ -269,6 +297,7 @@
           @click="submitFormOne(1)"
           size="large"
           :loading="loadingOne"
+          v-if="!isDetailOne"
         >
           提 交
         </el-button>
@@ -284,7 +313,7 @@
     >
       <byForm
         :formConfig="formConfigTwo"
-        :formOption="formOption"
+        :formOption="formOptionTwo"
         v-model="formData.dataTwo"
         :rules="rulesTwo"
         ref="byformTwo"
@@ -361,6 +390,16 @@ let rulesOne = ref({
 const { proxy } = getCurrentInstance();
 const materialUnit = ref([]);
 const workOrderSource = ref([]);
+const isCustomizedData = ref([
+  {
+    label: "是",
+    value: "1",
+  },
+  {
+    label: "否",
+    value: "0",
+  },
+]);
 const selectConfig = computed(() => [
   {
     label: "工单来源",
@@ -370,16 +409,7 @@ const selectConfig = computed(() => [
   {
     label: "是否定制",
     prop: "isCustomized",
-    data: [
-      {
-        label: "是",
-        value: "1",
-      },
-      {
-        label: "否",
-        value: "0",
-      },
-    ],
+    data: isCustomizedData.value,
   },
 ]);
 
@@ -389,6 +419,7 @@ const config = computed(() => {
       attrs: {
         label: "工单来源",
         prop: "source",
+        width: 100,
       },
       render(source) {
         return proxy.dictValueLabel(source, workOrderSource.value);
@@ -398,64 +429,88 @@ const config = computed(() => {
       attrs: {
         label: "销售单号",
         prop: "contractCode",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "合同创建时间",
         prop: "contractCreateTime",
+        width: 155,
       },
     },
     {
       attrs: {
         label: "工单单号",
         prop: "code",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "产品名称",
         prop: "productName",
+        "min-width": 220,
       },
     },
     {
       attrs: {
-        label: "是否定制",
-        prop: "isCustomized",
+        label: "产品型号",
+        prop: "productSpec",
+        width: 100,
       },
-      render(isCustomized) {
-        return isCustomized == 1 ? "是" : "否";
+    },
+    {
+      attrs: {
+        label: "是否定制",
+        slot: "isCustomized",
+        width: 80,
       },
+      // render(isCustomized) {
+      //   return isCustomized == 1 ? "是" : "否";
+      // },
     },
     {
       attrs: {
         label: "工单数量",
         prop: "quantity",
+        width: 100,
       },
     },
     {
       attrs: {
-        type: "slot",
-        label: "已计划数量",
-        slot: "arrangedQuantity",
+        label: "计划出库数量",
+        prop: "aa",
+        width: 120,
       },
     },
     {
       attrs: {
-        label: "生产数量",
+        label: "计划生产数量",
         prop: "productionQuantity",
+        width: 120,
       },
     },
     {
       attrs: {
-        label: "完成率",
-        prop: "completionRate",
+        type: "slot",
+        label: "已计划数量",
+        slot: "arrangedQuantity",
+        width: 120,
       },
-      render(completionRate) {
-        if (completionRate !== undefined && completionRate !== "") {
-          return completionRate + "%";
-        }
+    },
+    {
+      attrs: {
+        label: "完成率",
+        slot: "completionRate",
+        width: 120,
+        align: "center",
       },
+      // render(completionRate) {
+      //   if (completionRate !== undefined && completionRate !== "") {
+      //     return completionRate + "%";
+      //   }
+      // },
     },
     {
       attrs: {
@@ -475,7 +530,20 @@ const config = computed(() => {
                 },
                 el: "button",
                 click() {
-                  getDtl(row);
+                  getDtl(row, false);
+                },
+              }
+            : {},
+          row.isCustomized == 1 && row.bomStatus
+            ? {
+                attrs: {
+                  label: "查看BOM",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row, true);
                 },
               }
             : {},
@@ -489,7 +557,20 @@ const config = computed(() => {
                 },
                 el: "button",
                 click() {
-                  getDtlOne(row);
+                  getDtlOne(row, false);
+                },
+              }
+            : {},
+          row.isCustomized == 1 && row.technologyStatus
+            ? {
+                attrs: {
+                  label: "查看工艺",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtlOne(row, true);
                 },
               }
             : {},
@@ -523,6 +604,21 @@ const formOption = reactive({
   labelWidth: 100,
   itemWidth: 100,
   rules: [],
+  disabled: false,
+});
+const formOptionOne = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+  disabled: false,
+});
+const formOptionTwo = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+  disabled: false,
 });
 const byform = ref(null);
 const byformOne = ref(null);
@@ -613,23 +709,78 @@ const openModal = () => {
 
 const submitForm = (type) => {
   byform.value.handleSubmit((valid) => {
-    formData.data.bomStatus = type;
-    submitLoading.value = true;
-    proxy.post("/workOrderBom/edit", formData.data).then(
-      (res) => {
-        ElMessage({
-          message: "操作成功",
-          type: "success",
-        });
-        dialogVisible.value = false;
-        submitLoading.value = false;
-        getList();
-      },
-      (err) => (submitLoading.value = false)
-    );
+    if (type) {
+      ElMessageBox.confirm(`你确定提交吗?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        formData.data.bomStatus = type;
+        submitLoading.value = true;
+        proxy.post("/workOrderBom/edit", formData.data).then(
+          (res) => {
+            ElMessage({
+              message: "操作成功",
+              type: "success",
+            });
+            dialogVisible.value = false;
+            submitLoading.value = false;
+            getList();
+          },
+          (err) => (submitLoading.value = false)
+        );
+      });
+    } else {
+      formData.data.bomStatus = type;
+      submitLoading.value = true;
+      proxy.post("/workOrderBom/edit", formData.data).then(
+        (res) => {
+          ElMessage({
+            message: "操作成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => (submitLoading.value = false)
+      );
+    }
   });
 };
+const submitApi = (type) => {
+  formData.dataOne.fileList = formData.dataOne.fileList.map((item) => {
+    return {
+      id: item.raw.id,
+      fileName: item.raw.fileName,
+      fileUrl: item.raw.fileUrl,
+      uploadState: item.raw.uploadState,
+    };
+  });
 
+  for (
+    let i = 0;
+    i < formData.dataOne.workOrderProductionProcessesList.length;
+    i++
+  ) {
+    const e = formData.dataOne.workOrderProductionProcessesList[i];
+    e.fileList = e.fileListCopy;
+  }
+  formData.dataOne.technologyStatus = type;
+  loadingOne.value = true;
+  proxy.post("/workOrderProductionProcesses/edit", formData.dataOne).then(
+    (res) => {
+      ElMessage({
+        message: "操作成功",
+        type: "success",
+      });
+      dialogVisibleOne.value = false;
+      loadingOne.value = false;
+      getList();
+    },
+    (err) => (loadingOne.value = false)
+  );
+};
 const submitFormOne = (type) => {
   byformOne.value.handleSubmit((valid) => {
     // for (
@@ -645,41 +796,23 @@ const submitFormOne = (type) => {
     //     });
     //   }
     // }
-    formData.dataOne.fileList = formData.dataOne.fileList.map((item) => {
-      return {
-        id: item.raw.id,
-        fileName: item.raw.fileName,
-        fileUrl: item.raw.fileUrl,
-        uploadState: item.raw.uploadState,
-      };
-    });
-
-    for (
-      let i = 0;
-      i < formData.dataOne.workOrderProductionProcessesList.length;
-      i++
-    ) {
-      const e = formData.dataOne.workOrderProductionProcessesList[i];
-      e.fileList = e.fileListCopy;
+    if (type) {
+      ElMessageBox.confirm(`你确定提交吗?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        submitApi(type);
+      });
+    } else {
+      submitApi(type);
     }
-    formData.dataOne.technologyStatus = type;
-    loadingOne.value = true;
-    proxy.post("/workOrderProductionProcesses/edit", formData.dataOne).then(
-      (res) => {
-        ElMessage({
-          message: "操作成功",
-          type: "success",
-        });
-        dialogVisibleOne.value = false;
-        loadingOne.value = false;
-        getList();
-      },
-      (err) => (loadingOne.value = false)
-    );
   });
 };
-
-const getDtl = (row) => {
+const isDetail = ref(false);
+const getDtl = (row, flag) => {
+  isDetail.value = flag;
+  formOption.disabled = flag;
   modalType.value = "edit";
   proxy.post("/workOrderBom/list", { workOrderId: row.id }).then((res) => {
     formData.data = {
@@ -714,7 +847,10 @@ const initSort = () => {
     },
   });
 };
-const getDtlOne = (row) => {
+const isDetailOne = ref(false);
+const getDtlOne = (row, flag) => {
+  isDetailOne.value = flag;
+  formOptionOne.disabled = flag;
   modalType.value = "edit";
   proxy
     .post("/workOrderProductionProcesses/list", { workOrderId: row.id })
@@ -903,4 +1039,12 @@ const submitFormTwo = (type) => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+
+.active {
+  background: #a6dd82;
+  color: #fff;
+}
+.disActive {
+  background: #fa9841;
+}
 </style>

+ 72 - 42
src/views/JXSK/salesMange/contract/index.vue

@@ -41,6 +41,7 @@
               <el-select
                 v-model="formData.data.sellCorporationId"
                 @change="changeSellId"
+                style="width: 100%"
               >
                 <el-option
                   v-for="item in corporationList"
@@ -51,9 +52,9 @@
               </el-select>
             </el-form-item>
             <el-row>
-              <el-col :span="13">
+              <el-col :span="24">
                 <el-row style="margin-top: 20px; width: 100%">
-                  <el-col :span="8">
+                  <el-col :span="7">
                     <el-form-item label="地址" prop="sellCountryName">
                       <el-input
                         v-model="formData.data.sellCountryName"
@@ -71,7 +72,7 @@
                     </el-form-item>
                   </el-col>
                   <el-col :span="1"></el-col>
-                  <el-col :span="7">
+                  <el-col :span="8">
                     <el-form-item label=" " prop="sellCityName">
                       <el-input
                         v-model="formData.data.sellCityName"
@@ -102,6 +103,7 @@
                 v-model="formData.data.shroffAccountId"
                 placeholder="请选择收款账号"
                 @change="changeShroffAccount"
+                style="width: 100%"
               >
                 <el-option
                   v-for="item in accountList"
@@ -113,7 +115,7 @@
             </el-form-item>
 
             <el-row style="margin-top: 20px">
-              <el-col :span="6">
+              <el-col :span="11">
                 <el-form-item label="账户名" prop="sellAccountName">
                   <el-input
                     v-model="formData.data.sellAccountName"
@@ -129,7 +131,7 @@
                 </el-form-item>
               </el-col>
               <el-col :span="1"></el-col>
-              <el-col :span="6">
+              <el-col :span="12">
                 <el-form-item label="开户行" prop="sellOpeningBank">
                   <el-input
                     v-model="formData.data.sellOpeningBank"
@@ -226,6 +228,8 @@
                     <el-input
                       v-model="row.productRemark"
                       placeholder="请输入"
+                      type="textarea"
+                      :rows="3"
                     />
                   </el-form-item>
                 </template>
@@ -443,6 +447,9 @@ const formConfig = computed(() => {
       required: true,
       filterable: true,
       data: customerData.value,
+      style: {
+        width: "100%",
+      },
     },
     {
       type: "date",
@@ -450,6 +457,17 @@ const formConfig = computed(() => {
       prop: "deliveryDate",
       label: "交货期限",
       required: true,
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "deliveryDateRemark",
+      label: "交货期备注",
+      itemWidth: 70,
     },
     {
       type: "select",
@@ -457,6 +475,17 @@ const formConfig = computed(() => {
       label: "付款方式",
       required: true,
       data: payMethodData.value,
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "payMethodRemark",
+      label: "付款方式备注",
+      itemWidth: 70,
     },
     {
       type: "select",
@@ -464,6 +493,15 @@ const formConfig = computed(() => {
       label: "运费支付方",
       required: true,
       data: freightPayerData.value,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remark",
+      label: "备注",
     },
     {
       type: "number",
@@ -473,27 +511,10 @@ const formConfig = computed(() => {
       precision: 2,
       min: 0,
       controls: false,
-      // style: {
-      //   width: "100%",
-      // },
-    },
-    {
-      type: "input",
-      itemType: "textarea",
-      prop: "deliveryDateRemark",
-      label: "交货期备注",
-    },
-    {
-      type: "input",
-      itemType: "textarea",
-      prop: "payMethodRemark",
-      label: "付款方式备注",
-    },
-    {
-      type: "input",
-      itemType: "textarea",
-      prop: "remark",
-      label: "备注",
+      itemWidth: 30,
+      style: {
+        width: "100%",
+      },
     },
     {
       type: "slot",
@@ -623,24 +644,33 @@ getDict();
 getList();
 const openProduct = ref(false);
 const handleSelect = (row) => {
-  const flag = formData.data.salesContractDetailsList.some(
-    (x) => x.productId === row.id
-  );
-  if (!flag) {
-    formData.data.salesContractDetailsList.push({
-      productName: row.name + ` (${row.spec})`,
-      productId: row.id,
-      quantity: null,
-    });
-    return ElMessage({
-      message: "选择成功",
-      type: "success",
-    });
-  }
+  formData.data.salesContractDetailsList.push({
+    productName: row.name + ` (${row.spec})`,
+    productId: row.id,
+    quantity: null,
+  });
   return ElMessage({
-    message: "该产品已选择",
-    type: "info",
+    message: "选择成功",
+    type: "success",
   });
+  // const flag = formData.data.salesContractDetailsList.some(
+  //   (x) => x.productId === row.id
+  // );
+  // if (!flag) {
+  //   formData.data.salesContractDetailsList.push({
+  //     productName: row.name + ` (${row.spec})`,
+  //     productId: row.id,
+  //     quantity: null,
+  //   });
+  //   return ElMessage({
+  //     message: "选择成功",
+  //     type: "success",
+  //   });
+  // }
+  // return ElMessage({
+  //   message: "该产品已选择",
+  //   type: "info",
+  // });
 };
 const handleRemove = (index) => {
   formData.data.salesContractDetailsList.splice(index, 1);