wxy 4 ماه پیش
والد
کامیت
75ff62885b

+ 9 - 1
src/components/Search/index.vue

@@ -21,7 +21,7 @@
 </template>
 
 <script setup>
-import { ref, defineProps, toRefs, watch } from 'vue';
+import { ref, defineProps, toRefs, watch,defineEmits } from 'vue';
 import { Getdictionary } from "@/mixins/index.js";
 
 // 接收 props
@@ -60,6 +60,8 @@ const props = defineProps({
 const { SearchForm } = toRefs(props);
 
 const formState = ref({});
+
+const emit = defineEmits(['query'])
 SearchForm.value.forEach(item => {
     formState.value[item.field] = {
         value: item.value, 
@@ -95,4 +97,10 @@ const handleQuery = () => {
     emit('query', formState.value);
 };
 
+const handleReset = () => {
+    SearchForm.value.forEach(res=>{
+        res.value = '';
+    })
+}
+
 </script>

+ 1 - 1
src/utils/axios.js

@@ -49,7 +49,7 @@ axiosInstance.interceptors.response.use(
   (res) => {
     const systemStore = useSystemStore();
     systemStore.localLoading();
-    const { code, data, message: msg } = res.data;
+    const { code, data, message:msg } = res.data;
     // 成功
     if (code === 200) {
       return Promise.resolve(res.data);

+ 5 - 1
src/views/flowPool/components/add.vue

@@ -72,6 +72,10 @@ const handleSubmit = ({ values, errors }) => {
   formRef.value.validate(async (errors) => {
     if (!errors) {
       values.size = Number(values.size)
+      if (status.value == 1) {
+        delete formState.value.sizeType
+        delete formState.value.size
+      }
       if (formState.value.id) {
         const { code, data } = await updateTrafficPool(formState.value)
 
@@ -152,7 +156,7 @@ watch(() => record.value, val => {
   const datas = JSON.parse(JSON.stringify(val))
   if (props.typeCurrent == 2) {
     formState.value = datas
-    formState.value.iccids = datas.iccids.map(val=>val.iccid)
+    formState.value.iccids = datas.iccids.map(val => val.iccid)
   }
 }, { deep: true })
 

+ 31 - 12
src/views/order/BuyCard/detaile.vue

@@ -66,7 +66,7 @@
             <div class="detail-item-box">
                 <div class="detail-item">
                     <div class="item-label">{{ $t('order.CardNum') }}</div>
-                    <div class="item-content">{{ dataDetail.length }}
+                    <div class="item-content">{{ tableDataList.length }}
                         <a-button type="primary" @click="showCard = true" style="margin-left:10px;"
                             v-if="userType == 1 && FormDataList.moderationStatus == 2">{{
                                 $t('order.AllocationCardNumber') }}</a-button>
@@ -75,7 +75,7 @@
             </div>
         </div>
         <div class="detail-table">
-            <a-table :columns="columnsDetail" @page-change="evChangePage" :data="dataDetail" :pagination="pagination" />
+            <a-table :columns="columnsDetail" @page-change="evChangePage" :data="dataDetail" :pagination="dataDetail.length==10?pagination:false" />
         </div>
 
         <template #footer>
@@ -89,6 +89,7 @@
         :cancelText="$t('form.Cancel')">
         <Upload listType="" minx="1" accept=".xlsx" :handelUpload="customRequest" :showRemoveButton="false">
         </Upload>
+        <span style="color: #ccc;margin-top: 10px;display: inline-block;">请上传.xlsx文件</span>
     </a-modal>
 </template>
 
@@ -142,13 +143,17 @@ const customRequest = (options) => {
     DistributionCard(formData).then(res => {
         if (res.code == 200) {
             Message.success(res.message)
-            // 更新完整数据
-            tableDataList.value = res.data[0];
+            if (res.data[0].length <= 10) {
+                dataDetail.value.push(...res.data.map(val => ({ ...val, status: val.status == 1 ? t('order.normal') : t('order.unsubscribe') })))
+            } else {
+                // 更新完整数据
+                tableDataList.value = res.data[0];
 
-            // 更新总条目数
-            pagination.value.total = res.data[0].length;
+                // 更新总条目数
+                pagination.value.total = res.data[0].length;
 
-            updatePageData(); 
+                updatePageData();
+            }
         }
     })
 }
@@ -163,6 +168,9 @@ const closeModal = () => {
 
 watch(() => FormDataList.value, val => {
     if (Object.keys(val).length === 0) return
+    pagination.value.total = 0
+    pagination.value.current = 1
+    pagination.value.pageSize = 10
     AcquireOrdertariff({ id: val.trafficId }).then(res => {
         tariffForm.value = res.data
         tariffForm.value.billingcycleName = res1.value.filter(val => val.value == res.data.billingCycle)[0]?.label;
@@ -172,20 +180,31 @@ watch(() => FormDataList.value, val => {
     })
     dataDetail.value = []
     ReturntheOrderCard({ id: val.id }).then(res => {
-        dataDetail.value = res.data.map(val => ({ ...val, status: val.status == 1 ? t('order.normal') : t('order.unsubscribe') }))
+        console.log(res);
+        if (res.data.length <= 10) {
+            dataDetail.value.push(...res.data.map(val => ({ ...val, status: val.status == 1 ? t('order.normal') : t('order.unsubscribe') })))
+        } else {
+            // 更新完整数据
+            tableDataList.value = res.data;
+
+            // 更新总条目数
+            pagination.value.total = res.data.length;
+
+            updatePageData();
+        }
     })
 }, { deep: true })
 
 const evChangePage = (page) => {
     pagination.value.current = page
-    updatePageData(); 
+    updatePageData();
 }
 
 // 更新分页数据方法
 const updatePageData = () => {
-  const startIndex = (pagination.value.current - 1) * pagination.value.pageSize;
-  const endIndex = startIndex + pagination.value.pageSize; // 每次切 10 条
-  dataDetail.value = tableDataList.value.slice(startIndex, endIndex);
+    const startIndex = (pagination.value.current - 1) * pagination.value.pageSize;
+    const endIndex = startIndex + pagination.value.pageSize; // 每次切 10 条
+    dataDetail.value = tableDataList.value.slice(startIndex, endIndex);
 };
 
 onMounted(async () => {

+ 0 - 2
src/views/order/ChangeOrder/index.vue

@@ -18,8 +18,6 @@
         <div class="line_heis" @click="openDetail(record)">{{ record.id }}</div>
       </template>
     </a-table>
-    '[].,m'
-
   </div>
 </template>
 

+ 35 - 43
src/views/system/user/form.vue

@@ -4,47 +4,28 @@
       <span> {{ editStateComputed ? '编辑账号' : '新增账号' }} </span>
     </div>
     <a-form ref="formRef" :model="form" @submit-success="handleSubmit">
-      <a-form-item
-        label="用户账号"
-        field="username"
+      <a-form-item label="用户账号" field="username"
         :rules="[{ required: true, message: '请输入用户账号' }, { validator: changeKeyName }]"
-        :validate-trigger="['change', 'input', 'blur']"
-      >
+        :validate-trigger="['change', 'input', 'blur']">
         <a-input v-model="form.username" :disabled="editStateComputed" placeholder="请输入用户账号" />
       </a-form-item>
-     
-      <a-form-item
-        field="password"
-        label="登陆密码"
+
+      <a-form-item field="password" label="登陆密码"
         :rules="[{ required: !form.passwordState, message: '请输入登录密码' }, { validator: changeKeyPassword }]"
-        :validate-trigger="['change', 'input']"
-      >
-        <a-input-password
-          v-model="form.password"
-          :disabled="editStateComputed && form.passwordState"
-          placeholder="请输入登录密码"
-        />
-        <a
-          v-if="form.id"
-          class="edit-password"
-          @click="
-            () => {
-              form.password = ''
-              form.passwordState = !form.passwordState
-            }
-          "
-          >修改密码</a
-        >
+        :validate-trigger="['change', 'input']">
+        <a-input-password v-model="form.password" :disabled="editStateComputed && form.passwordState"
+          placeholder="请输入登录密码" />
+        <a v-if="form.id" class="edit-password" @click="() => {
+            form.password = ''
+            form.passwordState = !form.passwordState
+          }
+          ">修改密码</a>
       </a-form-item>
- 
 
-      <a-form-item
-      field="name"
-        label="用户姓名"
-        :rules="[{ required: true, message: '请输入用户姓名' }]"
-        :validate-trigger="['change', 'input', 'blur']"
-      >
-        <a-input v-model="form.name"   placeholder="请输入用户姓名" />
+
+      <a-form-item field="name" label="用户姓名" :rules="[{ required: true, message: '请输入用户姓名' }]"
+        :validate-trigger="['change', 'input', 'blur']">
+        <a-input v-model="form.name" placeholder="请输入用户姓名" />
       </a-form-item>
 
       <!-- <a-form-item
@@ -57,7 +38,14 @@
       </a-form-item> -->
 
       <a-form-item field="state" label="账号状态" :rules="[{ required: true, message: '请选择账号状态' }]">
-        <a-switch v-model="form.state" checked-value="1" unchecked-value="0" />
+        <a-switch v-model="form.state" checked-value="1" unchecked-value="0">
+          <template #checked>
+            禁用
+          </template>
+          <template #unchecked>
+            启用
+          </template>
+        </a-switch>
       </a-form-item>
       <a-form-item>
         <a-button @click="evSwitch">取消</a-button>
@@ -69,12 +57,12 @@
   </div>
 </template>
 
-<script  setup>
+<script setup>
 import { ref, computed, onMounted } from 'vue'
 import { systemFindRoleList, userAdd, updateUserItem } from '@/api/path/system.api.js'
 import { Message, Notification } from '@arco-design/web-vue'
 import { encryptByDES } from '@/utils/crypto'
- 
+
 const props = defineProps({
   data: Object
 })
@@ -87,7 +75,7 @@ const evSwitch = () => {
   emit('returnMain')
 }
 
-const editStateComputed = computed(()=>{
+const editStateComputed = computed(() => {
   return Boolean(props.data.id)
 })
 
@@ -148,9 +136,9 @@ const changeKeyName = async (value, cb) => {
   } else {
     cb(value ? rgxText : '')
   }
-} 
-const changeKeyPassword =  async (value, cb) => {
-  if(form.value.passwordState) {
+}
+const changeKeyPassword = async (value, cb) => {
+  if (form.value.passwordState) {
     cb()
     return
   }
@@ -159,7 +147,7 @@ const changeKeyPassword =  async (value, cb) => {
   if (rgx.test(value)) {
     cb()
   } else {
-    cb(value? rgxText : '')
+    cb(value ? rgxText : '')
   }
 }
 onMounted(() => {
@@ -175,9 +163,11 @@ defineExpose({
   margin-bottom: 2rem;
   .fn-headTitleDiv();
 }
+
 .arco-input-wrapper {
   width: 20rem;
 }
+
 .ant-form-item {
   width: 20rem;
 }
@@ -185,11 +175,13 @@ defineExpose({
 .operations {
   display: flex;
 }
+
 .edit-password {
   font-size: 13px;
   // color: @blue_0;
   margin-left: 1rem;
   white-space: nowrap;
+
   // position: absolute;
   &:hover {
     // color: @blue_2;

+ 3 - 3
src/views/tariffManagement/Management/meal.vue

@@ -6,14 +6,14 @@
             <a-table :columns="columns" :data="wanberFloter" style="margin-top: 20px" :pagination="false"
                 :scroll="{ y: 'auto' }">
                 <template #period="{ record, rowIndex }">
-                    <a-input v-model="record.period" :disabled="role.getRole !== 1" />
+                    <a-input v-model="record.period" :disabled="role.getRole == 2" />
                 </template>
                 <template #price="{ record, rowIndex }">
                     <a-input v-model="record.price" />
                 </template>
                 <template #currency="{ record, rowIndex }">
                     <a-select v-model="record.currency" :style="{ width: '300px' }" :placeholder="$t('form.datapoolForm.pleaseSelect')"
-                        :disabled="role.getRole !== 1">
+                        :disabled="role.getRole == 2">
                         <a-option v-for="res of Pricing" :value="res.value" :label="res.label" />
                     </a-select>
                 </template>
@@ -22,7 +22,7 @@
                 </template>
                 <template #setting="{ record }">
                     <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="addUpate(record)">{{
-                        record.id == '' ? $t('form.add') : $t('form.edit') }}</a>
+                        record.id == '' ? $t('form.Add') : $t('form.Edit') }}</a>
                     <a-popconfirm :content="$t('form.Delete')" :ok-text="$t('form.Confirm')"
                         :cancel-text="$t('form.Cancel')" @ok="deletaMeal(record.id)">
                         <a class="a-link" href="javascript:;" v-if="role.getRole == 1">{{

+ 2 - 4
src/views/tariffManagement/customer/NewCustomerForm.vue

@@ -237,7 +237,7 @@ const roles = ref([])
 watch(
   () => props.editData,
   (newVal) => {
-    if (newVal && props.editMode) {
+    if (newVal && props.editMode ) {
       // 深拷贝编辑数据
       const editDataCopy = JSON.parse(JSON.stringify(newVal));
       delete editDataCopy.alert.id
@@ -265,11 +265,9 @@ watch(
       // 更新 formData 的值
       formData.value = formDataList;
 
-      console.log(formDataList);
     }
 
-  },
-  { deep: true, immediate: true }
+  }
 );
 
 const emit = defineEmits(['update:visible', 'submit']);