Przeglądaj źródła

fix(bugs): 修改员工商品

tangning 3 lat temu
rodzic
commit
2f86e9ae1f

+ 1 - 1
src/components/Tinymce/src/Editor.vue

@@ -11,7 +11,7 @@
     <textarea
       :id="tinymceId"
       ref="elRef"
-      :maxlength="maxlength"
+      maxlength="200"
       :style="{ visibility: 'hidden' }"
       v-if="!initOptions.inline"
     ></textarea>

+ 1 - 1
src/views/advertisement/pads.vue

@@ -53,7 +53,7 @@
       const columns: BasicColumn[] = [
         {
           title: '序号',
-          dataIndex: 'id',
+          dataIndex: 'orderNum',
           fixed: 'left',
           width: 100,
         },

+ 1 - 1
src/views/product/list.data.ts

@@ -97,7 +97,7 @@ export const columns: BasicColumn[] = [
     width: 80,
   },
   {
-    title: '下单时间',
+    title: '创建时间',
     dataIndex: 'addTime',
     slots: { customRender: 'addTime' },
     sorter: true,

+ 31 - 3
src/views/product/productDrawer.vue

@@ -26,7 +26,16 @@
           <tbody>
             <tr v-for="item in editData.productList" :key="item.uuidLink">
               <template v-if="editData.productList">
-                <td>{{ item.uuidLink }}</td>
+                <td
+                  :title="item.name"
+                  style="
+                    max-width: 120px;
+                    overflow: hidden;
+                    white-space: nowrap;
+                    text-overflow: ellipsis;
+                  "
+                  >{{ item.name }}</td
+                >
                 <td
                   ><InputNumber
                     type="number"
@@ -114,6 +123,7 @@
     goodsSn: string;
     retailPrice: string;
     marketPrice: string;
+    name?: string;
   }
 
   export default defineComponent({
@@ -194,7 +204,16 @@
         };
         if (unref(isUpdate)) {
           let res = await InfoApi(data.record.id);
-          editData.value = res;
+          editData.value = {
+            ...res,
+            productList: res.productList.map((ele) => {
+              console.log('editData', ele, res.goodsSpecificationList);
+              ele.name = res.goodsSpecificationList.find(
+                (element) => element.uuid == ele.uuidLink,
+              )?.specificationName;
+              return ele;
+            }),
+          };
           setFieldsValue({
             ...res,
             isOnSale: res.isOnSale === 1,
@@ -209,19 +228,28 @@
         let productList = editData.value.productList || [];
         value.productList.map((ele) => {
           if (!productList.some((element) => ele.uuidLink == element.uuidLink)) {
+            //判断新增
             productList.push({
               uuidLink: ele.uuidLink,
+              name: ele.name,
               goodsNumber: '',
               goodsSn: '',
               marketPrice: '',
               retailPrice: '',
             });
+          } else {
+            //本来就有的 修改赋值
+            productList.forEach((setEle) => {
+              if (ele.uuidLink == setEle.uuidLink) {
+                setEle.name = ele.name;
+              }
+            });
           }
         });
         productList = productList.filter((ele) =>
           value.productList.some((element) => element.uuidLink == ele.uuidLink),
         );
-        console.log('setEditData', value);
+        console.log('setEditData', productList);
         editData.value = {
           ...editData.value,
           ...value,

+ 18 - 17
src/views/scenes/bindModal.vue

@@ -39,7 +39,7 @@
   </BasicModal>
 </template>
 <script lang="ts">
-  import { defineComponent, reactive, h, ref, computed } from 'vue';
+  import { defineComponent, reactive, ref, computed } from 'vue';
   import { Switch } from 'ant-design-vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   // import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
@@ -50,7 +50,7 @@
   // bindAnchorListApi
   import { bindOldAnchorListApi, bindUserApi } from '/@/api/scene/live';
   import { bindAnchorListParam } from '/@/api/scene/model';
-  import { Time } from '/@/components/Time';
+  // import { Time } from '/@/components/Time';
   // import { useUserStore } from '/@/store/modules/user';
 
   const { t } = useI18n();
@@ -66,8 +66,9 @@
     {
       title: 'ID',
       dataIndex: 'id',
+      ellipsis: true,
       fixed: 'left',
-      width: 40,
+      width: 100,
     },
     {
       title: t('routes.scenes.userName'),
@@ -91,20 +92,20 @@
       slots: { customRender: 'canShowSwitch' },
       width: 140,
     },
-    {
-      title: t('routes.scenes.bindTime'),
-      dataIndex: 'createTime',
-      width: 100,
-      customRender: ({ record }) => {
-        return (
-          record.createTime &&
-          h(Time, {
-            value: record.createTime,
-            mode: 'datetime',
-          })
-        );
-      },
-    },
+    // {
+    //   title: t('routes.scenes.bindTime'),
+    //   dataIndex: 'createTime',
+    //   width: 100,
+    //   customRender: ({ record }) => {
+    //     return (
+    //       record.createTime &&
+    //       h(Time, {
+    //         value: record.createTime,
+    //         mode: 'datetime',
+    //       })
+    //     );
+    //   },
+    // },
   ];
   export default defineComponent({
     components: { BasicModal, BasicTable, Switch },

+ 8 - 8
src/views/scenes/list.vue

@@ -68,7 +68,7 @@
   // import { h } from 'vue';
   import {
     ListApi,
-    // generateSceneEditTokenApi,
+    generateSceneEditTokenApi,
     downloadSceneDataAPi,
     generateDefaultLiveRoomApi,
   } from '/@/api/scene/list';
@@ -239,13 +239,13 @@
       });
       async function openSceneEditor(record: Recordable) {
         try {
-          const url = record.webSite.replace('smobile', 'epc') + '&menu=business';
-          // const userStore = useUserStore();
-          // const data = await generateSceneEditTokenApi({
-          //   sceneNum: record.num,
-          //   userName: userStore.getUserInfo?.userName,
-          // });
-          window.open(url);
+          const url = record.webSite.replace('smobile', 'epc') + '&menu=business&token=';
+          const userStore = useUserStore();
+          const data = await generateSceneEditTokenApi({
+            sceneNum: record.num,
+            userName: userStore.getUserInfo?.userName,
+          });
+          window.open(url + data);
         } catch (error) {
           console.log('error', error);
         }

+ 9 - 0
src/views/scenes/liveDrawer.vue

@@ -102,6 +102,7 @@
         picList?: string[];
         appListPicUrl?: string[];
         introduceVideo?: string[];
+        location?: string[];
       }
       let map;
       // Lat(120.262337, 30.178285),
@@ -408,10 +409,18 @@
               setDAta.city = ssqlist[1];
               setDAta.district = ssqlist[2];
               setDAta.address = ssq[2];
+              setDAta.location = ssqlist;
               setDAta.picList = res.picList.split('#$#');
               setDAta.appListPicUrl = [res.appListPicUrl];
               setDAta.introduceVideo = [res.introduceVideo];
+              defaultAddress.address = ssq[2];
+              defaultAddress.province = ssqlist[0];
+              defaultAddress.city = ssqlist[1];
+              defaultAddress.district = ssqlist[2];
+              defaultAddress.location = ssqlist;
+              detailAddr.value = ssq[2];
             } catch (error) {}
+            console.log('defaultAddress', defaultAddress);
             myData.introduceVideoCover = res.introduceVideoCover;
             myData.sceneUrl = res.sceneUrl;
             await setFieldsValue({

+ 46 - 46
src/views/staff/detailsModal.vue

@@ -186,56 +186,56 @@
       });
       function onDataReceive(data) {
         // 方式1;
+        console.log('useModalInner', data);
         setFieldsValue({
           ...data,
         });
-        let setSchema = {
-          field: 'roleId',
-          componentProps: {
-            disabled: true,
-            options: [
-              {
-                label: '公司员工',
-                value: 8,
-                key: 8,
-              },
-              {
-                label: '公司管理员',
-                value: 6,
-                key: 6,
-              },
-            ],
-          },
-        };
-        if (data.id) {
-          title.value = '编辑';
-          if (data.roleId === 2) {
-            updateSchema({
-              ...setSchema,
-              componentProps: {
-                disabled: false,
-                options: [
-                  {
-                    label: '公司员工',
-                    value: 8,
-                    key: 8,
+        let setSchema = [
+          {
+            field: 'roleId',
+            componentProps:
+              data.roleId === 2
+                ? {
+                    disabled: false,
+                    options: [
+                      {
+                        label: '公司员工',
+                        value: 8,
+                        key: 8,
+                      },
+                    ],
+                  }
+                : {
+                    disabled: data.id ? true : false,
+                    options: [
+                      {
+                        label: '公司员工',
+                        value: 8,
+                        key: 8,
+                      },
+                      {
+                        label: '公司管理员',
+                        value: 6,
+                        key: 6,
+                      },
+                    ],
                   },
-                ],
-              },
-            });
-          } else {
-            let company = [setSchema];
-            if (data.roleId === 6) {
-              company.push({
-                field: 'companyId',
-                componentProps: {
-                  disabled: true,
-                },
-              });
-            }
-            updateSchema(company);
-          }
-        }
+          },
+          {
+            field: 'phone',
+            componentProps: {
+              disabled: data.id ? true : false,
+            },
+          },
+          {
+            field: 'companyId',
+            componentProps: {
+              disabled: data.roleId === 6 ? true : false,
+            },
+          },
+        ];
+        title.value = data.id ? '编辑' : '新增';
+        updateSchema(setSchema);
       }
 
       async function handleOk() {

+ 2 - 2
src/views/staff/list.vue

@@ -219,9 +219,9 @@
       }
       function handleCreate() {
         if (getCheckRole([RoleEnum.COMPANY_ADMIN]) && surplusSubNum.value == 0) {
-          return createMessage.error('新增失败,分配账号数量不足');
+          return createMessage.error('新增失败,可添加员工数量为0个');
         }
-        openDetaileModal(true);
+        openDetaileModal(true, {});
       }
       function handleEdit(record: Recordable) {
         openDetaileModal(true, record);