Prechádzať zdrojové kódy

应用appSceret管理新功能,销售订单商品数据功能

cz 1 rok pred
rodič
commit
1da04b3ffe

+ 2 - 3
src/components/byForm/index.vue

@@ -50,9 +50,8 @@
               label: i.propsTreeLabel || 'label',
               children: i.propsTreeChildren || 'children',
               disabled:i.propsTreeDisabled || 'disabled'
-            }" value-key="id" :normalizer="()=>i.disabledFn?i.disabledFn(node):''" :placeholder="i.placeholder || $t('common.pleaseSelect')"
-                          :disabled="i.disabled ? i.disabled : false" check-strictly :style="i.style?i.style:{width:'100%'}" default-expand-all
-                          @change="(e) => commonsEmit(e, i)" />
+            }" value-key="id" :placeholder="i.placeholder || $t('common.pleaseSelect')" :disabled="i.disabled ? i.disabled : false" check-strictly
+                          :style="i.style?i.style:{width:'100%'}" default-expand-all @change="(e) => commonsEmit(e, i)" />
           <el-date-picker v-model="formData[i.prop]" :readonly="i.readonly ? i.readonly : false" v-else-if="i.type == 'date'" :type="i.itemType"
                           :placeholder="i.placeholder || $t('common.pleaseSelectTime')" @change="(e) => commonsEmit(e, i)"
                           :disabled="i.disabled ? i.disabled : false" :format="i.format ? i.format : dateFormatInit(i.itemType)"

+ 5 - 4
src/components/process/SF/Contract.vue

@@ -131,14 +131,14 @@
           <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px"
                      v-if="!judgeStatus() && isEditList">产品库</el-button>
           <!-- default-expand-all -->
-          <el-table :data="formData.data.contractProductList" style="width: 100%; " default-expand-all>
+          <el-table :data="formData.data.contractProductList" style="width: 100%;" row-key="rowId">
             <el-table-column type="expand" width="50" align="center">
               <template #default="scope">
                 <div style="padding-left:50px">
                   <div style="margin-bottom:10px;">
                     <TitleInfo content='BOM单:'></TitleInfo>
                   </div>
-                  <el-table :data="scope.row.contractProductBomList" style="width: 100%;" border class="bom-table">
+                  <el-table :data="scope.row.contractProductBomList" style="width: 100%;" border class="bom-table" row-key="materialId">
                     <el-table-column label="图片" width="80">
                       <template #default="{ row }">
                         <div v-if="row.fileUrl">
@@ -438,7 +438,7 @@ import SelectContract from "@/components/contractCom/selectContract.vue";
 import SelectSample from "@/components/contractCom/selectSample.vue";
 import * as echarts from "echarts";
 import $bus from "@/bus/index.js";
-import { async } from "@antv/x6/lib/registry/marker/main";
+import { v4 as uuidv4 } from "uuid";
 const route = useRoute();
 const { proxy } = getCurrentInstance();
 // 接收父组件的传值
@@ -1043,6 +1043,7 @@ const handleClickSelectMaterial = (index) => {
 const contractProductBomList = ref([]);
 const selectProduct = async (goods) => {
   if (goods && goods.id) {
+    let rowId = uuidv4();
     let allFile = [];
     let fileUrl = "";
     if (goods.fileList && goods.fileList.length > 0) {
@@ -1095,8 +1096,8 @@ const selectProduct = async (goods) => {
           fileListOne: fileListOne,
           prodFileList: [],
           contractProductBomList: contractProductBomList.value,
+          rowId: rowId,
         });
-        fileData;
         proxy.msgTip("添加成功", 1);
         changeProductPrice();
         let ids = contractProductBomList.value.map((x) => x.materialId);

+ 53 - 11
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -35,6 +35,33 @@
           </div>
         </template>
 
+        <template #product="{item}">
+          <div style="width: 100%">
+            <el-popover placement="top-start" :width="400" trigger="hover" @show="onShowProductData(item)">
+              <div style="display:flex;margin-bottom:20px;align-items:center" v-for="i in  productData" :key="i.id">
+                <div style="width:60px">
+                  <img :src="i.productImgUrl" alt="" class="pic" @click="handleClickFile(i.productImgUrl)">
+                </div>
+                <div style="calc(100% - 60px)">
+                  <div>产品编码:{{i.productCode}}</div>
+                  <div>产品名称:{{i.productName}}</div>
+                  <div>产品数量:{{i.quantity}}</div>
+                </div>
+              </div>
+              <template #reference>
+                <div style="display:flex;height:65px;position:relative;top:15px">
+                  <div v-for="(product,index) in item.contractProductList" :key="product.id" style="margin-right:10px;">
+                    <el-badge :value="product.quantity" :min="0" :max="999999" v-if="index<3">
+                      <img :src="product.productImgUrl" class="pic" @click="handleClickFile(product.productImgUrl)">
+                    </el-badge>
+                  </div>
+                </div>
+              </template>
+            </el-popover>
+
+          </div>
+        </template>
+
         <template #prodTag="{ item }">
           <div style="width: 100%">
             <el-icon :size="16" style="cursor:pointer;margin-right: 5px;position:relative;top:5px" color="#409EFF" @click="handleEditTag(item)">
@@ -428,6 +455,13 @@ const config = computed(() => {
         "min-width": 180,
       },
     },
+    {
+      attrs: {
+        label: "商品数据",
+        slot: "product",
+        "min-width": 240,
+      },
+    },
     // {
     //   attrs: {
     //     label: "客户标签",
@@ -761,17 +795,17 @@ const getList = async (req) => {
     }, 200);
   });
 
-  proxy
-    .post("/contract/getHeadStatistic", sourceList.value.pagination)
-    .then((res) => {
-      headerData.value = res;
-      if (headerData.value) {
-        headerData.value.sumClaimMoneyOne = parseFloat(
-          Number(headerData.value.sumAmount) -
-            Number(headerData.value.sumClaimMoney)
-        ).toFixed(2);
-      }
-    });
+  // proxy
+  //   .post("/contract/getHeadStatistic", sourceList.value.pagination)
+  //   .then((res) => {
+  //     headerData.value = res;
+  //     if (headerData.value) {
+  //       headerData.value.sumClaimMoneyOne = parseFloat(
+  //         Number(headerData.value.sumAmount) -
+  //           Number(headerData.value.sumClaimMoney)
+  //       ).toFixed(2);
+  //     }
+  //   });
 };
 getDict();
 if (route.query.code) {
@@ -1361,6 +1395,14 @@ const prodTagClose = (index, row) => {
     })
     .then((res) => {});
 };
+
+const handleClickFile = (fileUrl) => {
+  window.open(fileUrl, "_blank");
+};
+const productData = ref([]);
+const onShowProductData = (item) => {
+  productData.value = item.contractProductList;
+};
 </script>
 
 <style lang="scss" scoped>

+ 78 - 5
src/views/JST/AppSecret/index.vue

@@ -4,7 +4,7 @@
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
                :selectConfig="selectConfig" :action-list="[
               {
-                text: '添加店铺',
+                text: '添加AppSecret',
                 action: () => openModal('add'),
                 disabled: false,
               },
@@ -18,7 +18,7 @@
 
       </byTable>
     </div>
-    <el-dialog :title="modalType == 'add' ? '添加店铺' : '编辑店铺'" v-model="dialogVisible" width="500px" destroy-on-close>
+    <el-dialog :title="modalType == 'add' ? '添加AppSecret' : '编辑AppSecret'" v-model="dialogVisible" width="600px" destroy-on-close>
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
       </byForm>
       <template #footer>
@@ -54,7 +54,14 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "公司名称",
+        label: "部门名称",
+        prop: "deptName",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "应用名称",
         prop: "companyName",
       },
     },
@@ -72,6 +79,18 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "accessToken",
+        prop: "accessToken",
+      },
+    },
+    {
+      attrs: {
+        label: "refreshToken",
+        prop: "refreshToken",
+      },
+    },
+    {
+      attrs: {
         label: "备注",
         prop: "remark",
       },
@@ -129,16 +148,25 @@ const formData = reactive({
 });
 const formOption = reactive({
   inline: true,
-  labelWidth: 100,
+  labelWidth: 110,
   itemWidth: 100,
 });
 const formDom = ref(null);
 const formConfig = computed(() => {
   return [
     {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "部门",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 100,
+    },
+    {
       type: "input",
       prop: "companyName",
-      label: "公司名称",
+      label: "应用名称",
       itemWidth: 100,
       disabled: false,
     },
@@ -158,6 +186,20 @@ const formConfig = computed(() => {
     },
     {
       type: "input",
+      prop: "accessToken",
+      label: "accessToken",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "input",
+      prop: "refreshToken",
+      label: "refreshToken",
+      itemWidth: 100,
+      disabled: false,
+    },
+    {
+      type: "input",
       itemType: "textarea",
       prop: "remark",
       label: "备注",
@@ -167,9 +209,14 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
+  deptId: [{ required: true, message: "请选择部门", trigger: "change" }],
   companyName: [{ required: true, message: "请输入公司名称", trigger: "blur" }],
   appKey: [{ required: true, message: "请输入AppKey", trigger: "blur" }],
   appSecret: [{ required: true, message: "请输入AppSecret", trigger: "blur" }],
+  accessToken: [{ required: true, message: "accessToken", trigger: "blur" }],
+  refreshToken: [
+    { required: true, message: "请输入refreshToken", trigger: "blur" },
+  ],
 });
 
 const getList = async (req) => {
@@ -222,6 +269,32 @@ const getDtl = (row) => {
   });
 };
 
+const arrayRecursion = (arr) => {
+  arr.forEach((item) => {
+    if (item.children && item.children.length > 0) {
+      item.disabled = true;
+      arrayRecursion(item.children);
+    } else {
+      item.disabled = false;
+    }
+  });
+  return arr;
+};
+
+const getTreeData = () => {
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      treeData.value = proxy.handleTree(res.data, "deptId");
+      arrayRecursion(treeData.value);
+    });
+};
+getTreeData();
 getList();
 </script>