Эх сурвалжийг харах

部分新需求以及部分bug更改

cz 1 жил өмнө
parent
commit
5ca7f7d252

+ 4 - 1
.env.development

@@ -7,12 +7,15 @@ VITE_APP_ENV = 'development'
 # 若依管理系统/开发环境
 VITE_APP_BASE_API = '/dev-api'
 
+# IP地址
 VITE_APP_IP = '121.37.194.75'
 
+# WS
+VITE_APP_WS_API = ':20010/test-api'
 
 #上传文件地址
 VITE_APP_UPLOAD_API='121.37.194.75:20010'
 VITE_APP_UPLOAD_BASE_API = '/test-api'
 
 
-VITE_APP_WS_API = ':20010/test-api'
+

+ 11 - 4
.env.production

@@ -7,12 +7,19 @@ VITE_APP_ENV = 'production'
 # 若依管理系统/生产环境
 VITE_APP_BASE_API = '/prod-api'
 
-# 是否在打包时开启压缩,支持 gzip 和 brotli
-VITE_BUILD_COMPRESS = gzip
-
+# IP地址
 VITE_APP_IP = 'ehsd.winfaster.cn'
 
+# WS
 VITE_APP_WS_API = '/prod-api'
 
+#上传文件地址
+VITE_APP_UPLOAD_API='121.37.194.75:20010'
+VITE_APP_UPLOAD_BASE_API = '/prod-api'
+
+# 是否在打包时开启压缩,支持 gzip 和 brotli
+VITE_BUILD_COMPRESS = gzip
+
 # 是否强刷新
-VITE_REFRESH = true
+VITE_REFRESH = true
+

+ 4 - 3
.env.staging

@@ -7,17 +7,18 @@ VITE_APP_ENV = 'staging'
 # 若依管理系统/生产环境
 VITE_APP_BASE_API = '/test-api'
 
-# 是否在打包时开启压缩,支持 gzip 和 brotli
-VITE_BUILD_COMPRESS = gzip
-
+# IP地址
 VITE_APP_IP = '121.37.194.75'
 
+# WS
 VITE_APP_WS_API = ':20010/test-api'
 
 #上传文件地址
 VITE_APP_UPLOAD_API='121.37.194.75:20010'
 VITE_APP_UPLOAD_BASE_API = '/test-api'
 
+# 是否在打包时开启压缩,支持 gzip 和 brotli
+VITE_BUILD_COMPRESS = gzip
 
 # 是否强刷新
 VITE_REFRESH = true

+ 2 - 1
src/components/byForm/index.vue

@@ -55,7 +55,8 @@
           <el-date-picker v-model="formData[i.prop]" :readonly="i.readonly ? i.readonly : false" v-else-if="i.type == 'date'" :type="i.itemType"
                           :placeholder="i.placeholder || $t('common.pleaseSelectTime')" @change="(e) => commonsEmit(e, i)"
                           :disabled="i.disabled ? i.disabled : false" :format="i.format ? i.format : dateFormatInit(i.itemType)"
-                          :value-format="i.format ? i.format : dateFormatInit(i.itemType)" :style="i.style?i.style:{width:'100%'}" />
+                          :value-format="i.format ? i.format : dateFormatInit(i.itemType)" :style="i.style?i.style:{width:'100%'}"
+                          :disabled-date="i.disabledFn ? i.disabledFn :()=>false" />
           <el-switch :disabled="i.disabled ? i.disabled : false" v-else-if="i.type == 'switch'" :readonly="i.readonly ? i.readonly : false"
                      v-model="formData[i.prop]" />
           <el-checkbox-group v-else-if="i.type == 'checkbox'" v-model="formData[i.prop]" :readonly="i.readonly ? i.readonly : false"

+ 12 - 0
src/components/byTable/index.vue

@@ -483,6 +483,9 @@ export default defineComponent({
           "getList",
           Object.assign(props.filterParams, { [i.prop]: "" })
         );
+        if (i.fn) {
+          i.fn();
+        }
         return;
       }
       i.label = item.label || item.dictValue;
@@ -500,6 +503,10 @@ export default defineComponent({
           [i.prop]: value,
         })
       );
+      // 是否有函数
+      if (i.fn) {
+        i.fn();
+      }
     };
 
     const getSelectLabel = (value, item) => {
@@ -566,6 +573,11 @@ export default defineComponent({
 
     const isSelectable = (row, index, item) => {
       if (item.type === "selection") {
+        if (item.attrs && item.attrs.isJudge) {
+          if (row.companyId) {
+            return proxy.isCurrentCompanyData(row.companyId);
+          }
+        }
         if (item.attrs && item.attrs.checkAtt) {
           if (row[item.attrs.checkAtt]) {
             return row[item.attrs.checkAtt];

+ 1 - 0
src/components/headerBar/header-bar.vue

@@ -792,6 +792,7 @@ const showSearchStyle = (name) => {
 .menuDrawerClass {
   // width: calc(100vw - 500px) !important;
   width: 70% !important;
+  min-width: 980px !important;
   background: #fff;
   // position: relative !important;
   top: 50px !important;

+ 2 - 2
src/components/process/SF/Contract.vue

@@ -239,9 +239,9 @@
               <template #default="{ row, $index }">
                 <div style="width:100%">
                   <div style="display:flex">
-                    <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(171 173 175);color:#fff;padding:5px 2px;border-radius:3px;"
+                    <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px"
                          @click="handleClickUploadOne($index)">
-                      {{row.isShowProductFile?'定  制  图  稿':'取 消 定 制'}}
+                      {{row.isShowProductFile?'上  传  文  件':'取  消  上  传'}}
                     </div>
                     <div>
                       <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">

+ 2 - 2
src/components/process/SF/Purchase.vue

@@ -135,7 +135,7 @@
             </el-table-column>
             <el-table-column prop="productName" label="商品名称" min-width="130" />
             <el-table-column prop="productCode" label="商品编码" width="130" />
-            <el-table-column label="尺寸 cm*cm*cm" width="180">
+            <el-table-column label="尺寸 (cm)" width="140">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                   {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
@@ -155,7 +155,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="单价" width="180">
+            <el-table-column label="单价" width="160">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"

+ 4 - 0
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -245,6 +245,7 @@ import ContractDetails from "@/components/contractCom/contractDetails.vue";
 import ContractPDFOne from "@/components/PDF/contractPDFOne.vue";
 import ContractPDFOneNew from "@/components/PDF/contractPDFOneNew.vue";
 import $bus from "@/bus/index.js";
+import moment from "moment";
 const route = useRoute();
 
 const contractTag = computed(
@@ -1316,6 +1317,9 @@ const productionFormConfig = computed(() => [
     prop: "deliveryPeriod",
     // placeholder: "合同开始时间",
     itemWidth: 100,
+    disabledFn: (date) => {
+      return moment(date).isBefore(moment());
+    },
     clearable: true,
   },
 ]);

+ 163 - 0
src/views/MES/productionBoard/equipmentCapacity/index.vue

@@ -0,0 +1,163 @@
+<template>
+  <div class="main">
+    <div class="top">
+      <div style="display:flex;text-align:center;align-items:center;padding-left:60px">
+        <div class="bk-box" style="background:#F9CB19">
+        </div>
+        <div style="color:#fff;margin-right:30px;font-size:12px">
+          已分配
+        </div>
+        <div class="bk-box" style="background:#268EFF">
+        </div>
+        <div style="color:#fff;font-size:12px">
+          未分配
+        </div>
+      </div>
+      <div style="height:150px" ref="pie_1"></div>
+      <div style="height:150px" ref="pie_2"></div>
+      <div style="height:150px" ref="pie_3"></div>
+    </div>
+    <div class="bottom">
+      ss
+    </div>
+  </div>
+</template>
+
+<script setup>
+import * as echarts from "echarts";
+
+const pie_1 = ref(null);
+const pie_2 = ref(null);
+const pie_3 = ref(null);
+let pie_1Chart = null;
+let pie_2Chart = null;
+let pie_3Chart = null;
+
+const getOption = () => {
+  return {
+    title: {
+      show: true,
+      text: "设备",
+      bottom: "-4%",
+      left: "center",
+      textStyle: {
+        color: "#fff",
+        fontSize: 12,
+        fontWeight: 400,
+      },
+    },
+    tooltip: {
+      trigger: "item",
+    },
+    grid: {
+      show: true,
+      bottom: 80,
+    },
+    // legend: {
+    //   top: "0%",
+    //   left: "center",
+    // },
+    series: [
+      {
+        name: "设备",
+        type: "pie",
+        radius: ["50%", "80%"],
+        avoidLabelOverlap: false,
+        label: {
+          show: false,
+          position: "center",
+        },
+        emphasis: {
+          label: {
+            show: true,
+            fontSize: 15,
+            fontWeight: "bold",
+            color: "#fff",
+          },
+        },
+        labelLine: {
+          show: false,
+        },
+        data: [
+          {
+            value: 1048,
+            name: "已分配",
+            itemStyle: {
+              color: "#F9CB19",
+            },
+          },
+          {
+            value: 735,
+            name: "未分配",
+            itemStyle: {
+              color: "#268EFF",
+            },
+          },
+        ],
+      },
+    ],
+  };
+};
+let option1 = {};
+let option2 = {};
+let option3 = {};
+
+onMounted(() => {
+  option1 = getOption();
+  pie_1Chart = echarts.init(pie_1.value);
+  window.addEventListener("resize", () => {
+    pie_1Chart.resize();
+  });
+  pie_1Chart.setOption(option1);
+  pie_1Chart.resize();
+
+  option2 = getOption();
+  option2.series[0].data[0].value = 65;
+  option2.series[0].data[1].value = 98;
+  pie_2Chart = echarts.init(pie_2.value);
+  window.addEventListener("resize", () => {
+    pie_2Chart.resize();
+  });
+  pie_2Chart.setOption(option2);
+  pie_2Chart.resize();
+
+  option3 = getOption();
+  pie_3Chart = echarts.init(pie_3.value);
+  window.addEventListener("resize", () => {
+    pie_3Chart.resize();
+  });
+  pie_3Chart.setOption(option3);
+  pie_3Chart.resize();
+});
+</script>
+
+<style lang="scss" scoped>
+.main {
+  // height: 100vh;
+  display: flex;
+  background: #091731;
+  padding: 10px;
+  color: #fff;
+  font-size: 12px;
+  .top {
+    width: 300px;
+    background: #1e3159;
+    height: calc(100vh - 120px);
+    overflow: auto;
+    padding: 10px;
+  }
+  .bottom {
+    width: calc(100vw - 310px);
+    margin-left: 10px;
+    background: #1e3159;
+    height: calc(100vh - 120px);
+    overflow: auto;
+  }
+}
+.bk-box {
+  height: 10px;
+  width: 10px;
+  border-radius: 2px;
+  margin-right: 10px;
+}
+</style>

+ 14 - 14
src/views/MES/productionMaterial/index.vue

@@ -120,6 +120,13 @@ const config = ref([
   },
   {
     attrs: {
+      label: "物料图片",
+      slot: "pic",
+      width: 80,
+    },
+  },
+  {
+    attrs: {
       label: "生产订单号",
       prop: "orderCode",
       width: 130,
@@ -134,13 +141,6 @@ const config = ref([
   },
   {
     attrs: {
-      label: "物料图片",
-      slot: "pic",
-      width: 80,
-    },
-  },
-  {
-    attrs: {
       label: "物料编码",
       prop: "materialCode",
       width: 190,
@@ -170,6 +170,13 @@ const config = ref([
 const configOne = ref([
   {
     attrs: {
+      label: "物料图片",
+      slot: "pic",
+      width: 80,
+    },
+  },
+  {
+    attrs: {
       label: "生产订单号",
       prop: "orderCode",
       width: 130,
@@ -184,13 +191,6 @@ const configOne = ref([
   },
   {
     attrs: {
-      label: "物料图片",
-      slot: "pic",
-      width: 80,
-    },
-  },
-  {
-    attrs: {
       label: "物料编码",
       prop: "materialCode",
       width: 190,

+ 13 - 2
src/views/MES/productionOrder/index.vue

@@ -246,6 +246,7 @@ const sourceList = ref({
     endDeliveryPeriod: "",
     beginTime: "",
     endTime: "",
+    companyId: "",
   },
 });
 const treeData = ref([]);
@@ -277,6 +278,9 @@ const selectConfig = computed(() => [
     label: "生产公司",
     prop: "companyId",
     data: companyData.value,
+    fn: () => {
+      getRightData();
+    },
   },
   {
     label: "生产状态",
@@ -523,6 +527,9 @@ const productionFormConfig = computed(() => [
     // placeholder: "合同开始时间",
     itemWidth: 100,
     clearable: true,
+    disabledFn: (date) => {
+      return moment(date).isBefore(moment());
+    },
   },
 ]);
 const productionRules = ref({
@@ -570,7 +577,10 @@ let colorList = [
 ];
 const getRightData = () => {
   proxy
-    .post("/produceOrder/schedulingList", { beginDate: monthOne.value })
+    .post("/produceOrder/schedulingList", {
+      beginDate: monthOne.value,
+      companyId: sourceList.value.pagination.companyId,
+    })
     .then(
       (res) => {
         rightDataObj.value = {};
@@ -587,7 +597,8 @@ const getRightData = () => {
           if (i <= 12) {
             colorData.value[ele.id] = colorList[i];
           } else {
-            colorData.value[ele.id] = colorList[0];
+            let index = Math.floor(i % 12);
+            colorData.value[ele.id] = colorList[index];
           }
         }
       },

+ 4 - 0
src/views/MES/productionScheduling/index.vue

@@ -27,6 +27,7 @@
                        @click="clickDistributeProduction(item)" v-if="isCurrentCompanyData(item.companyId)">
                 <Clock />
               </el-icon>
+              <span style="padding:0 8px" v-else></span>
               {{item.produceTime}} ~ {{item.deliveryPeriod}}
             </div>
           </div>
@@ -298,6 +299,9 @@ const productionFormConfig = computed(() => [
     // placeholder: "合同开始时间",
     itemWidth: 100,
     clearable: true,
+    disabledFn: (date) => {
+      return moment(date).isBefore(moment());
+    },
   },
 ]);
 const productionRules = ref({

+ 10 - 5
src/views/MES/productionTask/index.vue

@@ -30,20 +30,20 @@
 
         <template v-for="(slotItem, index) in processesData" v-slot:[slotItem.id]="{ item }" :key="slotItem.id">
           <div style="width:100%">
-            <div v-if="isShowCotent(slotItem,item)">
+            <div v-if="isShowCotent(slotItem,item)" style="font-weight:700">
               <!-- <el-icon :size="20" color="green">
                 <CircleCheckFilled />
               </el-icon> -->
               {{showCotent(slotItem,item)}}
             </div>
-            <div v-else>
-              <el-icon :size="20" color="red">
+            <div v-else class="no-bk">
+              <!-- <el-icon :size="20" color="red">
                 <CircleClose />
-              </el-icon>
+              </el-icon> -->
+              -
             </div>
           </div>
         </template>
-
       </byTable>
     </div>
     <el-dialog :title="'打印任务单'" v-model="dialogVisible" width="840px" destroy-on-close :before-close="beforeClose">
@@ -595,6 +595,7 @@ const getProcesses = () => {
           slot: ele.id,
           isNeedHeaderSlot: false,
           width: 90,
+          align: "center",
           fixed: "right",
         };
         config.value.push({
@@ -741,4 +742,8 @@ getDict();
     padding: 5px !important;
   }
 }
+.no-bk {
+  // background: #f3f3f3;
+  // height: 50px;
+}
 </style>

+ 40 - 129
src/views/iot/base/equipment/index.vue

@@ -4,8 +4,7 @@
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
                :selectConfig="selectConfig" :table-events="{
-          //element talbe事件都能传
-          select: select,
+        
         }" :action-list="[
           {
             text: '添加设备',
@@ -36,6 +35,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, defineComponent, ref } from "vue";
+const { proxy } = getCurrentInstance();
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({
@@ -66,52 +66,46 @@ let rules = ref({
     { required: true, message: "请输入密钥", trigger: ["blur", "change"] },
   ],
 });
-const { proxy } = getCurrentInstance();
-const selectConfig = reactive([
-  {
-    label: "行业名称",
-    prop: "flowStatus",
-    data: [],
-  },
-  {
-    label: "产品名称",
-    prop: "flowStatus",
-    data: [],
-  },
-]);
-
+const selectConfig = reactive([]);
 const config = computed(() => {
   return [
     {
       attrs: {
-        label: "行业名称",
+        label: "设备编码",
         prop: "appName",
       },
     },
     {
       attrs: {
-        label: "产品名称",
+        label: "设备名称",
         prop: "productName",
         align: "center",
       },
     },
     {
       attrs: {
-        label: "设备名称",
+        label: "规格型号",
         prop: "deviceName",
         align: "center",
       },
     },
     {
       attrs: {
-        label: "设备标识",
+        label: "制造商",
         prop: "nodeId",
         align: "center",
       },
     },
     {
       attrs: {
-        label: "密钥",
+        label: "制造商电话",
+        prop: "secret",
+        align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "备注",
         prop: "secret",
         align: "center",
       },
@@ -119,8 +113,8 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "200",
-        align: "right",
+        width: "120",
+        align: "center",
       },
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
@@ -178,56 +172,47 @@ const byform = ref(null);
 const treeData = ref([]);
 const formConfig = reactive([
   {
-    type: "select",
-    prop: "copyTdaProductId",
-    label: "行业名称",
+    type: "input",
+    prop: "deviceName",
+    label: "设备编码",
+    required: true,
+  },
+  {
+    type: "input",
+    prop: "deviceName",
+    label: "设备名称",
     required: true,
-    // isLoad: {
-    //   url: "/tdaApplication/page",
-    //   req: {
-    //     pageNum: 1,
-    //     pageSize: 9999,
-    //   },
-    //   labelKey: "appName",
-    //   labelVal: "id",
-    //   method: "post",
-    //   resUrl: "rows",
-    // },
   },
   {
-    type: "select",
-    prop: "tdaProductId",
-    label: "产品名称",
+    type: "input",
+    prop: "deviceName",
+    label: "规格型号",
     required: true,
-    data: [],
   },
-  //  isLoad: {
-  //   url: "/tdaProduct/page",
-  //   req: {
-  //     pageNum: 1,
-  //     pageSize: 9999,
-  //   },
-  //   labelKey: "name",
-  //   labelVal: "id",
-  //   method: "post",
-  //   resUrl: "rows",
-  // },
   {
     type: "input",
     prop: "deviceName",
-    label: "设备名称",
+    label: "制造商",
     required: true,
   },
   {
     type: "input",
+    prop: "deviceName",
+    label: "制造商电话",
+    required: true,
+  },
+  {
+    type: "date",
+    itemType: "date",
     prop: "nodeId",
-    label: "设备标识",
+    label: "出厂日期",
     required: true,
   },
   {
     type: "input",
+    itemType: "textarea",
     prop: "secret",
-    label: "密钥",
+    label: "备注",
     required: true,
   },
 ]);
@@ -248,41 +233,6 @@ const openModal = () => {
   modalType.value = "add";
   formData.data = {};
 };
-const selection = ref({
-  data: [],
-});
-const select = (_selection, row) => {
-  selection.value.data = _selection;
-  console.log(_selection.length);
-};
-const openRoomModal = () => {
-  roomDialogVisible.value = true;
-
-  proxy
-    .get("/tenantInfo/roleMenuTreeSelect/" + selection.value.data[0].tenantId)
-    .then((res) => {
-      if (res.code == 200) {
-        treeData.value = res.menus;
-        formData.treeData = res.checkedKeys;
-        tree.value.setCheckedKeys(res.checkedKeys);
-      }
-    });
-};
-const tree = ref(null);
-const submitTree = () => {
-  proxy
-    .post("/tenantInfo/bindingMenu", {
-      tenantId: selection.value.data[0].tenantId,
-      menuIdList: tree.value.getCheckedKeys(),
-    })
-    .then((res) => {
-      ElMessage({
-        message: "保存成功",
-        type: "success",
-      });
-      roomDialogVisible.value = false;
-    });
-};
 
 const submitForm = () => {
   console.log(byform.value);
@@ -313,46 +263,7 @@ const getDtl = (row) => {
   });
 };
 
-const selectData = reactive({
-  tradeList: [],
-});
-const getSelect = () => {
-  proxy
-    .post("/tdaApplication/page", { pageNum: 1, pageSize: 9999 })
-    .then((message) => {
-      selectData.tradeList = message.rows;
-      formConfig[0].data = selectData.tradeList.map((x) => ({
-        title: x.appName,
-        value: x.id,
-      }));
-      // formConfig[1].data = selectData.tradeList.map((x) => ({
-      //   title: x.name,
-      //   value: x.id,
-      // }));
-    });
-};
-
-watch(
-  () => formData.data.copyTdaProductId,
-  (val, old) => {
-    if (val) {
-      proxy
-        .post("/tdaProduct/page", {
-          pageNum: 1,
-          pageSize: 9999,
-          tdaApplicationId: val,
-        })
-        .then((res) => {
-          formConfig[1].data = res.rows.map((x) => ({
-            title: x.name,
-            value: x.id,
-          }));
-        });
-    }
-  }
-);
 getList();
-getSelect();
 </script>
   
 <style lang="scss" scoped>

+ 30 - 14
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -35,7 +35,8 @@
         </template>
         <template #prodTag="{ item }">
           <div style="width: 100%">
-            <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.prodTags" :key="index">
+            <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.prodTags" :key="index"
+                    :closable="useUserStore().user.companyId=='100'" @close="prodTagClose(index, item)">
               {{ dictKeyValue(tag, contractTag) }}
             </el-tag>
           </div>
@@ -181,6 +182,7 @@ const config = computed(() => {
       type: "selection",
       attrs: {
         checkAtt: "isCheck",
+        isJudge: true,
         width: 60,
       },
     },
@@ -265,7 +267,7 @@ const config = computed(() => {
       attrs: {
         label: "生产指示",
         slot: "prodTag",
-        "min-width": 180,
+        "min-width": 220,
       },
     },
     {
@@ -291,18 +293,20 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "采购",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              selectData.value = [row];
-              start();
-            },
-          },
+          proxy.isCurrentCompanyData(row.companyId)
+            ? {
+                attrs: {
+                  label: "采购",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  selectData.value = [row];
+                  start();
+                },
+              }
+            : {},
         ];
       },
     },
@@ -571,6 +575,18 @@ const getDict = () => {
 };
 getDict();
 
+const prodTagClose = (index, row) => {
+  row.prodTags.splice(index, 1);
+  proxy
+    .post("/contract/updateProductionTag", {
+      id: row.contractId,
+      prodTag: row.prodTags.join(","),
+    })
+    .then((res) => {
+      getList();
+    });
+};
+
 onMounted(() => {
   $bus.on("refreshTableData", () => {
     getList();