cz 1 year ago
parent
commit
27725d2825

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

@@ -58,9 +58,11 @@
         <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">
             <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" />
+            <el-date-picker v-model="pagination[i.prop]" type="date" size="small" :placeholder="i.placeholder" style="width:120px"
+                            value-format="YYYY-MM-DD" @change="searchItemSelctOne(i,pagination[i.prop],pagination[i.propOne])" />
             <span style="margin-right:15px">-</span>
-            <el-date-picker v-model="pagination[i.propOne]" type="date" size="small" :placeholder="i.placeholderOne" style="width:120px" />
+            <el-date-picker v-model="pagination[i.propOne]" type="date" size="small" :placeholder="i.placeholderOne" style="width:120px"
+                            value-format="YYYY-MM-DD" @change="searchItemSelctOne(i,pagination[i.prop],pagination[i.propOne])" />
           </div>
           <div v-else>
             <div class="by-dropdown-title">
@@ -433,6 +435,18 @@ export default defineComponent({
       );
     };
 
+    const searchItemSelctOne = (item, prop, propOne) => {
+      if (prop && propOne) {
+        proxy.$emit(
+          "getList",
+          Object.assign(props.filterParams, {
+            [item.prop]: prop,
+            [item.propOne]: propOne,
+          })
+        );
+      }
+    };
+
     const isSelectable = (row, index, item) => {
       if (item.type === "selection") {
         if (item.attrs && item.attrs.checkAtt) {
@@ -464,6 +478,7 @@ export default defineComponent({
       handleNativeClick,
       searchFn,
       searchItemSelct,
+      searchItemSelctOne,
       selectConfigCopy,
       isSelectable,
       retrievalModal,

+ 1 - 1
src/components/headerBar/header.scss

@@ -89,7 +89,7 @@
 				height: 500px;
 				overflow-y: auto;
 				padding: 0 20px;
-				background: #f1f1f1;
+				// background: #f1f1f1;
 
 				&::-webkit-scrollbar {
 					width: 2px !important;

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

@@ -327,6 +327,7 @@ const fundsPaymentMethod = computed(
 const shippingMethod = computed(
   () => proxy.useUserStore().allDict["shipping_method"]
 );
+const companyId = computed(() => proxy.useUserStore().user.companyId);
 const accountList = ref([]);
 const customerList = ref([]);
 const corporationList = ref([]);
@@ -334,6 +335,7 @@ const customerUserList = ref([]);
 const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
+const treeData = ref([]);
 const openProductCompany = ref(false);
 const copyType = ref(1);
 const copyContract = ref(false);
@@ -342,6 +344,7 @@ const formData = reactive({
     contractType: "2",
     rate: 1,
     contractProductList: [],
+    companyId: companyId.value,
   },
 });
 const uploadData = ref({});
@@ -392,6 +395,7 @@ const formConfig = computed(() => {
           dictValue: "外销",
         },
       ],
+      itemWidth: 50,
       fn: (val) => {
         if (val == "2") {
           formData.data.currency = currencyData.value[0].dictKey;
@@ -406,6 +410,16 @@ const formConfig = computed(() => {
       },
     },
     {
+      type: "treeSelect",
+      prop: "companyId",
+      label: "归属公司",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      disabled: companyId.value != "100",
+    },
+    {
       type: "title",
       title: "贸易信息",
       haveLine: true,
@@ -619,6 +633,7 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
+  companyId: [{ required: true, message: "请选择归属公司", trigger: "change" }],
   contractType: [
     { required: true, message: "请选择合同类型", trigger: "change" },
   ],
@@ -693,6 +708,18 @@ const getDict = () => {
         };
       });
     });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
+    })
+    .then((res) => {
+      treeData.value = proxy.handleTree(res.data, "deptId");
+    });
 };
 const getCityData = (id, type, isChange) => {
   proxy.post("/customizeArea/list", { parentId: id }).then((res) => {

+ 33 - 24
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -71,26 +71,29 @@
           </template>
           <template #size>
             <div style="width: 100%">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item prop="length" label-width="0px" class="margin-b-0 wid100">
-                    <el-input-number v-model="formData.data['length']" placeholder="长 (cm)" style="width: 100%" :precision="2" :controls="false"
-                                     :min="0" onmousewheel="return false;" />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item prop="width" label-width="0px" class="margin-b-0 wid100">
-                    <el-input-number v-model="formData.data.width" placeholder="宽 (cm)" style="width: 100%" :precision="2" :controls="false" :min="0"
-                                     onmousewheel="return false;" />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item prop="height" label-width="0px" class="margin-b-0 wid100">
-                    <el-input-number v-model="formData.data.height" placeholder="高 (cm)" style="width: 100%" :precision="2" :controls="false" :min="0"
-                                     onmousewheel="return false;" />
-                  </el-form-item>
-                </el-col>
-              </el-row>
+              <el-form-item label="尺寸" class="margin-b-0 wid100" required>
+                <el-row>
+                  <el-col :span="8">
+                    <el-form-item prop="length" label-width="0px" class="margin-b-0 wid100">
+                      <el-input-number v-model="formData.data['length']" placeholder="长 (cm)" style="width: 100%" :precision="2" :controls="false"
+                                       :min="0" onmousewheel="return false;" />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="8">
+                    <el-form-item prop="width" label-width="0px" class="margin-b-0 wid100">
+                      <el-input-number v-model="formData.data.width" placeholder="宽 (cm)" style="width: 100%" :precision="2" :controls="false"
+                                       :min="0" onmousewheel="return false;" />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="8">
+                    <el-form-item prop="height" label-width="0px" class="margin-b-0 wid100">
+                      <el-input-number v-model="formData.data.height" placeholder="高 (cm)" style="width: 100%" :precision="2" :controls="false"
+                                       :min="0" onmousewheel="return false;" />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </el-form-item>
+
             </div>
           </template>
         </byForm>
@@ -173,6 +176,7 @@ const loading = ref(false);
 const submitLoading = ref(false);
 const treeData = ref([]);
 const treeListData = ref([]);
+const technologyData = ref([]);
 const currencyData = computed(
   () => proxy.useUserStore().allDict["account_currency"]
 );
@@ -462,7 +466,7 @@ const formConfig = computed(() => {
       prop: "technologyId",
       label: "生产工艺",
       itemWidth: 50,
-      data: [],
+      data: technologyData.value,
       filterable: true,
       disabled: false,
     },
@@ -476,8 +480,8 @@ const formConfig = computed(() => {
     {
       type: "slot",
       slotName: "size",
-      prop: "size",
-      label: "尺寸",
+      prop: "",
+      label: "",
       itemWidth: 50,
       disabled: false,
     },
@@ -638,6 +642,11 @@ const getTreeList = () => {
       treeData.value = message;
     });
 };
+const getTechnologyData = () => {
+  proxy.post("/technology/page").then((res) => {
+    technologyData.value = res.rows;
+  });
+};
 const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/productInfo/detail", { id: row.id }).then((res) => {
@@ -791,7 +800,7 @@ const handleClickUpload = async (att, flag) => {
   a.click();
   document.body.removeChild(a);
 };
-
+getTechnologyData();
 getTreeList();
 getList();
 </script>

+ 31 - 18
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -2,7 +2,7 @@
   <div class="pageIndexClass">
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
-               :statConfig="statConfig" :onMoreSearch="true" @moreSearch="clickMoreSearch" highlight-current-row :action-list="[
+               :statConfig="statConfig" :onMoreSearch="false" @moreSearch="clickMoreSearch" highlight-current-row :action-list="[
           {
             text: '新建销售合同',
             action: () => newContract(),
@@ -188,6 +188,7 @@ const tradeMethods = ref([]);
 const corporationList = ref([]);
 const customerList = ref([]);
 const userList = ref([]);
+const companyData = ref([]);
 const isSettled = ref([
   {
     label: "已结清",
@@ -260,8 +261,8 @@ const selectConfig = computed(() => {
     },
     {
       label: "归属公司",
-      prop: "sellCorporationId",
-      data: corporationList.value,
+      prop: "companyId",
+      data: companyData.value,
     },
     {
       label: "业务员",
@@ -342,11 +343,8 @@ const config = computed(() => {
     {
       attrs: {
         label: "归属公司",
-        prop: "sellCorporationId",
-        "min-width": 220,
-      },
-      render(type) {
-        return proxy.dictValueLabel(type, corporationList.value);
+        prop: "companyName",
+        "min-width": 150,
       },
     },
     {
@@ -606,15 +604,30 @@ const getDict = () => {
         value: x.dictKey,
       }));
     });
-  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-    corporationList.value = res.rows.map((item) => {
-      return {
-        ...item,
-        label: item.name,
-        value: item.id,
-      };
+  // proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+  //   corporationList.value = res.rows.map((item) => {
+  //     return {
+  //       ...item,
+  //       label: item.name,
+  //       value: item.id,
+  //     };
+  //   });
+  // });
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
+    })
+    .then((res) => {
+      companyData.value = res.data.map((x) => ({
+        ...x,
+        label: x.deptName,
+        value: x.deptId,
+      }));
     });
-  });
   proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     customerList.value = res.rows.map((item) => {
       return {
@@ -1096,9 +1109,9 @@ const formSearchConfig = computed(() => {
     {
       type: "select",
       label: "归属公司",
-      prop: "sellCorporationId",
+      prop: "companyId",
       itemWidth: 50,
-      data: corporationList.value,
+      data: companyData.value,
       clearable: true,
     },
     {

+ 269 - 0
src/views/MES/productionOrder/index.vue

@@ -0,0 +1,269 @@
+<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>
+
+      </byTable>
+    </div>
+    <el-dialog :title="modalType == 'add' ? '添加店铺' : '编辑店铺'" v-model="dialogVisible" width="500px" destroy-on-close>
+      <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>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+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 selectConfig = computed(() => [
+  {
+    label: "事业部",
+    prop: "status",
+    data: [
+      {
+        label: "待采购",
+        value: "15",
+      },
+      {
+        label: "部分采购",
+        value: "30",
+      },
+    ],
+  },
+  {
+    label: "生产状态",
+    prop: "status",
+    data: [
+      {
+        label: "待采购",
+        value: "15",
+      },
+      {
+        label: "部分采购",
+        value: "30",
+      },
+    ],
+  },
+  {
+    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",
+      },
+    },
+    {
+      attrs: {
+        label: "订单号",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "交期",
+        prop: "deptName",
+      },
+    },
+    {
+      attrs: {
+        label: "生产状态",
+        prop: "deptName",
+      },
+    },
+    {
+      attrs: {
+        slot: "aa",
+        label: "各款SKU生产进度",
+        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({
+  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;
+  });
+};
+
+getList();
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.el-progress__text) {
+  font-size: 14px !important;
+}
+.content {
+  padding: 20px;
+}
+</style>