jiangbiao преди 7 месеца
родител
ревизия
8bec01b9db

+ 29 - 24
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrAboveallController.java

@@ -7,14 +7,8 @@ import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.pssr.domain.TPssrAboveall;
-import com.ruoyi.project.pssr.domain.TPssrMaterial;
-import com.ruoyi.project.pssr.domain.TPssrPatrol;
-import com.ruoyi.project.pssr.domain.TPssrSubcontent;
-import com.ruoyi.project.pssr.service.ITPssrAboveallService;
-import com.ruoyi.project.pssr.service.ITPssrMaterialService;
-import com.ruoyi.project.pssr.service.ITPssrPatrolService;
-import com.ruoyi.project.pssr.service.ITPssrSubcontentService;
+import com.ruoyi.project.pssr.domain.*;
+import com.ruoyi.project.pssr.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -44,6 +38,9 @@ public class TPssrAboveallController extends BaseController {
     @Autowired
     private ITPssrMaterialService tPssrMaterialService;
 
+    @Autowired
+    private ITPssrMaterialRawService tPssrMaterialRawService;
+
     /**
      * 查询PSSR列表
      */
@@ -160,7 +157,7 @@ public class TPssrAboveallController extends BaseController {
                     }, "新增便携式检测仪数据").start();
                 }else if (subcontent.getForShort().equals("yfl")) {
                     new Thread(() -> {
-                        genYfl(subcontent.getId());
+                        genYfl(subcontent.getId(),userId);
                     }, "新增原辅料数据").start();
                 }
             }
@@ -175,21 +172,29 @@ public class TPssrAboveallController extends BaseController {
         return tPssrPatrol;
     }
 
-    private void genYfl(Long subId) {
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Electr. Power", "MWH", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "LP steam", "/", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "MP steam", "/", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "HP steam", "Ton", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Potable water", "Ton", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "production water", "Ton", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "LP fire water", "/", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "HP fire water", "/", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Cooling water", "Ton", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Demine Water", "Ton", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Nitrogen", "Nm3", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Plant Air", "Nm3", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Instrument Air", "Nm3", getUserId().toString(), new Date(), 0L));
-        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "WW(only quantity)", "Ton", getUserId().toString(), new Date(), 0L));
+    private void genYfl(Long subId, String userId) {
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Electr. Power", "MWH", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "LP steam", "/", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "MP steam", "/", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "HP steam", "Ton", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Potable water", "Ton", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "production water", "Ton", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "LP fire water", "/", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "HP fire water", "/", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Cooling water", "Ton", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Demine Water", "Ton", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Nitrogen", "Nm3", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Plant Air", "Nm3", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Instrument Air", "Nm3", userId, new Date(), 0L));
+        tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "WW(only quantity)", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Naphtha", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Flux Oil", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Wash Oil", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "C6-C8", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Natural Gas", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Ethylene", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Propylene", "Ton", userId, new Date(), 0L));
+        tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Toluene", "Ton", userId, new Date(), 0L));
     }
 
     /**

+ 5 - 0
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrApproveController.java

@@ -273,6 +273,7 @@ public class TPssrApproveController extends BaseController {
             case "hbss"://环保设施
                 break;
             case "yfl"://原辅料
+                doYflApprove(tPssrSubcontent);
                 break;
             case "jb"://机泵
                 break;
@@ -1800,6 +1801,10 @@ public class TPssrApproveController extends BaseController {
         }
     }
 
+    private void doYflApprove(TPssrSubcontent sub) {
+        String userId = getUserId().toString();
+    }
+
     /**
      * 单确认人发起流程
      */

+ 53 - 12
ui/src/views/pssr/material/index.vue

@@ -141,19 +141,36 @@
     <el-table v-loading="loading" :data="materialList" @selection-change="handleSelectionChange" :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="审批状态" align="center" prop="approveStatus" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.approveStatus==0">未审批</el-tag>
+          <el-tag v-if="scope.row.approveStatus==1" type="warning">待确认</el-tag>
+          <el-tag v-if="scope.row.approveStatus==3" type="success">已确认1</el-tag>
+          <el-tag v-if="scope.row.approveStatus==2" type="success">已确认2</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="Utility consumption quantity" align="center" prop="utilityQuantity"
                        :show-overflow-tooltip="true"/>
       <el-table-column label="Quantity" align="center" prop="quantity" :show-overflow-tooltip="true"/>
       <el-table-column label="Unit" align="center" prop="unit" :show-overflow-tooltip="true"/>
       <el-table-column label="Note" align="center" prop="note" :show-overflow-tooltip="true"/>
-      <el-table-column label="确认人" align="center" prop="confirm" :show-overflow-tooltip="true"/>
-      <el-table-column label="确认时间" align="center" prop="confirmationDate" width="100">
+      <el-table-column label="确认人1" align="center" prop="confirm1" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span>{{ userFormat(scope.row.confirm1) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="确认人2" align="center" prop="confirm2" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span>{{ userFormat(scope.row.confirm2) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="确认时间" align="center" prop="confirmationDate">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.confirmationDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -186,20 +203,27 @@
     <!-- 添加或修改原料对话框 -->
     <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="Utility consumption quantity" prop="utilityQuantity">
-          <el-input v-model="form.utilityQuantity" placeholder="请输入Utility consumption quantity"/>
-        </el-form-item>
         <el-form-item label="Quantity" prop="quantity">
           <el-input v-model="form.quantity" placeholder="请输入Quantity"/>
         </el-form-item>
-        <el-form-item label="Unit" prop="unit">
-          <el-input v-model="form.unit" placeholder="请输入Unit"/>
-        </el-form-item>
         <el-form-item label="Note" prop="note">
           <el-input v-model="form.note" placeholder="请输入Note"/>
         </el-form-item>
-        <el-form-item label="确认人" prop="confirm">
-          <el-input v-model="form.confirm" placeholder="请输入确认人"/>
+        <el-form-item label="确认人1" prop="confirm1">
+          <el-select v-model="form.confirm1" filterable placeholder="请选择确认人1">
+            <el-option v-for="user in userOptions"
+                       :label="user.nickName"
+                       :value="user.userId+''"
+                       :key="user.userId"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="确认人2" prop="confirm2">
+          <el-select v-model="form.confirm2" filterable placeholder="请选择确认人1">
+            <el-option v-for="user in userOptions"
+                       :label="user.nickName"
+                       :value="user.userId+''"
+                       :key="user.userId"/>
+          </el-select>
         </el-form-item>
         <el-form-item label="备注" prop="remarks">
           <el-input v-model="form.remarks" placeholder="请输入备注"/>
@@ -260,6 +284,7 @@ import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {doApprove} from "@/api/pssr/approve";
+import {listUserNoPage} from "@/api/system/user";
 
 export default {
   dicts: ['pssr_approve_status'],
@@ -277,6 +302,7 @@ export default {
   },
   data() {
     return {
+      userOptions: [],
       // 遮罩层
       loading: true,
       // 选中数组
@@ -335,7 +361,19 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {}
+      rules: {
+        note: [
+          {required: true, message: "Note不能为空", trigger: "blur"}
+        ],
+        quantity: [
+          {required: true, message: "Quantity不能为空", trigger: "blur"}
+        ],
+        confirm1: [
+          {required: true, message: "确认人1不能为空", trigger: "blur"}
+        ],
+        confirm2: [
+          {required: true, message: "确认人2不能为空", trigger: "blur"}
+        ],}
     };
   },
   watch: {
@@ -351,6 +389,9 @@ export default {
     })
     this.getList();
     this.getTreeselect();
+    listUserNoPage({}).then(res => {
+      this.userOptions = res.data
+    });
   },
   methods: {
     /** 查询原料列表 */

+ 70 - 15
ui/src/views/pssr/materialRaw/index.vue

@@ -138,22 +138,40 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="materialRawList" @selection-change="handleSelectionChange" :height="clientHeight"
+    <el-table v-loading="loading" :data="materialRawList" @selection-change="handleSelectionChange"
+              :height="clientHeight"
               border>
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="Raw material" align="center" prop="utilityQuantity"
+      <el-table-column label="审批状态" align="center" prop="approveStatus" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.approveStatus==0">未审批</el-tag>
+          <el-tag v-if="scope.row.approveStatus==1" type="warning">待确认</el-tag>
+          <el-tag v-if="scope.row.approveStatus==3" type="success">已确认1</el-tag>
+          <el-tag v-if="scope.row.approveStatus==2" type="success">已确认2</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="Raw material" align="center" prop="rawMaterial"
                        :show-overflow-tooltip="true"/>
       <el-table-column label="Quantity" align="center" prop="quantity" :show-overflow-tooltip="true"/>
       <el-table-column label="Unit" align="center" prop="unit" :show-overflow-tooltip="true"/>
       <el-table-column label="Note" align="center" prop="note" :show-overflow-tooltip="true"/>
-      <el-table-column label="确认人" align="center" prop="confirm" :show-overflow-tooltip="true"/>
-      <el-table-column label="确认时间" align="center" prop="confirmationDate" width="100">
+      <el-table-column label="确认人1" align="center" prop="confirm1" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span>{{ userFormat(scope.row.confirm1) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="确认人2" align="center" prop="confirm2" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span>{{ userFormat(scope.row.confirm2) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="确认时间" align="center" prop="confirmationDate">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.confirmationDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -171,6 +189,16 @@
             v-hasPermi="['pssr:materialRaw:remove']"
           >删除
           </el-button>
+          <el-col :span="1.5">
+            <el-button
+              type="success"
+              icon="el-icon-edit"
+              size="mini"
+              :disabled="multiple"
+              @click="handleBatch"
+              v-hasPermi="['pssr:materialRaw:edit']"
+            >批量操作</el-button>
+          </el-col>
         </template>
       </el-table-column>
     </el-table>
@@ -186,20 +214,27 @@
     <!-- 添加或修改原料对话框 -->
     <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="Raw Material" prop="utilityQuantity">
-          <el-input v-model="form.utilityQuantity" placeholder="请输入Raw Material"/>
-        </el-form-item>
         <el-form-item label="Quantity" prop="quantity">
           <el-input v-model="form.quantity" placeholder="请输入Quantity"/>
         </el-form-item>
-        <el-form-item label="Unit" prop="unit">
-          <el-input v-model="form.unit" placeholder="请输入Unit"/>
-        </el-form-item>
         <el-form-item label="Note" prop="note">
           <el-input v-model="form.note" placeholder="请输入Note"/>
         </el-form-item>
-        <el-form-item label="确认人" prop="confirm">
-          <el-input v-model="form.confirm" placeholder="请输入确认人"/>
+        <el-form-item label="确认人1" prop="confirm1">
+          <el-select v-model="form.confirm1" filterable placeholder="请选择确认人1">
+            <el-option v-for="user in userOptions"
+                       :label="user.nickName"
+                       :value="user.userId+''"
+                       :key="user.userId"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="确认人2" prop="confirm2">
+          <el-select v-model="form.confirm2" filterable placeholder="请选择确认人1">
+            <el-option v-for="user in userOptions"
+                       :label="user.nickName"
+                       :value="user.userId+''"
+                       :key="user.userId"/>
+          </el-select>
         </el-form-item>
         <el-form-item label="备注" prop="remarks">
           <el-input v-model="form.remarks" placeholder="请输入备注"/>
@@ -250,7 +285,9 @@ import {
   addMaterialRaw,
   delMaterialRaw,
   exportMaterialRaw,
-  getMaterialRaw, handleConfirmMaterialRaw, handleTurnDownMaterialRaw,
+  getMaterialRaw,
+  handleConfirmMaterialRaw,
+  handleTurnDownMaterialRaw,
   importTemplate,
   listMaterialRaw,
   updateMaterialRaw
@@ -260,6 +297,7 @@ import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {doApprove} from "@/api/pssr/approve";
+import {listUserNoPage} from "@/api/system/user";
 
 export default {
   dicts: ['pssr_approve_status'],
@@ -277,6 +315,7 @@ export default {
   },
   data() {
     return {
+      userOptions: [],
       // 遮罩层
       loading: true,
       // 选中数组
@@ -335,7 +374,20 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {}
+      rules: {
+        note: [
+          {required: true, message: "Note不能为空", trigger: "blur"}
+        ],
+        quantity: [
+          {required: true, message: "Quantity不能为空", trigger: "blur"}
+        ],
+        confirm1: [
+          {required: true, message: "确认人1不能为空", trigger: "blur"}
+        ],
+        confirm2: [
+          {required: true, message: "确认人2不能为空", trigger: "blur"}
+        ],
+      }
     };
   },
   watch: {
@@ -351,6 +403,9 @@ export default {
     })
     this.getList();
     this.getTreeselect();
+    listUserNoPage({}).then(res => {
+      this.userOptions = res.data
+    });
   },
   methods: {
     /** 查询原料列表 */