Преглед на файлове

生产排程页面以及bug

cz преди 1 година
родител
ревизия
1034bafebe

+ 12 - 2
src/assets/styles/element-ui.scss

@@ -1,10 +1,20 @@
 // cover some element-ui styles
-
+// 全局字号大小
 .el-table .el-table__cell {
-  padding: 2px 0px !important;
+  padding: 4px 0px !important;
   font-size: 12px !important
 }
 
+.el-form-item--default .el-form-item__label,
+.el-input,
+.el-textarea__inner,
+.el-upload-dragger .el-upload__text,
+.el-tabs__item,
+.el-button,
+.el-dropdown-menu__item {
+  font-size: 12px !important;
+}
+
 .el-breadcrumb__inner,
 .el-breadcrumb__inner a {
   font-weight: 400 !important;

+ 67 - 78
src/components/byTable/ElementsMapping.vue

@@ -1,19 +1,16 @@
 <template>
   <div>
-    
-    <el-button v-for="(i,index) in getCellList"  @click="i.click()" :key="index" v-bind="i.attrs" v-show="index < 2">{{ i.attrs.label }}</el-button>
+
+    <el-button v-for="(i,index) in getCellList" @click="i.click()" :key="index" v-bind="i.attrs" v-debounce
+               v-show="index < 2">{{ i.attrs.label }}</el-button>
     <el-dropdown>
       <span class="el-dropdown-link">
         <span class="more-btn">更多</span>
-        
+
       </span>
       <template #dropdown>
         <el-dropdown-menu>
-          <el-dropdown-item 
-            :class="index > 1 ? '' : 'dn'" 
-            @click="i.click()" v-for="(i,index) in getCellList" 
-            
-            :key="index" >
+          <el-dropdown-item :class="index > 1 ? '' : 'dn'" @click="i.click()" v-for="(i,index) in getCellList" :key="index">
             <span :style="i.attrs.type == 'danger' ? 'color:red' : 'color:#409eff'">{{ i.attrs.label}}</span>
           </el-dropdown-item>
         </el-dropdown-menu>
@@ -30,115 +27,107 @@ import {
   h,
   withDirectives,
   resolveDirective,
-  resolveComponent
-} from 'vue'
+  resolveComponent,
+} from "vue";
 export default defineComponent({
   props: {
     parent: {
       type: Object,
-      default () {
-        return {}
-      }
+      default() {
+        return {};
+      },
     },
     row: {
       type: Object,
-      default () {
-        return {}
-      }
+      default() {
+        return {};
+      },
     },
     cellList: {
       type: Array,
-      default () {
-        return []
-      }
-    }
+      default() {
+        return [];
+      },
+    },
   },
-  setup (props) {
-    const { proxy } = getCurrentInstance()
-    
-    proxy.$.components = props.parent.$options.components
-    proxy.$.directives = props.parent.$options.directives
+  setup(props) {
+    const { proxy } = getCurrentInstance();
+
+    proxy.$.components = props.parent.$options.components;
+    proxy.$.directives = props.parent.$options.directives;
     const elementsMapping = ref({
-      button: 'el-button'
-    })
+      button: "el-button",
+    });
     const getCellList = computed(() => {
-      return props.cellList.filter((cell) => cell && Object.keys(cell).length)
-    })
+      return props.cellList.filter((cell) => cell && Object.keys(cell).length);
+    });
     const getAttrsValue = (item) => {
       if (!item.attrs) {
-        item.attrs = {}
+        item.attrs = {};
       }
       const {
         class: className = null,
         style = null,
         directives = null,
         ...attrs
-      } = item.attrs
+      } = item.attrs;
       return {
         class: className,
         style,
         directives,
-        props: attrs
-      }
-    }
-    if(getCellList.value.length > 3) {
-      
-      console.log(getCellList)
+        props: attrs,
+      };
+    };
+    if (getCellList.value.length > 3) {
+      console.log(getCellList);
       return {
-        getCellList
-      }
+        getCellList,
+      };
     }
     return () => {
       return h(
-        'div',
+        "div",
         getCellList.value.map((cellItem) => {
           const comp = resolveComponent(
-            elementsMapping.value[cellItem.el] ||
-            cellItem.el
-          )
-          const attributes = getAttrsValue(cellItem)
-          const { label, ...others } = attributes.props
-          const { directives } = attributes
-          let onClick
+            elementsMapping.value[cellItem.el] || cellItem.el
+          );
+          const attributes = getAttrsValue(cellItem);
+          const { label, ...others } = attributes.props;
+          const { directives } = attributes;
+          let onClick;
           if (cellItem.click) {
-            onClick = cellItem.click.bind(props.parent, props.row)
+            onClick = cellItem.click.bind(props.parent, props.row);
           }
-          let resultVNode = h(
-            comp,
-            {
-              onClick,
-              innerHTML: label,
-              ...others
-            }
-          )
+          let resultVNode = h(comp, {
+            onClick,
+            innerHTML: label,
+            ...others,
+          });
           if (directives) {
-            resultVNode = withDirectives(
-              resultVNode,
-              [
-                ...directives.map((directiveItem) => {
-                  return [
-                    resolveDirective(directiveItem.name),
-                    directiveItem.value,
-                    directiveItem.arg
-                  ]
-                })
-              ]
-            )
+            resultVNode = withDirectives(resultVNode, [
+              ...directives.map((directiveItem) => {
+                return [
+                  resolveDirective(directiveItem.name),
+                  directiveItem.value,
+                  directiveItem.arg,
+                ];
+              }),
+            ]);
           }
-          return resultVNode
+          return resultVNode;
         })
-      )
-    }
-  }
-})
+      );
+    };
+  },
+});
 </script>
 <style>
-.more-btn{
+.more-btn {
   line-height: 34px;
-  font-size: 14px;
-  color:#FF9315;
+  font-size: 12px;
+  color: #ff9315;
 }
-.dn{
-  display: none!important;
+.dn {
+  display: none !important;
 }
 </style>

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

@@ -108,7 +108,7 @@
       <el-table ref="hocElTable" :data="source" v-if="!hideTable" style="width: 100%" v-bind="$attrs" v-on="tableEvents" row-key="id" :tree-props="{
           children: 'children',
           hasChildren: 'hasChildren',
-        }" :height="tableHeight">
+        }" :height="tableHeight" :border="tableBorder">
         <el-table-column v-for="(item, index) in configData" :key="index" v-bind="getAttrsValue(item)" :type="item.type || ''" :selectable="
             (rowData, rowIndex) => isSelectable(rowData, rowIndex, item)
           ">
@@ -119,7 +119,7 @@
           </template>
 
           <template #default="scope" v-if="!item.type">
-            <slot :name="item.attrs.slot" :item="scope.row" :headerLabel="item.attrs.label" v-if="item.attrs.slot">
+            <slot :name="item.attrs.slot" :item="scope.row" :index="scope.$index" :headerLabel="item.attrs.label" v-if="item.attrs.slot">
               插槽占位符
             </slot>
             <div v-else-if="isFunction(getValue(scope, item))">
@@ -213,6 +213,10 @@ export default defineComponent({
     //   type: Number,
     //   required: false,
     // },
+    tableBorder: {
+      type: Boolean,
+      required: false,
+    },
     searchConfig: {
       type: Object,
       default() {

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

@@ -1287,6 +1287,7 @@ const getPriceSheetData = (id) => {
       "fileListOne",
       "fileUrl"
     );
+    totalAmount();
     formData.data.countryId = res.buyCountryId;
     formData.data.provinceId = res.buyProvinceId;
     formData.data.cityId = res.buyCityId;

+ 14 - 22
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -559,33 +559,25 @@ const config = computed(() => {
           {
             attrs: {
               label: "作废",
-              type: "primary",
+              type: "danger",
               text: true,
             },
             el: "button",
             click() {
-              ElMessageBox.confirm(
-                "此操作将永久删除该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
-                proxy
-                  .post("/contract/edit", {
-                    id: row.id,
-                    status: 88,
-                  })
-                  .then(() => {
-                    ElMessage({
-                      message: "作废成功",
-                      type: "success",
+              proxy
+                .msgConfirm()
+                .then((res) => {
+                  proxy
+                    .post("/contract/cancellation", {
+                      id: row.id,
+                    })
+                    .then((res) => {
+                      proxy.msgTip("操作成功", 1);
+
+                      getList();
                     });
-                    getList();
-                  });
-              });
+                })
+                .catch((err) => {});
             },
           },
           row.status == 30

+ 5 - 1
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -1522,6 +1522,8 @@ const publicTotalAmount = (val) => {
 
 const handleSubmitOne = () => {
   formDomOne.value.handleSubmit(() => {
+    console.log(formData.data, "adad");
+    return;
     proxy
       .msgConfirm()
       .then((res) => {
@@ -1533,7 +1535,9 @@ const handleSubmitOne = () => {
           getList();
         });
       })
-      .catch((err) => {});
+      .catch((err) => {
+        submitLoading.value = false;
+      });
   });
 };
 

+ 94 - 203
src/views/MES/productionScheduling/index.vue

@@ -1,20 +1,27 @@
 <template>
   <div class="pageIndexClass">
     <div>
-      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
-               :selectConfig="selectConfig" :action-list="[
+      <byTable :source="sourceList.data" :tableBorder="true" :pagination="sourceList.pagination" :config="config" :loading="loading"
+               highlight-current-row :selectConfig="selectConfig" :hidePagination="true" :action-list="[
               
         ]" @get-list="getList">
 
         <template #product="{ item }">
-          <div>
-            aaaaaaa
+          <div style="width:100%; ">
+            {{item.productName}}
           </div>
         </template>
         <template #date="{ item }">
-          <div>
-            <div>2024-01-09</div>
-            <div>2024-01-18</div>
+          <div style="width:100%; ">
+            <div>{{item.createTime}} ~ {{item.deliveryPeriod}}</div>
+          </div>
+        </template>
+
+        <template v-for="(row) in allDay" v-slot:[row.key]="{ index }" :key="row.key">
+          <div style="width:100%">
+            <div style="height:12px" class="is-bk"
+                 :class="{'left-class':index>=0? isAddLeftClass(row,index):false,'right-class':index>=0? isAddRightClass(row,index):false}"
+                 v-if="index>=0 &&sourceList.data && sourceList.data.length>0 &&  isAddClass(row.day,index)"></div>
           </div>
         </template>
 
@@ -64,6 +71,7 @@ import byForm from "@/components/byForm/index";
 import QRCode from "qrcodejs2-fix";
 import { getDateAllDay } from "@/utils/date.js";
 import moment from "moment";
+import { watch } from "vue";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -77,7 +85,7 @@ const sourceList = ref({
     pageSize: 10,
     keyword: "",
     produceStatus: "",
-    staDeliveryPeriod: str,
+    beginDate: str,
     endDeliveryPeriod: "",
     beginTime: "",
     endTime: "",
@@ -102,20 +110,30 @@ const statusData = ref([
 ]);
 const allDay = ref([]);
 const changDay = (val) => {
-  allDay.value = getDateAllDay(val);
-  for (let i = 0; i < allDay.value.length; i++) {
-    const ele = allDay.value[i];
+  getList();
+  allDay.value = [];
+  config.value.splice(3, config.value.length - 3);
+  let days = getDateAllDay(val);
+  let list = [];
+  for (let i = 0; i < days.length; i++) {
+    const ele = days[i];
+    list.push({
+      key: "day" + ele,
+      day: ele,
+    });
     let attrs = {
       label: `${ele.substr(8, 10)}`,
-      slot: ele,
+      slot: "day" + ele,
       isNeedHeaderSlot: false,
-      width: 50,
-      // fixed: "right",
+      width: 40,
+      align: "center",
+      fixed: "right",
     };
     config.value.push({
       attrs,
     });
   }
+  allDay.value = list;
 };
 const selectConfig = computed(() => [
   {
@@ -126,11 +144,11 @@ const selectConfig = computed(() => [
   {
     type: "time",
     itemType: "month",
-    label: "生产日期",
+    label: "排程日期",
     placeholder: "请选择生产日期",
-    prop: "staDeliveryPeriod",
+    prop: "beginDate",
     clearable: false,
-    placeholderOne: "结束日期",
+    placeholderOne: "",
     propOne: "",
     fn: (val) => {
       changDay(val);
@@ -141,97 +159,41 @@ const config = ref([
   {
     attrs: {
       label: "生产订单号",
-      prop: "orderCode",
+      prop: "code",
       width: 130,
-      fixed: "left",
     },
   },
   {
     attrs: {
-      label: "产品",
-      slot: "product",
-      "min-width": 300,
-      fixed: "left",
+      label: "生产日期",
+      slot: "date",
+      width: 150,
     },
   },
   {
     attrs: {
-      label: "生产日期",
-      slot: "date",
-      width: 130,
-      fixed: "left",
+      label: "产品",
+      slot: "product",
+      "min-width": 300,
     },
   },
 ]);
-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) => {
+const getList = (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/produceOrderDetail/page", sourceList.value.pagination).then(
+  proxy.post("/produceOrder/schedulingList", sourceList.value.pagination).then(
     (res) => {
-      sourceList.value.data = res.rows;
-      sourceList.value.pagination.total = res.total;
+      sourceList.value.data = res.map((x, index) => ({
+        ...x,
+        id: "id" + index,
+        createTime: x.createTime.substr(0, 10),
+        deliveryPeriod: x.deliveryPeriod.substr(0, 10),
+      }));
+      // 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;
@@ -239,124 +201,41 @@ const getList = async (req) => {
   );
 };
 
-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 isAddClass = (day, index) => {
+  if (index >= 0 && sourceList.value.data[index]) {
+    let row = sourceList.value.data[index];
+    let start = new Date(row.createTime).getTime();
+    let end = new Date(row.deliveryPeriod + " 23:59:59").getTime();
+    let now = new Date(day + " 23:59:59").getTime();
+    if (now >= start && now <= end) {
+      return true;
+    } else {
+      return false;
+    }
+  }
 };
-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 isAddLeftClass = (day, index) => {
+  if (index >= 0 && sourceList.value.data[index]) {
+    let row = sourceList.value.data[index];
+    let start = row.createTime;
+    if (day.day == start) {
+      return true;
+    } else {
+      return false;
+    }
+  }
 };
-
-const isShowCotent = (slot, item) => {
-  if (item && item.productionProcessesList) {
-    return item.productionProcessesList.some((x) => x.id == slot.id);
-  } else {
-    return false;
+const isAddRightClass = (day, index) => {
+  if (index >= 0 && sourceList.value.data[index]) {
+    let row = sourceList.value.data[index];
+    let start = row.deliveryPeriod;
+    if (day.day == start) {
+      return true;
+    } else {
+      return false;
+    }
   }
 };
 </script>
@@ -365,4 +244,16 @@ const isShowCotent = (slot, item) => {
 ::v-deep(.el-progress__text) {
   font-size: 14px !important;
 }
+.is-bk {
+  background: #0066ff;
+}
+.left-class {
+  border-radius: 6px 0 0 6px;
+}
+.right-class {
+  border-radius: 0px 6px 6px 0px;
+}
+:deep(.el-table .cell) {
+  padding: 0px !important;
+}
 </style>

+ 9 - 5
src/views/login.vue

@@ -48,13 +48,13 @@
 
             </el-form-item> -->
             <el-form-item prop="username" style="margin-top: 30px">
-              <el-input :placeholder="$t('login.pleaseEnterYourAccountNumber')" prefix-icon="UserFilled" @keyup.enter="handleLogin"
+              <el-input :placeholder="$t('login.pleaseEnterYourAccountNumber')" class="loginEle" prefix-icon="UserFilled" @keyup.enter="handleLogin"
                         autocomplete="username" v-model="loginForm.username">
               </el-input>
             </el-form-item>
             <el-form-item prop="password" style="margin-top: 30px">
-              <el-input :placeholder="$t('login.pleaseEnterYourPassword')" prefix-icon="View" type="password" v-model="loginForm.password"
-                        autocomplete="current-password" @keyup.enter="handleLogin">
+              <el-input :placeholder="$t('login.pleaseEnterYourPassword')" class="loginEle" prefix-icon="View" type="password"
+                        v-model="loginForm.password" autocomplete="current-password" @keyup.enter="handleLogin">
               </el-input>
             </el-form-item>
             <!-- <el-form-item prop="code" class="code" style="margin-top:30px">
@@ -69,7 +69,7 @@
             <div style="margin-top: 30px">
               <el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px">{{ $t("login.rememberPassword") }}</el-checkbox>
             </div>
-            <el-button type="primary" @click="handleLogin" style="width: 100%; margin-top: 30px">{{ $t("login.login") }}</el-button>
+            <el-button type="primary" @click="handleLogin" class="loginEle" style="width: 100%; margin-top: 30px">{{ $t("login.login") }}</el-button>
           </div>
         </el-form>
       </div>
@@ -196,7 +196,7 @@ getCode();
 getCookie();
 </script>
 
-<style lang="scss">
+<style lang="scss" scope>
 .login {
   min-width: 1200px;
   overflow: auto;
@@ -302,4 +302,8 @@ getCookie();
     color: #fff;
   }
 }
+
+.loginEle {
+  font-size: 14px !important;
+}
 </style>