cz 1 жил өмнө
parent
commit
20f0c5e525

+ 1 - 0
package.json

@@ -51,6 +51,7 @@
     "nprogress": "0.2.0",
     "pinia": "2.0.22",
     "pubsub-js": "^1.9.4",
+    "qrcodejs2-fix": "^0.0.1",
     "sortablejs": "^1.15.0",
     "typescript": "^5.0.4",
     "uuid": "^9.0.1",

+ 4 - 2
src/components/byTable/index.vue

@@ -271,8 +271,10 @@ export default defineComponent({
   setup(props) {
     const { proxy } = getCurrentInstance();
     // 过滤出有属性的
-    const configData = ref([]);
-    configData.value = proxy.config.filter((x) => x && x.attrs);
+    // const configData = ref([]);
+    // configData.value = proxy.config.filter((x) => x && x.attrs);
+    const configData = computed(() => proxy.config.filter((x) => x && x.attrs));
+    // console.log(configData.value, "ssssssssss");
     const selectConfigCopy = computed(() => {
       return props.selectConfig.map((item) => {
         if (!item.labelCopy) item.labelCopy = { ...item }.label;

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

@@ -97,7 +97,8 @@
         </div>
       </ul>
       <div class="fr">
-        <div style="float:right;height: 50px;line-height: 50px;padding-right:20px;color:#fff;font-size:14px;cursor: pointer;" @click="plugDowload">
+        <div style="float:right;height: 50px;line-height: 50px;padding-right:20px;color:#fff;font-size:14px;cursor: pointer;"
+             @click="plugsDialog=true ">
           插件下载
         </div>
         <div style="float:right;height: 50px;padding-right:20px">
@@ -288,6 +289,18 @@
       </template>
     </el-drawer>
 
+    <el-dialog title="使用说明" v-model="plugsDialog" v-if="plugsDialog" width="40%">
+      <div style="font-size: 14px; line-height: 36px">
+        <div>1、<span style="color: red">下载插件后解压,</span>把printer文件夹拷贝到D盘下</div>
+        <div>2、打开printer文件夹,双击printer.reg安装,即完成</div>
+      </div>
+      <template #footer>
+        <el-button type="primary" @click="plugDowload()" size="default">
+          已阅读,下载
+        </el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -311,6 +324,7 @@ const autoListChidrenNum = ref(0);
 const isEidtType = ref(false);
 const leftBanerType = ref(1);
 const noticeTableModal = ref(false);
+const plugsDialog = ref(false);
 const userData = ref(Cookies.get("nickName") || "");
 const commonsRouterList = ref([]);
 const activeLeftData = ref({});
@@ -658,6 +672,7 @@ const plugDowload = () => {
       document.body.appendChild(link);
       link.click();
     });
+  plugsDialog.value = false;
 };
 </script>
 

+ 37 - 22
src/components/notice/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="commons-notice">
-    <el-dialog title="系统公告" v-model="value" width="460px" :align-center="true" :before-close="handleClose">
+    <el-dialog title="消息通知" v-model="value" width="460px" :align-center="true" :before-close="handleClose">
       <div class="title">
         <!-- {{ data.length == 0 ? '暂无数据' :  data[indexCopy].title}} -->
       </div>
@@ -167,7 +167,6 @@ const confirm = () => {
 // 	data.value = res.rows
 // })
 const createNotification = (body, title = "通知") => {
-  console.log(window.location, "ss");
   let notification = null;
   if (!("Notification" in window)) {
     // 检查浏览器是否支持通知
@@ -215,18 +214,20 @@ const createNotification = (body, title = "通知") => {
     });
   }
 };
+const socket = ref(null);
+const intervalId = ref(null);
+const sendSocketMsg = () => {
+  let jsonData = {
+    cmd: "heartbeat",
+  };
+  socket.value.send(JSON.stringify(jsonData));
+  console.log("Timer executed!");
+};
 
 const socketInit = () => {
   let prefix =
     window.location.protocol.indexOf("https") >= 0 ? "wss://" : "ws://";
-  // window.ws = new WebSocket(
-  //   "ws://" +
-  //     import.meta.env.VITE_APP_IP +
-  //     import.meta.env.VITE_APP_WS_API +
-  //     "/webStock/" +
-  //     getToken()
-  // );
-  window.ws = new WebSocket(
+  socket.value = new WebSocket(
     prefix +
       import.meta.env.VITE_APP_IP +
       import.meta.env.VITE_APP_WS_API +
@@ -234,22 +235,25 @@ const socketInit = () => {
       getToken()
   );
   //申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
-  window.ws.onopen = function () {
+  socket.value.onopen = function () {
     //当WebSocket创建成功时,触发onopen事件
     console.log("open");
+    //立马发送一次心跳
+    sendSocketMsg();
+    // 设置定时器,每30秒执行一次myFunction
+    intervalId.value = setInterval(sendSocketMsg, 1000 * 30);
   };
-  window.ws.onmessage = function (e) {
+  socket.value.onmessage = function (e) {
     //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
     //在data.value前面插入
     const res = JSON.parse(e.data);
-    console.log(res);
-
+    console.log(res, "socket-message");
     if (res.type == 1) {
       index.value = 0;
       data.value = res.list;
       if (res.list.length > 0) value.value = true;
     }
-    if (res.type == 2) {
+    if (res.type == 2 && res.count != "0") {
       emit("changeNum", res.count * 1);
       proxy.$emit("openNotice");
       getPushInfo(true);
@@ -265,15 +269,18 @@ const socketInit = () => {
       createNotification(res.title);
     }
   };
-  window.ws.onclose = function (e) {
+  socket.value.onclose = function (e) {
     //当客户端收到服务端发送的关闭连接请求时,触发onclose事件
-    console.log("close");
+    console.log("socket-close");
+    intervalId.value && clearInterval(intervalId.value);
   };
-  window.ws.onerror = function (e) {
+  socket.value.onerror = function (e) {
     //如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
-    console.log(error);
+    console.log("socket-error", e);
+    intervalId.value && clearInterval(intervalId.value);
   };
 };
+
 let pushInfoReq = ref({
   pageNum: 1,
   pageSize: 5,
@@ -299,9 +306,17 @@ const getPushInfo = (flag) => {
     noticeData.value = res.rows;
     pushInfoReq.value.total = res.total;
     // 桌面通知
-    // if (flag && noticeData.value.length > 0) {
-    //   createNotification(noticeData.value[0].title);
-    // }
+    if (flag && noticeData.value.length > 0) {
+      let current = noticeData.value.find((x) => x.businessType == 0);
+      if (current) {
+        createNotification(current.title);
+        index.value = 0;
+        current.businessData = current.title;
+        current.title = "流程";
+        data.value = [current];
+        value.value = true;
+      }
+    }
     setTimeout(() => {
       loading.value = false;
       proxy

+ 16 - 33
src/components/process/SF/Contract.vue

@@ -1139,40 +1139,23 @@ const getAllData = (businessId) => {
       let productIds = formData.data.contractProductList.map(
         (x) => x.productId
       );
-      proxy
-        .post("/fileInfo/getList", {
-          businessIdList: productIds,
-        })
-        .then((fileObj) => {
-          for (let i = 0; i < formData.data.contractProductList.length; i++) {
-            const e = formData.data.contractProductList[i];
-            for (const key in fileObj) {
-              if (e.productId === key) {
-                if (fileObj[key] && fileObj[key].length > 0) {
-                  e.fileUrl = fileObj[key][0].fileUrl;
-                }
-              }
-            }
-          }
-        });
+      proxy.getFile(
+        productIds,
+        formData.data.contractProductList,
+        "productId",
+        "fileListOne",
+        "fileUrl"
+      );
+
       let ids = formData.data.contractProductList.map((x) => x.id);
-      proxy
-        .post("/fileInfo/getList", {
-          businessIdList: ids,
-        })
-        .then((fileObj) => {
-          for (let i = 0; i < formData.data.contractProductList.length; i++) {
-            const e = formData.data.contractProductList[i];
-            for (const key in fileObj) {
-              if (e.id === key) {
-                if (fileObj[key] && fileObj[key].length > 0) {
-                  e.fileList = fileObj[key];
-                  e.imageUrl = fileObj[key][0].fileUrl;
-                }
-              }
-            }
-          }
-        });
+      proxy.getFile(
+        ids,
+        formData.data.contractProductList,
+        "id",
+        "fileList",
+        "imageUrl"
+      );
+
       changeProductPrice();
     }
     if (formData.data.countryId) {

+ 7 - 17
src/components/process/SF/PriceSheet.vue

@@ -1125,23 +1125,13 @@ const getAllData = (businessId) => {
           }
         });
       let ids = formData.data.quotationProductList.map((x) => x.id);
-      proxy
-        .post("/fileInfo/getList", {
-          businessIdList: ids,
-        })
-        .then((fileObj) => {
-          for (let i = 0; i < formData.data.quotationProductList.length; i++) {
-            const e = formData.data.quotationProductList[i];
-            for (const key in fileObj) {
-              if (e.id === key) {
-                if (fileObj[key] && fileObj[key].length > 0) {
-                  e.fileList = fileObj[key];
-                  e.imageUrl = fileObj[key][0].fileUrl;
-                }
-              }
-            }
-          }
-        });
+      proxy.getFile(
+        ids,
+        formData.data.quotationProductList,
+        "id",
+        "fileList",
+        "imageUrl"
+      );
     }
     if (formData.data.countryId) {
       getCityData(formData.data.countryId, "20");

+ 7 - 17
src/components/process/SF/Purchase.vue

@@ -937,23 +937,13 @@ const getAllData = (businessId) => {
         formData.data.purchaseProductList.length > 0
       ) {
         let ids = formData.data.purchaseProductList.map((x) => x.productId);
-        proxy
-          .post("/fileInfo/getList", {
-            businessIdList: ids,
-          })
-          .then((fileObj) => {
-            for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
-              const e = formData.data.purchaseProductList[i];
-              for (const key in fileObj) {
-                if (e.productId === key) {
-                  e.fileList = fileObj[key] || [];
-                  if (e.fileList && e.fileList.length > 0) {
-                    e.fileUrl = e.fileList[0].fileUrl;
-                  }
-                }
-              }
-            }
-          });
+        proxy.getFile(
+          ids,
+          formData.data.purchaseProductList,
+          "productId",
+          "fileList",
+          "fileUrl"
+        );
         changeProductPrice();
       }
       if (formData.data.countryId) {

+ 1 - 12
src/components/product/SelectMaterial.vue

@@ -425,18 +425,7 @@ const getList = async (req) => {
     const productIdList = res.rows.map((x) => x.id);
     // 请求文件数据并回显
     if (productIdList.length > 0) {
-      proxy
-        .post("/fileInfo/getList", { businessIdList: productIdList })
-        .then((fileObj) => {
-          for (let i = 0; i < sourceList.value.data.length; i++) {
-            const e = sourceList.value.data[i];
-            for (const key in fileObj) {
-              if (e.id === key) {
-                e.fileList = fileObj[key];
-              }
-            }
-          }
-        });
+      proxy.getFile(productIdList, sourceList.value.data, "id");
     }
   });
 };

+ 1 - 14
src/components/product/SelectProduct.vue

@@ -465,20 +465,7 @@ const getList = async (req) => {
       const productIdList = message.rows.map((x) => x.id);
       // 请求文件数据并回显
       if (productIdList.length > 0) {
-        proxy
-          .post("/fileInfo/getList", {
-            businessIdList: productIdList,
-          })
-          .then((fileObj) => {
-            for (let i = 0; i < sourceList.value.data.length; i++) {
-              const e = sourceList.value.data[i];
-              for (const key in fileObj) {
-                if (e.id === key) {
-                  e.fileList = fileObj[key];
-                }
-              }
-            }
-          });
+        proxy.getFile(productIdList, sourceList.value.data, "id");
       }
     },
     (err) => {

+ 3 - 1
src/main.js

@@ -55,7 +55,8 @@ import {
   compareTime,
   getImgBase64,
   msgTip,
-  msgConfirm
+  msgConfirm,
+  getFile
 } from '@/utils/util'
 
 // 分页组件
@@ -85,6 +86,7 @@ app.config.globalProperties.get = get
 app.config.globalProperties.post = post
 app.config.globalProperties.msgTip = msgTip
 app.config.globalProperties.msgConfirm = msgConfirm
+app.config.globalProperties.getFile = getFile
 app.config.globalProperties.postTwo = postTwo
 app.config.globalProperties.download = download
 app.config.globalProperties.parseTime = parseTime

+ 24 - 0
src/utils/util.js

@@ -12,6 +12,30 @@ import {
   ElMessageBox
 } from 'element-plus'
 
+
+// businessIdList 业务id列表  dataSource 数据源  att  要对应的属性  fileAtt  要赋值的属性  filePathAtt  取第一张图片的属性
+export function getFile(businessIdList, dataSource, att = 'id', fileAtt = 'fileList', filePathAtt = '') {
+  if (businessIdList && businessIdList.length > 0 && dataSource && dataSource.length > 0) {
+    post("/fileInfo/getList", {
+      businessIdList,
+    }).then((res) => {
+      for (let i = 0; i < dataSource.length; i++) {
+        const ele = dataSource[i];
+        for (const key in res) {
+          if (ele[att] == key && res[key] && res[key].length > 0) {
+            ele[fileAtt] = res[key]
+            if (filePathAtt) {
+              ele[filePathAtt] = res[key][0].fileUrl
+            }
+          }
+        }
+
+      }
+    });
+  }
+  return false
+}
+
 //根据dictKey值回显字典label值
 export function dictKeyValue(value, arr) {
   if ((value || value == 0) && arr) {

+ 1 - 14
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -557,20 +557,7 @@ const getList = (req) => {
       let productIdList = res.rows.map((x) => x.id);
       // 请求文件数据并回显
       if (productIdList.length > 0) {
-        proxy
-          .post("/fileInfo/getList", {
-            businessIdList: productIdList,
-          })
-          .then((fileObj) => {
-            for (let i = 0; i < sourceList.value.data.length; i++) {
-              let e = sourceList.value.data[i];
-              for (let key in fileObj) {
-                if (e.id == key) {
-                  e.fileList = fileObj[key];
-                }
-              }
-            }
-          });
+        proxy.getFile(productIdList, sourceList.value.data, "id");
       }
     },
     (err) => {

+ 86 - 10
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -165,9 +165,20 @@
       </byForm>
       <template #footer>
         <el-button @click="moreSearchReset" size="default">重置</el-button>
-        <el-button @click="moreSearchQuery" type="primary" size="default">搜索</el-button>
+        <el-button @click="moreSearchQuery" type="primary" size="default" v-debounce>搜索</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog :title="'下发生产'" v-model="productionDialog" width="500px" destroy-on-close>
+      <byForm :formConfig="productionFormConfig" :formOption="formOption" v-model="formData.data" :rules="productionRules" ref="productionFormDom"
+              v-loading="formLoading">
+      </byForm>
+      <template #footer>
+        <el-button @click="productionDialog =false" size="default">取 消</el-button>
+        <el-button @click="submitProduction" type="primary" size="default" v-debounce>下 发</el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -371,13 +382,13 @@ const config = computed(() => {
         "min-width": 140,
       },
     },
-    {
-      attrs: {
-        label: "客户标签",
-        slot: "tags",
-        width: 180,
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "客户标签",
+    //     slot: "tags",
+    //     width: 180,
+    //   },
+    // },
     {
       attrs: {
         label: "是否已结清",
@@ -450,7 +461,7 @@ const config = computed(() => {
       attrs: {
         label: "审批状态",
         prop: "status",
-        width: 140,
+        width: 100,
       },
       render(type) {
         return proxy.dictValueLabel(type, status.value);
@@ -459,7 +470,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 160,
+        width: 200,
         align: "center",
         fixed: "right",
       },
@@ -489,6 +500,19 @@ const config = computed(() => {
                 },
               }
             : {},
+          row.status == 30
+            ? {
+                attrs: {
+                  label: "下发生产",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickDistributeProduction(row);
+                },
+              }
+            : {},
           {
             attrs: {
               label: "打印",
@@ -628,6 +652,7 @@ const getDict = () => {
         value: x.deptId,
       }));
     });
+
   proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     customerList.value = res.rows.map((item) => {
       return {
@@ -983,6 +1008,7 @@ const exportExcel = () => {
 
 const formData = reactive({
   recordsFormData: {},
+  data: {},
 });
 const formLoading = ref(false);
 const openRecords = ref(false);
@@ -1162,6 +1188,56 @@ const moreSearchReset = () => {
   };
   moreSearchQuery();
 };
+const productionFormDom = ref(null);
+const productionDialog = ref(false);
+const productionFormConfig = computed(() => [
+  {
+    type: "treeSelect",
+    prop: "produceCompanyId",
+    label: "生产公司",
+    data: companyData.value,
+    propsTreeLabel: "deptName",
+    propsTreeValue: "deptId",
+    itemWidth: 100,
+    // disabled: companyId.value != "100",
+  },
+  {
+    type: "date",
+    itemType: "datetime",
+    label: "交期",
+    prop: "deliveryPeriod",
+    // placeholder: "合同开始时间",
+    itemWidth: 100,
+    clearable: true,
+  },
+]);
+const productionRules = ref({
+  produceCompanyId: [
+    { required: true, message: "请选择生产公司", trigger: "change" },
+  ],
+  deliveryPeriod: [
+    { required: true, message: "请选择交期", trigger: "change" },
+  ],
+});
+const clickDistributeProduction = (row) => {
+  formData.data = {
+    contractId: row.id,
+    deliveryPeriod: "",
+    produceCompanyId: "",
+  };
+  productionDialog.value = true;
+};
+const submitProduction = () => {
+  productionFormDom.value.handleSubmit(() => {
+    formLoading.value = true;
+    proxy.post("/produceOrder/createOrder", formData.data).then((res) => {
+      proxy.msgTip("操作成功");
+      formLoading.value = false;
+      productionDialog.value = false;
+      // getList();
+    });
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 74 - 61
src/views/MES/productionOrder/index.vue

@@ -6,7 +6,7 @@
               
         ]" @get-list="getList">
 
-        <template #aa="{ item }">
+        <template #list="{ item }">
           <div style="width:100%">
             <el-progress type="circle" :percentage="Number(item.completionRate)" width="60"
                          :status="Number(item.completionRate) == 100 ? 'success' : ''" />
@@ -46,34 +46,25 @@ const sourceList = ref({
 const treeData = ref([]);
 const dialogVisible = ref(false);
 const modalType = ref("add");
-const selectConfig = computed(() => [
+const statusData = ref([
   {
-    label: "事业部",
-    prop: "status",
-    data: [
-      {
-        label: "待采购",
-        value: "15",
-      },
-      {
-        label: "部分采购",
-        value: "30",
-      },
-    ],
+    label: "未开始",
+    value: "0",
   },
   {
+    label: "进行中",
+    value: "1",
+  },
+  {
+    label: "已完成",
+    value: "2",
+  },
+]);
+const selectConfig = computed(() => [
+  {
     label: "生产状态",
     prop: "status",
-    data: [
-      {
-        label: "待采购",
-        value: "15",
-      },
-      {
-        label: "部分采购",
-        value: "30",
-      },
-    ],
+    data: statusData.value,
   },
   {
     type: "time",
@@ -84,69 +75,91 @@ const selectConfig = computed(() => [
     propOne: "time1",
     // data: status.value,
   },
+  {
+    type: "time",
+    label: "下单日期",
+    placeholder: "开始日期",
+    prop: "time",
+    placeholderOne: "结束日期",
+    propOne: "time1",
+    // data: status.value,
+  },
 ]);
 const config = computed(() => {
   return [
+    // {
+    //   type: "selection",
+    //   attrs: {
+    //     checkAtt: "isCheck",
+    //   },
+    // },
+    // {
+    //   attrs: {
+    //     label: "事业部",
+    //     prop: "code",
+    //   },
+    // },
     {
-      type: "selection",
       attrs: {
-        checkAtt: "isCheck",
-      },
-    },
-    {
-      attrs: {
-        label: "事业部",
+        label: "订单号",
         prop: "code",
+        width: 150,
       },
     },
     {
       attrs: {
-        label: "订单号",
-        prop: "name",
+        label: "下单时间",
+        prop: "createTime",
+        width: 160,
       },
     },
     {
       attrs: {
         label: "交期",
-        prop: "deptName",
+        prop: "deliveryPeriod",
+        width: 160,
       },
     },
     {
       attrs: {
         label: "生产状态",
-        prop: "deptName",
+        prop: "produceStatus",
+        width: 120,
       },
-    },
-    {
-      attrs: {
-        slot: "aa",
-        label: "各款SKU生产进度",
-        prop: "name",
+      render(val) {
+        return proxy.dictValueLabel(val, statusData.value);
       },
     },
     {
       attrs: {
-        label: "操作",
-        width: "100",
-        align: "center",
-        fixed: "right",
-      },
-      renderHTML(row) {
-        return [
-          {
-            attrs: {
-              label: "完成订单",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-        ];
+        slot: "list",
+        label: "产品生产进度",
+        // prop: "name",
       },
     },
+    // {
+    //   attrs: {
+    //     label: "操作",
+    //     width: "100",
+    //     align: "center",
+    //     fixed: "right",
+    //   },
+    //   renderHTML(row) {
+    //     return [
+    //       {
+    //         attrs: {
+    //           label: "完成订单",
+    //           type: "primary",
+    //           text: true,
+    //         },
+    //         el: "button",
+    //         click() {
+    //           getDtl(row);
+    //         },
+    //       },
+    //     ];
+    //   },
+    // },
   ];
 });
 const formData = reactive({
@@ -209,7 +222,7 @@ getDeptData();
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/shopInfo/page", sourceList.value.pagination).then((res) => {
+  proxy.post("/produceOrder/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {

+ 383 - 0
src/views/MES/productionTask/index.vue

@@ -0,0 +1,383 @@
+<template>
+  <div class="pageIndexClass">
+    <div>
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :action-list="[
+              
+        ]" @get-list="getList">
+
+        <template #aa="{ item }">
+          <div style="width:100%">
+            <el-progress type="circle" :percentage="Number(item.completionRate)" width="60"
+                         :status="Number(item.completionRate) == 100 ? 'success' : ''" />
+          </div>
+        </template>
+
+        <template v-for="(slotItem, index) in processesData" v-slot:[slotItem.id]="{ item }" :key="slotItem.id">
+          <div style="width:100%">
+            aaa
+          </div>
+        </template>
+
+      </byTable>
+    </div>
+    <el-dialog :title="'打印二维码'" v-model="dialogVisible" width="350px" destroy-on-close>
+      <div>
+        <div id="pdfDom" style="width:100%">
+          <div style="font-size:20px;text-align:center">
+            {{printData.name}}
+          </div>
+          <div style="border-top: 1px solid #000;border-bottom: 1px solid #000; padding: 10px 0; margin:10px auto;text-align:center">
+            <div :ref="printData.id" style="width:200px;margin-left:55px">
+              {{printData.scanValue}}
+            </div>
+            <div style="font-size:20px;text-align:center;font-weight:700;margin-top:10px">
+              {{printData.createTime}}
+            </div>
+            <!-- 换页 -->
+            <!-- <div style="page-break-after: always"></div> -->
+          </div>
+          <div style="margin-left:10px;display:flex;flex-direction:column;justify-content:space-around">
+            <div style="font-size:14px;margin-top:8px"> 产品编码:{{printData.productName}}</div>
+            <div style="font-size:14px;margin-top:8px">
+              产品名称:{{printData.productSpec}}
+            </div>
+            <div style="font-size:14px;margin-top:8px">
+              原材料编码:{{printData.productSpec}}
+            </div>
+            <div style="font-size:14px;margin-top:8px">
+              原材料名称:{{printData.productSpec}}
+            </div>
+          </div>
+        </div>
+      </div>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" v-print="printObj" size="large">打 印</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import QRCode from "qrcodejs2-fix";
+
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const treeData = ref([]);
+const dialogVisible = ref(false);
+const modalType = ref("add");
+const statusData = ref([
+  {
+    label: "未开始",
+    value: "0",
+  },
+  {
+    label: "进行中",
+    value: "1",
+  },
+  {
+    label: "已完成",
+    value: "2",
+  },
+]);
+const selectConfig = computed(() => [
+  {
+    label: "生产状态",
+    prop: "status",
+    data: statusData.value,
+  },
+  {
+    type: "time",
+    label: "交期",
+    placeholder: "开始日期",
+    prop: "time",
+    placeholderOne: "结束日期",
+    propOne: "time1",
+    // data: status.value,
+  },
+  {
+    type: "time",
+    label: "下单日期",
+    placeholder: "开始日期",
+    prop: "time",
+    placeholderOne: "结束日期",
+    propOne: "time1",
+    // data: status.value,
+  },
+]);
+const config = ref([
+  {
+    attrs: {
+      label: "订单号",
+      prop: "code",
+    },
+  },
+  {
+    attrs: {
+      label: "设计图",
+      prop: "code",
+    },
+  },
+  {
+    attrs: {
+      label: "产品图片",
+      prop: "code",
+    },
+  },
+  {
+    attrs: {
+      label: "产品编码",
+      prop: "name",
+    },
+  },
+  {
+    attrs: {
+      label: "产品名称",
+      prop: "name",
+    },
+  },
+  {
+    attrs: {
+      label: "生产件数",
+      prop: "deptName",
+    },
+  },
+  {
+    attrs: {
+      label: "生产状态",
+      prop: "deptName",
+    },
+    render(val) {
+      return proxy.dictValueLabel(val, statusData.value);
+    },
+  },
+  {
+    attrs: {
+      label: "下单时间",
+      prop: "deptName",
+    },
+  },
+  {
+    attrs: {
+      label: "交期",
+      prop: "deptName",
+    },
+  },
+  {
+    attrs: {
+      label: "投产时间",
+      prop: "deptName",
+    },
+  },
+  {
+    attrs: {
+      label: "完成时间",
+      prop: "deptName",
+    },
+  },
+  {
+    attrs: {
+      label: "生产用时",
+      prop: "deptName",
+    },
+  },
+]);
+const formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+});
+const formDom = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "店铺编号",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "店铺名称",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "负责部门",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+const rules = ref({
+  deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
+  name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
+  code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
+});
+
+const getDeptData = () => {
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      treeData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDeptData();
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/shopInfo/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    definition: "2",
+    fileList: [],
+  };
+  if (currencyData.value && currencyData.value.length > 0) {
+    formData.data.currency = currencyData.value[0].dictKey;
+    formData.data.costCurrency = currencyData.value[0].dictKey;
+  }
+};
+
+const submitForm = () => {
+  formDom.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/shopInfo/" + modalType.value, formData.data).then(
+      (res) => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/shopInfo/detail", { id: row.id }).then((res) => {
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+const processesData = ref([]);
+const getProcesses = () => {
+  proxy
+    .post("/productionProcesses/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      for (let i = 0; i < res.rows.length; i++) {
+        const ele = res.rows[i];
+        let attrs = {
+          label: `[ ${ele.name} ]`,
+          slot: ele.id,
+          isNeedHeaderSlot: false,
+          width: 90,
+          fixed: "right",
+        };
+        config.value.push({
+          attrs,
+        });
+      }
+
+      config.value.push({
+        attrs: {
+          label: "操作",
+          width: "100",
+          align: "center",
+          fixed: "right",
+        },
+        renderHTML(row) {
+          return [
+            {
+              attrs: {
+                label: "打印二维码",
+                type: "primary",
+                text: true,
+              },
+              el: "button",
+              click() {
+                printQrCode(row);
+              },
+            },
+          ];
+        },
+      });
+      processesData.value = res.rows;
+    });
+};
+getProcesses();
+getList();
+const printData = ref({});
+const printQrCode = (row) => {
+  printData.value = row;
+  dialogVisible.value = true;
+  nextTick(() => {
+    proxy.$refs[row.id].innerHTML = ""; //清除二维码方法一
+    new QRCode(proxy.$refs[row.id], {
+      text: row.id,
+      width: 200,
+      height: 200,
+      colorDark: "#000000",
+      colorLight: "#ffffff",
+      correctLevel: QRCode.CorrectLevel.H,
+    });
+  });
+};
+const printObj = ref({
+  id: "pdfDom",
+  popTitle: "",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.el-progress__text) {
+  font-size: 14px !important;
+}
+.content {
+  padding: 20px;
+}
+</style>

+ 5 - 12
src/views/login.vue

@@ -31,11 +31,11 @@
             <h2>SANFAN MES制造执行系统
               <!-- {{ $t("login.managementSystem") }} -->
             </h2>
-            <el-form-item prop="tenantId" style="margin-top: 30px">
-              <!-- <el-input :placeholder="$t('login.pleaseEnterTheTenantId')" prefix-icon="user" @keyup.enter="handleLogin" autocomplete="email"
+            <!-- <el-form-item prop="tenantId" style="margin-top: 30px"> -->
+            <!-- <el-input :placeholder="$t('login.pleaseEnterTheTenantId')" prefix-icon="user" @keyup.enter="handleLogin" autocomplete="email"
                           v-model="loginForm.tenantId">
                 </el-input> -->
-              <div style="display:flex;width:100%;align-items:center">
+            <!-- <div style="display:flex;width:100%;align-items:center">
                 <div style="width:23px;text-align:right;margin-top:2px">
                   <el-icon color="#a8abb2">
                     <User />
@@ -46,7 +46,7 @@
                 </el-select>
               </div>
 
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item prop="username" style="margin-top: 30px">
               <el-input :placeholder="$t('login.pleaseEnterYourAccountNumber')" prefix-icon="UserFilled" @keyup.enter="handleLogin"
                         autocomplete="username" v-model="loginForm.username">
@@ -91,18 +91,11 @@ const loginForm = ref({
   username: "",
   password: "",
   rememberMe: false,
-  tenantId: "",
+  tenantId: "000000",
   code: "",
   uuid: "",
 });
 const tenantList = ref([]);
-const env = import.meta.env.VITE_APP_ENV;
-if (env == "production") {
-  loginForm.tenantId = "EHSD";
-} else {
-  loginForm.tenantId = "ehtest";
-}
-
 const loginRules = {
   username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
   password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],

+ 1 - 1
src/views/process/processConfig/vueFlow.vue

@@ -1023,6 +1023,6 @@ onMounted(() => {
   }
 }
 #stencil .x6-widget-stencil-content .x6-widget-stencil-group-content .x6-graph {
-  // height: 900px !important;
+  height: 900px !important;
 }
 </style>

+ 1 - 12
src/views/product/material/index.vue

@@ -474,18 +474,7 @@ const getList = async (req) => {
     const productIdList = res.rows.map((x) => x.id);
     // 请求文件数据并回显
     if (productIdList.length > 0) {
-      proxy
-        .post("/fileInfo/getList", { businessIdList: productIdList })
-        .then((fileObj) => {
-          for (let i = 0; i < sourceList.value.data.length; i++) {
-            const e = sourceList.value.data[i];
-            for (const key in fileObj) {
-              if (e.id === key) {
-                e.fileList = fileObj[key];
-              }
-            }
-          }
-        });
+      proxy.getFile(productIdList, sourceList.value.data, "id");
     }
   });
 };

+ 1 - 1
src/views/production/project/technology/index.vue

@@ -364,7 +364,7 @@ const getList = async (req) => {
       }, 200);
     });
 };
-const getProcesses = async () => {
+const getProcesses = () => {
   proxy
     .post("/productionProcesses/page", { pageNum: 1, pageSize: 9999 })
     .then((message) => {

+ 31 - 19
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -14,10 +14,11 @@
             action: () => start(),
           },
         ]" @get-list="getList">
-        <template #fileSlot="{ item }">
-          <div style="cursor: pointer; color: #409eff" @click="handleClickFile(item)">
-            {{ item.fileName }}
+        <template #pic="{ item }">
+          <div v-if="item.fileList.length > 0">
+            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
           </div>
+          <div v-else></div>
         </template>
         <template #size="{ item }">
           <div v-if="item.productLength && item.productWidth && item.productHeight">
@@ -164,7 +165,14 @@ const config = computed(() => {
         width: 150,
       },
     },
-
+    {
+      attrs: {
+        label: "物料图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
     {
       attrs: {
         label: "物料编码",
@@ -325,16 +333,21 @@ const getList = async (req) => {
   loading.value = true;
   proxy
     .post("/subscribeDetail/page", sourceList.value.pagination)
-    .then((message) => {
-      console.log(message);
-      sourceList.value.data = message.rows.map((x) => ({
+    .then((res) => {
+      sourceList.value.data = res.rows.map((x) => ({
         ...x,
         isCheck: true,
       }));
-      sourceList.value.pagination.total = message.total;
+      sourceList.value.pagination.total = res.total;
       setTimeout(() => {
         loading.value = false;
       }, 200);
+
+      let productIdList = res.rows.map((x) => x.productId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFile(productIdList, sourceList.value.data, "productId");
+      }
     });
 };
 // const openModal = () => {
@@ -398,17 +411,6 @@ const handleBeforeUpload = async (file) => {
     },
   ];
 };
-const handleClickFile = (row) => {
-  ElMessage({
-    message: "数据请求中,请稍后!",
-    type: "success",
-  });
-  let id = row.id;
-  proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
-    const file = res[id][0];
-    window.open(file.fileUrl, "_blank");
-  });
-};
 
 const handlePreview = (file) => {
   console.log(file);
@@ -471,6 +473,9 @@ const start = () => {
     });
   }
 };
+const handleClickFile = (file) => {
+  window.open(file.fileUrl, "_blank");
+};
 </script>
   
 <style lang="scss" scoped>
@@ -480,4 +485,11 @@ const start = () => {
 :deep(.el-table__header-wrapper .el-checkbox) {
   display: none;
 }
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
 </style>