cz 1 år sedan
förälder
incheckning
6cbb7a4ba7

+ 3 - 1
src/assets/styles/index.scss

@@ -124,7 +124,7 @@ aside {
 
 //main-container全局样式
 .app-container {
-  padding: 20px;
+  padding: 10px;
 }
 
 .components-container {
@@ -236,6 +236,8 @@ aside {
 }
 
 
+
+
 ::-webkit-scrollbar {
   /* 垂直滚动条宽度 */
   width: 8px !important;

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

@@ -438,6 +438,7 @@ export default defineComponent({
     };
 
     const searchItemSelctOne = (item, prop, propOne) => {
+      console.log(prop, propOne, "sssss");
       if (prop && propOne) {
         proxy.$emit(
           "getList",
@@ -446,6 +447,14 @@ export default defineComponent({
             [item.propOne]: propOne,
           })
         );
+      } else if (prop == null && propOne == null) {
+        proxy.$emit(
+          "getList",
+          Object.assign(props.filterParams, {
+            [item.prop]: prop,
+            [item.propOne]: propOne,
+          })
+        );
       }
     };
 

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

@@ -712,9 +712,11 @@ const plugDowload = () => {
       display: flex;
       flex-direction: column;
       justify-content: space-between;
+      border: 0.5px solid #515151;
       &:hover {
         background: #616161;
         // border: 1px solid #fff;
+        border-color: #fff;
       }
     }
     .active-item {
@@ -732,9 +734,9 @@ const plugDowload = () => {
     display: flex;
     justify-content: space-between;
     align-items: center;
+
     &:hover {
       background: #616161;
-      // border: 1px solid #fff;
     }
     .icon {
       // font-size: 20px;

+ 7 - 1
src/components/process/SF/Contract.vue

@@ -350,7 +350,12 @@ const formData = reactive({
 const uploadData = ref({});
 const formDom = ref(null);
 const judgeStatus = () => {
-  if (route.query.processType == 20 || route.query.processType == 10) {
+  if (
+    route.query.processType == 20 ||
+    route.query.processType == 10 ||
+    props.queryData.processType == 20 ||
+    props.queryData.processType == 10
+  ) {
     return true;
   }
   if (props.queryData.recordList && props.queryData.recordList.length > 0) {
@@ -1181,6 +1186,7 @@ onMounted(() => {
 watch(
   () => props.queryData,
   (val) => {
+    console.log(val, "ssssssss");
     nextTick(() => {
       formOption.disabled = judgeStatus();
     });

+ 2 - 2
src/views/JST/shopManage/index.vue

@@ -22,8 +22,8 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
       </byForm>
       <template #footer>
-        <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="defualt" :loading="submitLoading">
+        <el-button @click="dialogVisible = false" size="defualt" v-debounce>取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="defualt" v-debounce :loading="submitLoading">
           确 定
         </el-button>
       </template>

+ 337 - 0
src/views/MES/productionMaterial/index.vue

@@ -0,0 +1,337 @@
+<template>
+  <div class="pageIndexClass">
+    <div style="background:#fff">
+      <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-change="handleTabChange">
+        <el-tab-pane label="待备料" name="first">
+          <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+                   :selectConfig="selectConfig" :action-list="[
+           {
+                text: '打印备料单',
+                action: () => openModal('add'),
+                disabled: selectData.length==0,
+              } 
+        ]" :table-events="{
+          //element talbe事件都能传
+          select: selectRow,
+       'select-all':selectRow
+        }" @get-list="getList">
+
+          </byTable>
+        </el-tab-pane>
+        <el-tab-pane label="已备料" name="second">
+          <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="configOne" :loading="loading" highlight-current-row
+                   :selectConfig="selectConfig" :action-list="[
+            
+        ]" @get-list="getList">
+
+          </byTable>
+        </el-tab-pane>
+      </el-tabs>
+
+    </div>
+    <el-dialog :title="'打印备料单'" v-model="dialogVisible" width="1200px" destroy-on-close>
+      <div style="width:100%">
+        <div style="height: calc(100vh - 250px); overflow-y: auto; overflow-x: hidden">
+          <div class="printBomList" id="pdfDom">
+            <div class="t">生产备料单</div>
+            <div class="time" style="text-align: right">
+              {{ printTime }}
+            </div>
+            <table border="1" cellspacing="0" class="table">
+              <thead>
+                <tr>
+                  <td style="width: 40px; text-align: center">编号</td>
+                  <td style="width: 110px">物料编码</td>
+                  <td>物料名称</td>
+                  <td style="width: 80px; text-align: center">数量</td>
+                </tr>
+              </thead>
+              <tbody v-if="selectData && selectData.length > 0">
+                <tr v-for="(item, index) in selectData" :key="index">
+                  <td style="text-align: center">{{ index +1}}</td>
+                  <td>{{ item.artworkName }}</td>
+                  <td>{{ item.skuSpecCode }}</td>
+                  <td style="text-align: center">{{ item.quantity }}</td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </div>
+      </div>
+
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="defualt" v-debounce>取 消</el-button>
+        <el-button type="primary" v-print="printObj" size="defualt" v-debounce>打 印</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";
+import moment from "moment";
+
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const submitLoading = ref(false);
+const activeName = ref("first");
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const treeData = ref([]);
+const dialogVisible = ref(false);
+const modalType = ref("add");
+
+const selectConfig = computed(() => [
+  {
+    type: "time",
+    label: "日期",
+    placeholder: "开始日期",
+    prop: "beginTime",
+    placeholderOne: "结束日期",
+    propOne: "endTime",
+  },
+]);
+
+const config = ref([
+  {
+    type: "selection",
+    attrs: {
+      checkAtt: "isCheck",
+      width: 60,
+    },
+  },
+  {
+    attrs: {
+      label: "设计图",
+      prop: "code",
+    },
+  },
+  {
+    attrs: {
+      label: "物料图片",
+      prop: "code",
+    },
+  },
+  {
+    attrs: {
+      label: "物料编码",
+      prop: "code",
+    },
+  },
+  {
+    attrs: {
+      label: "物料名称",
+      prop: "name",
+    },
+  },
+  {
+    attrs: {
+      label: "数量",
+      prop: "name",
+    },
+  },
+  {
+    attrs: {
+      label: "时间",
+      prop: "deptName",
+    },
+  },
+]);
+const configOne = 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",
+    },
+  },
+]);
+const formData = reactive({
+  data: {
+    list: [],
+  },
+});
+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 getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/produceOrderDetail/page", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows.map((x) => ({ ...x, isCheck: true }));
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+
+const handleTabChange = (val) => {
+  getList();
+};
+
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
+const printTime = ref("");
+const openModal = () => {
+  dialogVisible.value = true;
+  printTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
+};
+
+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;
+  });
+};
+
+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;
+}
+.printBomList {
+  width: 100%;
+  font-size: 12px !important;
+  .t {
+    text-align: center;
+    font-size: 26px;
+    font-weight: 700;
+    margin: 10px 0px;
+  }
+  .time {
+    margin-bottom: 10px;
+  }
+  .table {
+    width: 100%;
+    td {
+      padding: 4px;
+    }
+  }
+}
+</style>

+ 20 - 35
src/views/MES/productionOrder/index.vue

@@ -8,8 +8,21 @@
 
         <template #list="{ item }">
           <div style="width:100%">
-            <el-progress type="circle" :percentage="Number(item.completionRate)" width="60"
-                         :status="Number(item.completionRate) == 100 ? 'success' : ''" />
+            <span v-for="(product ,index) in item.produceOrderDetailList" style="margin-right:15px">
+              <el-popover placement="top-start" :width="300" trigger="hover">
+                <div>
+                  <div>产品编码:{{product.productCode}}</div>
+                  <div>产品名称:{{product.productName}}</div>
+                  <div>产品尺寸:{{product.productLength}}cm*{{product.productWidth}}cm*{{product.productHeight}}cm</div>
+                </div>
+                <template #reference>
+                  <el-progress type="circle" :percentage="(Number(product.finishQuantity) / Number(product.quantity))*100" width="60"
+                               :status="(Number(product.finishQuantity) / Number(product.quantity))*100 == 100 ? 'success' : ''" />
+                </template>
+              </el-popover>
+
+            </span>
+
           </div>
         </template>
 
@@ -63,42 +76,28 @@ const statusData = ref([
 const selectConfig = computed(() => [
   {
     label: "生产状态",
-    prop: "status",
+    prop: "produceStatus",
     data: statusData.value,
   },
   {
     type: "time",
     label: "交期",
     placeholder: "开始日期",
-    prop: "time",
+    prop: "staDeliveryPeriod",
     placeholderOne: "结束日期",
-    propOne: "time1",
-    // data: status.value,
+    propOne: "endDeliveryPeriod",
   },
   {
     type: "time",
     label: "下单日期",
     placeholder: "开始日期",
-    prop: "time",
+    prop: "beginTime",
     placeholderOne: "结束日期",
-    propOne: "time1",
-    // data: status.value,
+    propOne: "endTime",
   },
 ]);
 const config = computed(() => {
   return [
-    // {
-    //   type: "selection",
-    //   attrs: {
-    //     checkAtt: "isCheck",
-    //   },
-    // },
-    // {
-    //   attrs: {
-    //     label: "事业部",
-    //     prop: "code",
-    //   },
-    // },
     {
       attrs: {
         label: "订单号",
@@ -205,20 +204,6 @@ const rules = ref({
   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;

+ 96 - 47
src/views/MES/productionTask/index.vue

@@ -6,16 +6,32 @@
               
         ]" @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' : ''" />
+        <template #pic="{ item }">
+          <div v-if="item.fileList &&item.fileList.length > 0">
+            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
+          </div>
+          <div v-else></div>
+        </template>
+
+        <template #picOne="{ item }">
+          <div v-if="item.fileListOne &&item.fileListOne.length > 0">
+            <img :src="item.fileListOne[0].fileUrl" class="pic" @click="handleClickFile(item.fileListOne[0])" />
           </div>
+          <div v-else></div>
         </template>
 
         <template v-for="(slotItem, index) in processesData" v-slot:[slotItem.id]="{ item }" :key="slotItem.id">
           <div style="width:100%">
-            aaa
+            <div v-if="isShowCotent(slotItem,item)">
+              <el-icon :size="20" color="green">
+                <CircleCheckFilled />
+              </el-icon>
+            </div>
+            <div v-else>
+              <el-icon :size="20" color="red">
+                <CircleClose />
+              </el-icon>
+            </div>
           </div>
         </template>
 
@@ -52,8 +68,8 @@
         </div>
       </div>
       <template #footer>
-        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" v-print="printObj" size="large">打 印</el-button>
+        <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
+        <el-button type="primary" v-print="printObj" size="defualt">打 印</el-button>
       </template>
     </el-dialog>
   </div>
@@ -96,69 +112,74 @@ const statusData = ref([
 const selectConfig = computed(() => [
   {
     label: "生产状态",
-    prop: "status",
+    prop: "produceStatus",
     data: statusData.value,
   },
   {
     type: "time",
     label: "交期",
     placeholder: "开始日期",
-    prop: "time",
+    prop: "staDeliveryPeriod",
     placeholderOne: "结束日期",
-    propOne: "time1",
-    // data: status.value,
+    propOne: "endDeliveryPeriod",
   },
   {
     type: "time",
     label: "下单日期",
     placeholder: "开始日期",
-    prop: "time",
+    prop: "beginTime",
     placeholderOne: "结束日期",
-    propOne: "time1",
-    // data: status.value,
+    propOne: "endTime",
   },
 ]);
 const config = ref([
   {
     attrs: {
       label: "订单号",
-      prop: "code",
+      prop: "orderCode",
+      width: 130,
     },
   },
   {
     attrs: {
       label: "设计图",
-      prop: "code",
+      slot: "picOne",
+      width: 80,
     },
   },
   {
     attrs: {
       label: "产品图片",
-      prop: "code",
+      slot: "pic",
+      width: 80,
     },
   },
   {
     attrs: {
       label: "产品编码",
-      prop: "name",
+      prop: "productCode",
+      width: 130,
     },
   },
   {
     attrs: {
       label: "产品名称",
-      prop: "name",
+      prop: "productName",
+      "min-width": 130,
     },
   },
   {
     attrs: {
       label: "生产件数",
-      prop: "deptName",
+      prop: "quantity",
+      width: 100,
     },
   },
   {
     attrs: {
       label: "生产状态",
-      prop: "deptName",
+      prop: "produceStatus",
+      width: 100,
     },
     render(val) {
       return proxy.dictValueLabel(val, statusData.value);
@@ -167,31 +188,36 @@ const config = ref([
   {
     attrs: {
       label: "下单时间",
-      prop: "deptName",
+      prop: "orderCreateTime",
+      width: 160,
     },
   },
   {
     attrs: {
       label: "交期",
-      prop: "deptName",
+      prop: "deliveryPeriod",
+      width: 160,
     },
   },
   {
     attrs: {
       label: "投产时间",
-      prop: "deptName",
+      prop: "produceTime",
+      width: 160,
     },
   },
   {
     attrs: {
       label: "完成时间",
-      prop: "deptName",
+      prop: "finishTime",
+      width: 160,
     },
   },
   {
     attrs: {
       label: "生产用时",
-      prop: "deptName",
+      prop: "usageTime",
+      width: 100,
     },
   },
 ]);
@@ -238,30 +264,34 @@ const rules = ref({
   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);
-  });
+  proxy
+    .post("/produceOrderDetail/page", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+      const productIdList = res.rows.map((x) => x.productId);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy.getFile(productIdList, sourceList.value.data, "productId");
+      }
+
+      const productIdListOne = res.rows.map((x) => x.contractDetailId);
+      // 请求文件数据并回显
+      if (productIdListOne.length > 0) {
+        proxy.getFile(
+          productIdListOne,
+          sourceList.value.data,
+          "contractDetailId",
+          "fileListOne"
+        );
+      }
+    });
 };
 
 const openModal = () => {
@@ -371,6 +401,18 @@ const printObj = ref({
     "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"/>',
 });
+
+const handleClickFile = (file) => {
+  window.open(file.fileUrl, "_blank");
+};
+
+const isShowCotent = (slot, item) => {
+  if (item && item.productionProcessesList) {
+    return item.productionProcessesList.some((x) => x.id == slot.id);
+  } else {
+    return false;
+  }
+};
 </script>
 
 <style lang="scss" scoped>
@@ -380,4 +422,11 @@ const printObj = ref({
 .content {
   padding: 20px;
 }
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
 </style>

+ 337 - 0
src/views/MES/productionWorkOrder/index.vue

@@ -0,0 +1,337 @@
+<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="defualt">取 消</el-button>
+        <el-button type="primary" v-print="printObj" size="defualt">打 印</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: "produceStatus",
+    data: statusData.value,
+  },
+  {
+    type: "time",
+    label: "交期",
+    placeholder: "开始日期",
+    prop: "staDeliveryPeriod",
+    placeholderOne: "结束日期",
+    propOne: "endDeliveryPeriod",
+  },
+  {
+    type: "time",
+    label: "下单日期",
+    placeholder: "开始日期",
+    prop: "beginTime",
+    placeholderOne: "结束日期",
+    propOne: "endTime",
+  },
+]);
+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",
+    },
+    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 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,
+        });
+      }
+      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>

+ 8 - 18
src/views/index.vue

@@ -35,12 +35,7 @@
           <el-table-column prop="createTime" label="发起时间" width="155" />
           <el-table-column fixed="right" label="操作" width="60">
             <template #default="scope">
-              <el-button
-                link
-                type="primary"
-                size="small"
-                @click="pushProcessApproval(scope.row)"
-              >
+              <el-button link type="primary" size="small" @click="pushProcessApproval(scope.row)">
                 审批
               </el-button>
             </template>
@@ -59,12 +54,7 @@
           <el-table-column prop="createTime" label="发起时间" width="155" />
           <el-table-column fixed="right" label="操作" width="60">
             <template #default="scope">
-              <el-button
-                link
-                type="primary"
-                size="small"
-                @click="pushProcessApprovalOne(scope.row)"
-              >
+              <el-button link type="primary" size="small" @click="pushProcessApprovalOne(scope.row)">
                 查看
               </el-button>
             </template>
@@ -256,7 +246,7 @@ onMounted(() => {});
   }
   .table-warp {
     //页面全屏,占据剩下的位置
-    height: calc(100% - 157px);
+    height: calc(100% - 137px);
     border-radius: 5px;
 
     .card {
@@ -271,21 +261,21 @@ onMounted(() => {});
       width: calc(66.5% - 10px);
     }
     .even {
-      margin-left: 20px;
-      width: calc(33.5% - 10px);
+      margin-left: 10px;
+      width: 33.5%;
     }
     // .card:nth-child(2n + 1) {
     //   margin-right: 20px;
     // }
     .card:nth-child(1) {
-      margin-bottom: 20px;
+      margin-bottom: 10px;
     }
     .card:nth-child(2) {
-      margin-bottom: 20px;
+      margin-bottom: 10px;
     }
   }
   .stat-warp {
-    margin-bottom: 20px;
+    margin-bottom: 10px;
     background: #fff;
     padding: 20px;
     overflow: hidden;