浏览代码

生产工单

baishaojie 1 月之前
父节点
当前提交
1c36f2e01a

+ 2 - 2
.env.development

@@ -19,9 +19,9 @@ ENV = 'development'
 
  
  
-# VUE_APP_BASE_API = 'http://210.16.189.72:8099/'
+VUE_APP_BASE_API = 'http://210.16.189.72:8099/'
 # 本地
-VUE_APP_BASE_API = 'http://localhost:8082/'
+# VUE_APP_BASE_API = 'http://localhost:8082/'
  
  
  

+ 85 - 85
src/utils/request.js

@@ -5,108 +5,108 @@ import { getToken } from '@/utils/auth'
 
 // create an axios instance
 const service = axios.create({
-  baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
-  withCredentials: true, // send cookies when cross-domain requests
-  timeout: 60000 // request timeout
+    baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
+    withCredentials: true, // send cookies when cross-domain requests
+    timeout: 60000 // request timeout
 })
 
 // request interceptor
 service.interceptors.request.use(
-  config => {
-    // do something before request is sent
-    // config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'  //此处是增加的代码,设置请求头的类型
-    if (process.env.VUE_APP_BASE_API !== '/dev-api') {
-      config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
-      config.withCredentials = false
-    }
+    config => {
+        // do something before request is sent
+        // config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'  //此处是增加的代码,设置请求头的类型
+        if (process.env.VUE_APP_BASE_API !== '/dev-api') {
+            config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
+            config.withCredentials = false
+        }
 
-    if (store.getters.token) {
-      // let each request carry token
-      // ['Authorization'] is a custom headers key
-      // please modify it according to the actual situation
-      if (process.env.VUE_APP_BASE_API === '/dev-api') {
-        config.headers['X-Token'] = getToken()
-      } else {
-        config.headers['token'] = getToken()
-      }
+        if (store.getters.token) {
+            // let each request carry token
+            // ['Authorization'] is a custom headers key
+            // please modify it according to the actual situation
+            if (process.env.VUE_APP_BASE_API === '/dev-api') {
+                config.headers['X-Token'] = getToken()
+            } else {
+                config.headers['token'] = getToken()
+            }
+        }
+        return config
+    },
+    error => {
+        // do something with request error
+        console.log(error) // for debug
+        return Promise.reject(error)
     }
-    return config
-  },
-  error => {
-    // do something with request error
-    console.log(error) // for debug
-    return Promise.reject(error)
-  }
 )
 
 // response interceptor
 service.interceptors.response.use(
-  /**
-   * If you want to get http information such as headers or status
-   * Please return  response => response
-  */
+    /**
+     * If you want to get http information such as headers or status
+     * Please return  response => response
+     */
 
-  /**
-   * Determine the request status by custom code
-   * Here is just an example
-   * You can also judge the status by HTTP Status Code
-   */
-  response => {
-    const res = response.data
+    /**
+     * Determine the request status by custom code
+     * Here is just an example
+     * You can also judge the status by HTTP Status Code
+     */
+    response => {
+        const res = response.data
 
-    // if the custom code is not 20000, it is judged as an error.
-    if (res.code !== 200) {
-      var isBlob = res instanceof Blob
+        // if the custom code is not 20000, it is judged as an error.
+        if (res.code !== 200) {
+            var isBlob = res instanceof Blob
 
-      //判断是不是Blob文件流 ,如果是文件流就不用提示错误信息,不是的话就按正常请求走
-      if(isBlob){
+            //判断是不是Blob文件流 ,如果是文件流就不用提示错误信息,不是的话就按正常请求走
+            if (isBlob) {
 
-      }else{
-        Message({
-          // message: res.msg + res.code,
-          message: '请求超时',
-          type: 'error',
-          duration: 5 * 1000
-        })
+            } else {
+                Message({
+                    // message: res.msg + res.code,
+                    message: '请求超时',
+                    type: 'error',
+                    duration: 5 * 1000
+                })
 
-      }
+            }
 
-      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
-      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
-        // to re-login
-        MessageBox.confirm('你已经注销登陆,你可以取消或重新登陆', '确认注销', {
-          confirmButtonText: '重新登陆',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          store.dispatch('user/resetToken').then(() => {
-            location.reload()
-          })
-        })
-      }
-      if (res.code === 20002) {
-        store.dispatch('user/resetToken').then(() => {
-          location.reload()
+            // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
+            if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
+                // to re-login
+                MessageBox.confirm('你已经注销登陆,你可以取消或重新登陆', '确认注销', {
+                    confirmButtonText: '重新登陆',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    store.dispatch('user/resetToken').then(() => {
+                        location.reload()
+                    })
+                })
+            }
+            if (res.code === 20002) {
+                store.dispatch('user/resetToken').then(() => {
+                    location.reload()
+                })
+            }
+            if (res.code === undefined) {
+                return res
+            } else {
+                return Promise.reject(new Error(res.message || 'Error'))
+            }
+        } else {
+            return res
+        }
+    },
+    error => {
+        console.log('err' + error) // for debug
+        Message({
+            message: error.message,
+            type: 'error',
+            duration: 5 * 1000
         })
-      }
-      if (res.code === undefined) {
-        return res
-      } else {
-        return Promise.reject(new Error(res.message || 'Error'))
-      }
-    } else {
-      return res
+        return Promise.reject(error)
     }
-  },
-  error => {
-    console.log('err' + error) // for debug
-    Message({
-      message: error.message,
-      type: 'error',
-      duration: 5 * 1000
-    })
-    return Promise.reject(error)
-  }
 )
 
-export default service
+export default service

+ 11 - 11
src/views/productManagement/installationOrder/components/DailyWriteDialog.vue

@@ -11,17 +11,17 @@
   >
     <div class="service-info">
       <div class="info-item">
-        <span class="label">客户:</span>
-        <span class="value">{{ rowData?.customerName || "" }}</span>
-      </div>
-      <div class="info-item">
-        <span class="label">预计完成时间:</span>
-        <span class="value">{{ rowData?.estimatedCompleteTime || "" }}</span>
-      </div>
-      <div class="info-item">
-        <span class="label">服务人员:</span>
-        <span class="value">{{ rowData?.serviceStaffNames || "" }}</span>
-      </div>
+  <span class="label">客户:</span>
+  <span class="value">{{ (rowData && rowData.customerName) || "暂无客户信息" }}</span>
+</div>
+<div class="info-item">
+  <span class="label">预计完成时间:</span>
+  <span class="value">{{ (rowData && rowData.estimatedCompleteTime) || "未设置" }}</span>
+</div>
+<div class="info-item">
+  <span class="label">服务人员:</span>
+  <span class="value">{{ (rowData && rowData.serviceStaffNames) || "未分配" }}</span>
+</div>
     </div>
 
     <div class="table-header">

+ 29 - 19
src/views/productManagement/processConfiguration/index.vue

@@ -1,24 +1,33 @@
 <template>
 <div>
     <div style="margin-top: 10px;">
-        <el-row :gutter="20">
-
-            <el-col :span="4">
-                <el-card style="height: 100%; min-height: 100vh;">
-                    <span style="margin-left: 10px;margin-top: 10px;font-size: 20px;">生产工序配置</span>
-                <el-button v-waves class="search-button"  type="primary" icon="el-icon-thumb"  @click="handleControls">操作</el-button>
-                <br>
-                <div style="marginTop:20px;margin-left: 10px;">
-                    <el-tree
-                    :data="processList"
-                    v-model="getProcessDetailsParm.parammaps.processId"
-                    :props="defaultProps"
-                    @node-click="handleNodeClick"
-                    :disabled="false"
-                    ></el-tree>
-                </div>
-            </el-card>
-            </el-col>
+      <el-row :gutter="20">
+      <!-- 左侧树形结构 -->
+      <el-col :span="4">
+        <el-card class="tree-card">
+          <div class="card-header">
+            <span style="margin-left: 10px;margin-top: 10px;font-size: 20px;">生产工序配置</span>
+            <el-button 
+              v-waves 
+              type="primary" 
+              icon="el-icon-thumb" 
+              @click="handleControls"
+              class="operation-btn"
+            >
+              操作
+            </el-button>
+          </div>
+          
+          <el-tree
+            :data="processList"
+            :props="defaultProps"
+            @node-click="handleNodeClick"
+            :highlight-current="true"
+            class="process-tree"
+          ></el-tree>
+        </el-card>
+      </el-col>
+
 
             <el-col :span="18">
                 <el-button v-if="this.pid != 0"  v-waves class="search-button"  type="primary" icon="el-icon-circle-plus-outline"  @click="handleProcessRecordsAdd">新增</el-button>
@@ -28,10 +37,11 @@
           v-loading="listLoading"
           element-loading-text="给我一点时间"
           :data="list"
+ 
           border
           fit
           highlight-current-row
-          style="width: 100%;margin-top: 20px;"
+          style="width: 100%;margin-top: 20px;height: 800px;"
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"

+ 78 - 31
src/views/productManagement/productionWorkOrder/index.vue

@@ -1701,12 +1701,9 @@ import "element-ui/lib/theme-chalk/index.css";
 import Cookies from "js-cookie";
 import {
   GetDataByName,
-  postJson,
-  GetDataByNames,
   checkButtons,
   PostDataByName,
   ExecDataByConfig,
-  GetAccount,
   transData,
   handleWechatPushOfWorkOrder,
 } from "@/api/common";
@@ -1806,10 +1803,12 @@ export default {
         ],
       },
       goodsList: [],
+      roleEmpList:[],
       createProductionOrderParm: {},
       createProductionOrderWorkParm: {},
       editProductionOrderGoodsCountParn: {},
       getEmployeesSelectParm: { name: "getEmployeesSelect" },
+      getEmployeesRoleParm: { name: "getuserbyrole" , parammaps: {"name":"生产人员"} },
       getProductionOrderProcessParm: {
         name: "getProductionOrderProcess",
         parammaps: {},
@@ -1946,7 +1945,7 @@ export default {
         ProductionWorkOrderFillout
       );
       this.isProductionWorkOrderFillout = isProductionWorkOrderFillout;
-      console.log(this.isProductionWorkOrderFillout);
+      // console.log(this.isProductionWorkOrderFillout);
 
       const ProductionWorkOrderComplete =
         "productManagement:productionWorkOrder:complete";
@@ -2009,8 +2008,7 @@ export default {
       );
     },
     handleGetProductionOrderProcessExcel() {
-      console.log(this.getProductionOrderProcessParm);
-
+      // console.log(this.getProductionOrderProcessParm);
       if (
         this.getProductionOrderProcessParm.parammaps.inputDatetime2 !==
           undefined &&
@@ -2172,6 +2170,20 @@ export default {
         PostDataByName(this.completeProductionParm).then((response) => {
           if (response.msg !== "fail") {
             this.get_production_work_order();
+            for (let i = 0; i < this.roleEmpList.length; i++) {
+                var send_weixin_data1 = {
+                  name: "getRemindData",
+                  parammaps: {
+                    userId: this.roleEmpList[i].id,
+                    remindId: 85,
+                    remindTypeName: "生产工单",
+                    rowId: row.id,
+                  },
+                };
+                handleWechatPushOfWorkOrder(send_weixin_data1, 85).catch((error) => {
+                  console.error("微信推送失败:", error);
+                });
+              }
             this.$notify({
               title: "成功",
               message: "完成计划",
@@ -2196,6 +2208,20 @@ export default {
           (response) => {
             if (response.msg !== "fail") {
               this.get_production_work_order();
+              for (let i = 0; i < this.roleEmpList.length; i++) {
+                var send_weixin_data1 = {
+                  name: "getRemindData",
+                  parammaps: {
+                    userId: this.roleEmpList[i].id,
+                    remindId: 83,
+                    remindTypeName: "生产工单",
+                    rowId: row.id,
+                  },
+                };
+                handleWechatPushOfWorkOrder(send_weixin_data1, 83).catch((error) => {
+                  console.error("微信推送失败:", error);
+                });
+              }
               this.$notify({
                 title: "成功",
                 message: "开始生产",
@@ -2223,14 +2249,12 @@ export default {
     },
 
     handleProcessRecordsDel(row) {
-      console.log(row);
       this.processRecordsListAdd = this.processRecordsListAdd.filter(
         (item) => item.id !== row.id
       );
     },
 
     handleEditProcessRecordsDel(row) {
-      console.log(row);
       this.processRecordsList = this.processRecordsList.filter(
         (item) => item.id !== row.id
       );
@@ -2388,11 +2412,9 @@ export default {
     },
     handleMenuSelect(index) {
       this.activeMenuItem = index; // 更新选中的菜单项
-      console.log(this.activeMenuItem);
     },
     form_search() {},
     changeAll() {
-      console.log(this.radioAll);
       this.getProductionWorkOrder.parammaps.radioAll = this.radioAll;
       this.get_production_work_order();
     },
@@ -2406,7 +2428,6 @@ export default {
       this.isOrderTakingData.accepterName = Cookies.get("employename");
     },
     handleOrderTakingById(row) {
-      console.log(row);
       this.dialogTitle = "确认反馈";
       this.isOrderTaking = true;
       this.isOrderTakingData.acceptTime = this.getDefaultDate();
@@ -2455,7 +2476,6 @@ export default {
       this.isFillInDailyData.days_diff = row.days_diff;
       this.isFillInDailyData.estimatedCompletionTime =
         row.estimatedCompletionTime;
-      console.log(row);
       this.getProductionOrderGoodsFillOutParm.parammaps.id = row.id;
       this.getProductionOrderGoodsFillOutParm.parammaps.empId =
         Cookies.get("employeid");
@@ -2480,6 +2500,7 @@ export default {
     },
     handleTurnDown(row) {
       this.isFillInDailyData.id = row.id;
+      this.isFillInDailyData.ordererId = row.ordererId;
       this.dialogTitle = "关单  ";
       this.isTurnDown = true;
     },
@@ -2491,12 +2512,24 @@ export default {
         this.isFillInDailyData.rejectedReason;
       this.editProductionOrderRejectedParm.parammaps.accepterId =
         Cookies.get("employeid");
-      console.log(this.isFillInDailyData);
       PostDataByName(this.editProductionOrderRejectedParm).then((response) => {
         if (response.msg !== "fail") {
           this.get_production_work_order();
           this.isTurnDown = false;
 
+          var send_weixin_data1 = {
+            name: "getRemindData",
+            parammaps: {
+              userId:  this.isFillInDailyData.ordererId,
+              remindId: 84,
+              remindTypeName: "生产工单",
+              rowId:  this.isFillInDailyData.id,
+            },
+          };
+          handleWechatPushOfWorkOrder(send_weixin_data1, 84).catch((error) => {
+            console.error("微信推送失败:", error);
+          });
+
           this.$notify({
             title: "成功",
             message: "驳回成功",
@@ -2513,7 +2546,6 @@ export default {
       this.isTurnDown = false;
     },
     saveFillInDailyCancel(row) {
-      console.log(this.productionOrderGoodsList);
       if (
         this.productionOrderGoodsList &&
         this.productionOrderGoodsList.length > 0
@@ -2591,6 +2623,7 @@ export default {
         PostDataByName(this.delProductionWorkOrder).then((response) => {
           if (response.msg !== "fail") {
             this.get_production_work_order();
+
             this.$notify({
               title: "成功",
               message: "删除成功",
@@ -2614,6 +2647,21 @@ export default {
         PostDataByName(this.delProductionWorkOrder).then((response) => {
           if (response.msg !== "fail") {
             this.get_production_work_order();
+
+            var send_weixin_data1 = {
+            name: "getRemindData",
+            parammaps: {
+              userId:  row.ordererId,
+              remindId: 86,
+              remindTypeName: "生产工单",
+              rowId:  this.isFillInDailyData.id,
+            },
+          };
+          handleWechatPushOfWorkOrder(send_weixin_data1, 84).catch((error) => {
+            console.error("微信推送失败:", error);
+          });
+
+
             this.$notify({
               title: "成功",
               message: "删除成功",
@@ -2631,14 +2679,12 @@ export default {
       this.isOrderTaking = false;
     },
     handleDel(row) {
-      console.log(this.listAdd);
       MessageBox.confirm("设备名称:" + row.goodsName, "确认删除?", {
         confirmButtonText: "确认",
         cancelButtonText: "取消",
         type: "warning",
       }).then(() => {
         for (var i = 0; i < this.listAdd.length; i++) {
-          console.log(this.listAdd[i]);
           if (this.listAdd[i].id === row.id) {
             var listAddIndex = this.listAdd.indexOf(this.listAdd[i]);
           }
@@ -2650,14 +2696,13 @@ export default {
       });
     },
     handleEditDel(row) {
-      console.log(this.productionOrderGoodsList);
+      
       MessageBox.confirm("设备名称:" + row.goodsName, "确认删除?", {
         confirmButtonText: "确认",
         cancelButtonText: "取消",
         type: "warning",
       }).then(() => {
         for (var i = 0; i < this.productionOrderGoodsList.length; i++) {
-          console.log(this.productionOrderGoodsList[i]);
           if (this.productionOrderGoodsList[i].id === row.id) {
             var listAddIndex = this.productionOrderGoodsList.indexOf(
               this.productionOrderGoodsList[i]
@@ -2709,12 +2754,6 @@ export default {
             (response) => {
               if (response.data && response.data.list) {
                 this.processRecordsList = response.data.list;
-
-                console.log("processRecordsList:", this.processRecordsList);
-                console.log(
-                  "productionOrderGoodsList:",
-                  this.productionOrderGoodsList
-                );
                 this.dialogTitle = "编辑";
 
                 this.formLabelAlign.id = row.id;
@@ -2870,8 +2909,6 @@ export default {
     },
 
     handleEditAndOff() {
-      console.log(this.productionOrderGoodsList.length);
-      console.log(this.productionOrderGoodsList);
       if (this.productionOrderGoodsList.length === 0) {
         this.$notify({
           title: "失败",
@@ -2928,7 +2965,7 @@ export default {
                 type: "e",
                 parammaps: {
                   productionOrderId: this.formLabelAlign.id,
-                  goodsId: "@insertProductionOrderGoods.id",
+                  goodsId: "@insertProductionOrderGoods.goodsId",
                   priority: "@insertProductionOrderGoods.priority",
                   totalQuantity: "@insertProductionOrderGoods.totalQuantity",
                 },
@@ -3119,6 +3156,15 @@ export default {
         }
       });
     },
+    get_emp_role_data() {
+      GetDataByName(this.getEmployeesRoleParm).then((response) => {
+        if (response.data && response.data.list) {
+          this.roleEmpList = response.data.list;
+        } else {
+          this.roleEmpList = [];
+        }
+      });
+    },
     getProductionOrderGoods(id) {
       this.productionOrderGoodsList = [];
       this.getProductionOrderGoodsParm.parammaps.id = id;
@@ -3200,16 +3246,16 @@ export default {
     get_order_code() {
       GetDataByName(this.getOrderCodeParm).then((response) => {
         if (response.data && response.data.list) {
-          console.log(response.data.list[0].generated_code);
+          // console.log(response.data.list[0].generated_code);
           this.formLabelAlign.orderCode = response.data.list[0].generated_code;
-          console.log(this.formLabelAlign.orderCode);
+          // console.log(this.formLabelAlign.orderCode);
         }
       });
     },
     get_contract_pull() {
       GetDataByName(this.getContractPullParm).then((response) => {
         if (response.data && response.data.list) {
-          console.log(response.data.list[0].generated_code);
+          // console.log(response.data.list[0].generated_code);
           this.contractList = response.data.list;
         }
       });
@@ -3236,8 +3282,9 @@ export default {
   created() {
     this.get_contract_pull();
     this.get_emp_data();
-
+   
     this.get_production_work_order();
+    this.get_emp_role_data();
   },
 };
 </script>