Parcourir la source

全局样式更改

cz il y a 1 an
Parent
commit
3128739ac6

+ 5 - 0
src/assets/styles/element-ui.scss

@@ -1,5 +1,10 @@
 // cover some element-ui styles
 // cover some element-ui styles
 
 
+.el-table .el-table__cell {
+  padding: 2px 0px !important;
+  font-size: 12px !important
+}
+
 .el-breadcrumb__inner,
 .el-breadcrumb__inner,
 .el-breadcrumb__inner a {
 .el-breadcrumb__inner a {
   font-weight: 400 !important;
   font-weight: 400 !important;

+ 38 - 17
src/components/byTable/index.vue

@@ -57,12 +57,16 @@
         </div>
         </div>
         <div class="by-dropdown" v-for="(i, index) in selectConfigCopy" :key="i.prop" style="margin-right: 10px">
         <div class="by-dropdown" v-for="(i, index) in selectConfigCopy" :key="i.prop" style="margin-right: 10px">
           <div v-if="i.type" class="selectTime" style="display:flex;align-items:center">
           <div v-if="i.type" class="selectTime" style="display:flex;align-items:center">
-            <span style="font-size:14px;height:32px;margin-right:15px">{{i.label || ''}}</span>
-            <el-date-picker v-model="pagination[i.prop]" type="date" size="small" :placeholder="i.placeholder" style="width:120px"
-                            value-format="YYYY-MM-DD HH:mm:ss" @change="searchItemSelctOne(i,pagination[i.prop],pagination[i.propOne])" />
-            <span style="margin-right:25px">-</span>
-            <el-date-picker v-model="pagination[i.propOne]" type="date" size="small" :placeholder="i.placeholderOne" style="width:120px"
-                            value-format="YYYY-MM-DD HH:mm:ss" @change="searchItemSelctOne(i,pagination[i.prop],pagination[i.propOne])" />
+            <span style="font-size:12px;height:32px;margin-right:15px">{{i.label || ''}}</span>
+            <el-date-picker v-model="pagination[i.prop]" :type="i.itemType?i.itemType:'date'" size="small" :placeholder="i.placeholder"
+                            style="width:120px" :value-format="dateFormatInit(i.itemType)"
+                            @change="i.fn?i.fn(pagination[i.prop]):searchItemSelctOne(i,pagination[i.prop],pagination[i.propOne])"
+                            :clearable="i.clearable!=undefined?i.clearable :true" />
+            <span style="margin-right:25px" v-if="i.propOne">-</span>
+            <el-date-picker v-model="pagination[i.propOne]" v-if="i.propOne" :type="i.itemType?i.itemType:'date'" size="small"
+                            :placeholder="i.placeholderOne" style="width:120px" :value-format="dateFormatInit(i.itemType)"
+                            @change="i.fn?i.fn(pagination[i.propOne]):searchItemSelctOne(i,pagination[i.prop],pagination[i.propOne])"
+                            :clearable="i.clearable!=undefined?i.clearable :true" />
           </div>
           </div>
           <div v-else>
           <div v-else>
             <div class="by-dropdown-title">
             <div class="by-dropdown-title">
@@ -82,7 +86,7 @@
       </div>
       </div>
 
 
       <div style="display: flex;align-items:center">
       <div style="display: flex;align-items:center">
-        <el-input :placeholder="$t('common.pleaseEnterKeywords')" suffix-icon="search" size="mini" v-model="pagination.keyword"
+        <el-input :placeholder="$t('common.pleaseEnterKeywords')" style="font-size:12px" suffix-icon="search" size="mini" v-model="pagination.keyword"
                   @keyup.enter="searchFn">
                   @keyup.enter="searchFn">
         </el-input>
         </el-input>
         <el-icon :size="16" style="cursor:pointer;margin-left: 10px" @click="searchFn">
         <el-icon :size="16" style="cursor:pointer;margin-left: 10px" @click="searchFn">
@@ -508,6 +512,22 @@ export default defineComponent({
       }
       }
     };
     };
 
 
+    const dateFormatInit = (itemType) => {
+      if (!itemType) {
+        return "YYYY-MM-DD HH:mm:ss";
+      }
+      const formatObj = {
+        year: "YYYY",
+        month: "YYYY-MM",
+        date: "YYYY-MM-DD HH:mm:ss",
+        dates: "YYYY-MM-DD",
+        datetime: "YYYY-MM-DD HH:mm:ss",
+        monthrange: "YYYY-MM-DD HH:mm:ss",
+        datetimerange: "YYYY-MM-DD HH:mm:ss",
+        daterange: "YYYY-MM-DD HH:mm:ss",
+      };
+      return formatObj[itemType];
+    };
     const searchItemSelctOne = (item, prop, propOne) => {
     const searchItemSelctOne = (item, prop, propOne) => {
       if (prop && propOne) {
       if (prop && propOne) {
         let str = "";
         let str = "";
@@ -569,6 +589,7 @@ export default defineComponent({
       searchFn,
       searchFn,
       searchItemSelct,
       searchItemSelct,
       getSelectLabel,
       getSelectLabel,
+      dateFormatInit,
       searchItemSelctOne,
       searchItemSelctOne,
       selectConfigCopy,
       selectConfigCopy,
       isSelectable,
       isSelectable,
@@ -645,14 +666,14 @@ export default defineComponent({
       outline: none;
       outline: none;
       -webkit-appearance: none;
       -webkit-appearance: none;
       appearance: none;
       appearance: none;
-      font-size: 14px;
+      font-size: 12px;
       font-weight: bold;
       font-weight: bold;
       background: url("@/assets/images/sanjiao.png") no-repeat right center;
       background: url("@/assets/images/sanjiao.png") no-repeat right center;
       padding-right: 20px;
       padding-right: 20px;
     }
     }
     div {
     div {
       height: 60px;
       height: 60px;
-      font-size: 14px;
+      font-size: 12px;
       font-weight: bold;
       font-weight: bold;
       line-height: 60px;
       line-height: 60px;
     }
     }
@@ -673,7 +694,7 @@ export default defineComponent({
       color: #333333;
       color: #333333;
       border-radius: 10px;
       border-radius: 10px;
       .label {
       .label {
-        font-size: 14px;
+        font-size: 12px;
       }
       }
       .label::before {
       .label::before {
         width: 10px;
         width: 10px;
@@ -728,7 +749,7 @@ export default defineComponent({
         display: none;
         display: none;
       }
       }
       .label {
       .label {
-        font-size: 14px;
+        font-size: 12px;
         font-weight: bold;
         font-weight: bold;
         color: #333;
         color: #333;
         margin-bottom: 8px;
         margin-bottom: 8px;
@@ -746,7 +767,7 @@ export default defineComponent({
           }
           }
           .label-small {
           .label-small {
             color: #666;
             color: #666;
-            font-size: 14px;
+            font-size: 12px;
           }
           }
         }
         }
       }
       }
@@ -776,7 +797,7 @@ export default defineComponent({
   line-height: 32px;
   line-height: 32px;
 
 
   .by-dropdown-title {
   .by-dropdown-title {
-    font-size: 14px;
+    font-size: 12px;
     background-color: #fff;
     background-color: #fff;
   }
   }
   ul {
   ul {
@@ -855,10 +876,10 @@ export default defineComponent({
   }
   }
   .el-table {
   .el-table {
     :deep() th {
     :deep() th {
-      font-size: 14px;
+      font-size: 12px;
     }
     }
     :deep() td {
     :deep() td {
-      font-size: 14px;
+      font-size: 12px;
     }
     }
   }
   }
 }
 }
@@ -872,10 +893,10 @@ export default defineComponent({
 }
 }
 :deep(.selectTime .el-input__inner) {
 :deep(.selectTime .el-input__inner) {
   color: #000 !important;
   color: #000 !important;
-  font-size: 14px !important;
+  font-size: 12px !important;
 }
 }
 :deep(.selectTime .el-input .el-input__icon) {
 :deep(.selectTime .el-input .el-input__icon) {
   color: #000 !important;
   color: #000 !important;
-  font-size: 14px !important;
+  font-size: 12px !important;
 }
 }
 </style>
 </style>

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

@@ -615,8 +615,6 @@ onMounted(() => {
     if (sidebarRoutersCopy.value && sidebarRoutersCopy.value.length > 0) {
     if (sidebarRoutersCopy.value && sidebarRoutersCopy.value.length > 0) {
       openLeftBaner(sidebarRoutersCopy.value[0], 0);
       openLeftBaner(sidebarRoutersCopy.value[0], 0);
     }
     }
-    console.log(sidebarRoutersCopy.value, "resaa");
-
     //循环删除 i.status != 0 || i.visible != 0 的元素
     //循环删除 i.status != 0 || i.visible != 0 的元素
     sidebarRoutersCopy.value.map((item) => {
     sidebarRoutersCopy.value.map((item) => {
       if (item.children) {
       if (item.children) {

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

@@ -236,8 +236,7 @@
             <el-table-column label="备注" min-width="200">
             <el-table-column label="备注" min-width="200">
               <template #default="{ row, $index }">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                 <div style="width: 100%">
-                  <el-form-item :prop="'contractProductList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true"
-                                class="margin-b-0 wid100">
+                  <el-form-item :prop="'contractProductList.' + $index + '.remark'" :inline-message="true" class="margin-b-0 wid100">
                     <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
                     <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
                   </el-form-item>
                   </el-form-item>
                 </div>
                 </div>

+ 17 - 1
src/utils/date.js

@@ -208,7 +208,23 @@ export function getNowM() {
   return current_month
   return current_month
 }
 }
 
 
-// 获取当前月的所有日期
+// 获取指定日期的月份的所有日期
+export function getDateAllDay(dateObj) {
+  let date = new Date(dateObj)
+  var year = date.getFullYear()
+  var month = date.getMonth() + 1
+  var d = new Date(year, month, 0)
+  let current_month_num = d.getDate()
+  let current_month = []
+  for (let i = 1; i <= current_month_num; i++) {
+    let day = date.setDate(i)
+    let everyDay = formatDate(day)
+    current_month.push(everyDay)
+  }
+  return current_month
+}
+
+// 获取当年的所有月份
 export function getAllMonth() {
 export function getAllMonth() {
   var data = []
   var data = []
   var myDate = new Date()
   var myDate = new Date()

+ 1 - 1
src/views/EHSD/saleContract/PriceSheetDetail.vue

@@ -195,7 +195,7 @@ const provinceData = ref([]);
 const cityData = ref([]);
 const cityData = ref([]);
 const formData = reactive({
 const formData = reactive({
   data: {
   data: {
-    type: "1",
+    type: 1,
     quotationProductList: [],
     quotationProductList: [],
   },
   },
 });
 });

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

@@ -0,0 +1,368 @@
+<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 #product="{ item }">
+          <div>
+            aaaaaaa
+          </div>
+        </template>
+        <template #date="{ item }">
+          <div>
+            <div>2024-01-09</div>
+            <div>2024-01-18</div>
+          </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";
+import { getDateAllDay } from "@/utils/date.js";
+import moment from "moment";
+
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const submitLoading = ref(false);
+let str = moment().format("yyyy-MM");
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    produceStatus: "",
+    staDeliveryPeriod: str,
+    endDeliveryPeriod: "",
+    beginTime: "",
+    endTime: "",
+  },
+});
+const treeData = ref([]);
+const dialogVisible = ref(false);
+const modalType = ref("add");
+const statusData = ref([
+  {
+    label: "未开始",
+    value: "0",
+  },
+  {
+    label: "进行中",
+    value: "1",
+  },
+  {
+    label: "已完成",
+    value: "2",
+  },
+]);
+const allDay = ref([]);
+const changDay = (val) => {
+  allDay.value = getDateAllDay(val);
+  for (let i = 0; i < allDay.value.length; i++) {
+    const ele = allDay.value[i];
+    let attrs = {
+      label: `${ele.substr(8, 10)}`,
+      slot: ele,
+      isNeedHeaderSlot: false,
+      width: 50,
+      // fixed: "right",
+    };
+    config.value.push({
+      attrs,
+    });
+  }
+};
+const selectConfig = computed(() => [
+  {
+    label: "生产状态",
+    prop: "produceStatus",
+    data: statusData.value,
+  },
+  {
+    type: "time",
+    itemType: "month",
+    label: "生产日期",
+    placeholder: "请选择生产日期",
+    prop: "staDeliveryPeriod",
+    clearable: false,
+    placeholderOne: "结束日期",
+    propOne: "",
+    fn: (val) => {
+      changDay(val);
+    },
+  },
+]);
+const config = ref([
+  {
+    attrs: {
+      label: "生产订单号",
+      prop: "orderCode",
+      width: 130,
+      fixed: "left",
+    },
+  },
+  {
+    attrs: {
+      label: "产品",
+      slot: "product",
+      "min-width": 300,
+      fixed: "left",
+    },
+  },
+  {
+    attrs: {
+      label: "生产日期",
+      slot: "date",
+      width: 130,
+      fixed: "left",
+    },
+  },
+]);
+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("/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"
+        );
+      }
+    },
+    (err) => {
+      loading.value = false;
+    }
+  );
+};
+
+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();
+changDay(str);
+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"/>',
+});
+
+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>
+::v-deep(.el-progress__text) {
+  font-size: 14px !important;
+}
+</style>

+ 70 - 0
src/views/MES/productionScheduling/index1.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="pageIndexClass">
+    <table border style="width:100%" class="table">
+      <thead>
+        <tr>
+          <td>生产订单号</td>
+          <td>产品</td>
+          <td style="width:30px" v-for="day in allDay" :key="day">
+            {{day.substr(8,10)}}
+          </td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr v-for="row in tableData" :key="row.id">
+          <td>
+            {{row.code}}
+          </td>
+          <td>
+            {{row.product}}
+          </td>
+          <td style="width:30px" class="td" v-for="day in allDay" :key="day">
+            {{day.substr(8,10)}}
+            <div class="ta">
+
+            </div>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+  </div>
+</template>
+
+<script setup>
+import { getAllMonth, getNowM } from "@/utils/date.js";
+const tableData = ref([]);
+const allDay = ref([]);
+
+for (let i = 0; i < 5; i++) {
+  tableData.value.push({
+    id: i,
+    code: "code" + i,
+    product: "产品" + i,
+    strDate: "2024-01-0" + i,
+    endDate: "2024-01-2" + (i + 2),
+  });
+}
+console.log(tableData.value, "ss");
+
+allDay.value = getNowM();
+console.log(allDay.value, "sss");
+</script>
+
+<style lang="scss" scoped>
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+  .td {
+    position: relative;
+    .ta {
+      width: 30px;
+      height: 20px;
+      position: absolute;
+      border-radius: 15px;
+      left: 60px;
+      z-index: 1000;
+      background: green;
+    }
+  }
+}
+</style>