wxy 4 kuukautta sitten
vanhempi
sitoutus
2e525aeec9

+ 89 - 95
src/views/order/BuyCard/index.vue

@@ -18,17 +18,17 @@
         </a-form-item>
       </a-form>
     </div> -->
-    <div class="audit-btn">
+    <div class="audit-btn" v-if="userType == 2">
       <a-button @click="openAudit" type="text">
         <template #icon>
-          <icon-plus-circle/>
+          <icon-plus-circle />
         </template>
         <template #default>购卡</template>
       </a-button>
     </div>
     <!-- 数据表格 -->
     <a-table :data="tableData" :pagination="pageData" :columns="columns" @page-change="evChangePage"
-             :scroll="{ x: '100%', y: '800px' }">
+      :scroll="{ x: '100%', y: '800px' }">
       <!-- <template #status="{ record }">
         {{ record.status }}
       </template>
@@ -36,43 +36,41 @@
         {{ record.moderation_status }}
       </template> -->
       <template #operate="{ record }">
-        <div v-if="userType == 1 && record.moderation_status == 1">
-          <a-popconfirm :content="`是否通过?`" type="warning" @ok="platformCancel(record, 2)">
-            <a-button type="text">通过</a-button>
-          </a-popconfirm>
-          <a-popconfirm :content="`是否驳回`" type="warning" @ok="platformCancel(record, 3)">
-            <a-button type="text">驳回</a-button>
+        <div v-if="userType == 1">
+          <a-popconfirm content="审核" ok-text="通过" cancel-text="驳回" type="warning" @ok="platformCancel(record, 2)" @cancel="platformCancel(record, 3)">
+            <a-button type="text">审核</a-button>
           </a-popconfirm>
+          <a-button @click="uploadModal(record)" type="text">上传合同</a-button>
         </div>
         <div v-if="userType == 2">
           <a-popconfirm :content="`是否确认退订?`" type="warning" @ok="adminCancel(record)">
             <a-button type="text">退订</a-button>
-          </a-popconfirm>
+          </a-popconfirm> 
+          <a-button @click="openDetail(record, 2)" type="text">查看</a-button>   
         </div>
-
-        <!-- <a-button @click="openDetail(record, 2)" type="text">查看</a-button> -->
+       
       </template>
     </a-table>
     <a-modal v-model:visible="uploadContract" title="上传合同" @cancel="handleCancel" @before-ok="handleBeforeOk"
-             okText="保存" cancelText="关闭">
+      okText="保存" cancelText="关闭">
       <a-form :model="formContract" auto-label-width>
-        <a-form-item field="orderNumber" label="单号">
-          <!-- <a-input v-model="formContract.orderNumber" disabled placeholder="请输入单号" /> -->
-          <div class="audit-txt">{{ formContract.orderNumber }}</div>
-        </a-form-item>
-        <a-form-item field="customerName" label="客户">
+        <a-form-item field="customerName" label="客户名称">
           <!-- <a-input v-model="formContract.customerName" disabled placeholder="请输入客户" /> -->
           <div class="audit-txt" style="color:#418035;">{{ formContract.customerName }}</div>
         </a-form-item>
+        <a-form-item field="orderNumber" label="订单编号">
+          <!-- <a-input v-model="formContract.orderNumber" disabled placeholder="请输入单号" /> -->
+          <div class="audit-txt">{{ formContract.orderNumber }}</div>
+        </a-form-item>
         <a-form-item field="fileList" label="销售合同">
-          <a-upload action="/" :default-file-list="formContract.fileList"/>
+          <Upload v-model:modelValue="formContract.fileList"/>
         </a-form-item>
       </a-form>
     </a-modal>
 
     <!-- 创建 -->
     <a-modal v-model:visible="showAudit" title="购卡" width="600px" @cancel="cancelPurchase" centered
-             :maskClosable="false" okText="确定" cancelText="关闭" :footer="null">
+      :maskClosable="false" okText="确定" cancelText="关闭" :footer="null">
       <a-form ref="formRef" :rules="rules" :model="formState" @submit="submitPurchase">
         <a-form-item field="customerName" label="客户名称">
           <!-- <a-input v-model="formAudit.customerName" placeholder="请输入客户" /> -->
@@ -80,13 +78,13 @@
         </a-form-item>
         <a-form-item label="运营商" field="source">
           <a-select v-model="formState.source" :style="{ width: '380px' }" placeholder="请选择运营商">
-            <a-option v-for="item of sourceList" :value="item.id" :label="item.label"/>
+            <a-option v-for="item of sourceList" :value="item.id" :label="item.label" />
           </a-select>
         </a-form-item>
         <a-form-item label="资费名称" field="tariffId">
           <a-select v-model="formState.tariffId" :style="{ width: '380px' }" @change="tariffChange"
-                    placeholder="请选择资费ID">
-            <a-option v-for="item of tariffData" :value="item.value" :label="item.label"/>
+            placeholder="请选择资费ID">
+            <a-option v-for="item of tariffData" :value="item.value" :label="item.label" />
           </a-select>
         </a-form-item>
         <!-- <a-form-item label="资费详情" v-if="formState.tariffId">
@@ -107,14 +105,14 @@
         </a-form-item> -->
         <a-form-item label="卡类型" field="cardType">
           <a-select v-model="formState.cardType" :style="{ width: '380px' }" placeholder="请选择卡类型">
-            <a-option v-for="item of orderType" :value="item.value" :label="item.label"/>
+            <a-option v-for="item of orderType" :value="item.value" :label="item.label" />
           </a-select>
         </a-form-item>
 
 
         <a-form-item label="沉默期">
           <a-select v-model="formState.silencePeriod" :style="{ width: '380px' }" placeholder="请选择沉默期">
-            <a-option v-for="item of silenceOptions" :value="item.value" :label="item.label"/>
+            <a-option v-for="item of silenceOptions" :value="item.value" :label="item.label" />
           </a-select>
         </a-form-item>
         <a-form-item label="流量池" field="flowPool">
@@ -125,7 +123,7 @@
           </a-radio-group>
         </a-form-item>
         <a-form-item label="购卡数量" field="num">
-          <a-input v-model="formState.num" placeholder="请输入购卡数量"/>
+          <a-input v-model="formState.num" placeholder="请输入购卡数量" />
         </a-form-item>
         <a-form-item>
           <a-button type="primary" html-type="submit" style="margin-right: 10px;">确定</a-button>
@@ -136,7 +134,7 @@
 
     <!-- 详情 -->
     <a-modal v-model:visible="showDetail" width="800px" :title="currentIndex == 1 ? '退卡详情' : '查看'"
-             @cancel="showDetail = false" :footer="null">
+      @cancel="showDetail = false" :footer="null">
       <div class="detail-box">
         <div class="detail-item-box">
           <div class="detail-item">
@@ -220,7 +218,7 @@
         </div>
       </div>
       <div class="detail-table">
-        <a-table :columns="columnsDetail" :data="dataDetail"/>
+        <a-table :columns="columnsDetail" :data="dataDetail" />
       </div>
       <div style="text-align: right;margin-top: 20px;">
         <a-button type="primary" html-type="submit" style="margin-right: 10px;" @click="operateHandle">确定</a-button>
@@ -238,13 +236,13 @@
 </template>
 
 <script setup>
-import {ref, reactive, onMounted} from 'vue';
-import {Message} from '@arco-design/web-vue';
-import {enum_dict} from "@/hooks/enum";
-import {tariffList} from "@/api/path/tariffManagement.api";
-import {purchaseOrderList, addPurchaseOrder, platformUpdate, adminUpdate} from '@/api/path/purchase';
-import {Getdictionary} from '@/mixins/index.js'
-
+import { ref, reactive, onMounted } from 'vue';
+import { Message } from '@arco-design/web-vue';
+import { enum_dict } from "@/hooks/enum";
+import { tariffList } from "@/api/path/tariffManagement.api";
+import { purchaseOrderList, addPurchaseOrder, platformUpdate, adminUpdate } from '@/api/path/purchase';
+import { Getdictionary } from '@/mixins/index.js'
+import Upload from "@/components/upload/index.vue";
 const selectedKeys = ref([]);
 const rowSelection = reactive({
   type: 'checkbox',
@@ -257,44 +255,47 @@ const searchForm = reactive({
 });
 
 const columns = [
-  {title: '订单编号', dataIndex: 'id', align: 'center', width: 300},
-  {title: '客户名称', dataIndex: 'user_id', align: 'center'},
-  {title: '订阅状态', dataIndex: 'statusName', align: 'center'},
-  {title: '审核状态', dataIndex: 'orderTypeName', align: 'center'},
-  {title: '采购数量', dataIndex: 'quantity', align: 'center'},
-  {title: '支付金额', dataIndex: 'paymentAmount', align: 'center'},
-  {title: '下单时间', dataIndex: 'createdAt', align: 'center'},
-  {title: '操作', slotName: 'operate', align: 'center'}
+  { title: '序号', dataIndex: 'index', align: 'center' },
+  { title: '订单编号', dataIndex: 'id', align: 'center', width: 300 },
+  { title: '审核状态', dataIndex: 'orderTypeName', align: 'center' },
+  { title: '订单状态', dataIndex: 'statusName', align: 'center' },
+  { title: '客户名称', dataIndex: 'user_id', align: 'center' },
+  { title: '采购数量', dataIndex: 'quantity', align: 'center' },
+  { title: '运营商名称', dataIndex: 'quantity', align: 'center' },
+  { title: '资费', dataIndex: 'quantity', align: 'center' },
+  { title: '支付金额', dataIndex: 'paymentAmount', align: 'center' },
+  { title: '下单时间', dataIndex: 'createdAt', align: 'center' },
+  { title: '操作', slotName: 'operate', align: 'center' }
 ];
-const columnsDetail = [{title: 'ICCID', dataIndex: 'iccid'},
-  {title: '池名称及编号', dataIndex: 'nameAndId'},
-  {title: '卡状态', dataIndex: 'status'},
+const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' },
+{ title: '池名称及编号', dataIndex: 'nameAndId' },
+{ title: '卡状态', dataIndex: 'status' },
 ]
 const dataDetail = ref([{
   iccid: '8986061800002054589N',
   nameAndId: '泰国监控40G共享/53357981207',
   status: '沉默期'
 },
-  {
-    iccid: '8986061800002054588N',
-    nameAndId: '泰国监控40G共享/53357981207',
-    status: '沉默期'
-  }, {
-    iccid: '8986061800002054587N',
-    nameAndId: '泰国监控40G共享/53357981207',
-    status: '沉默期'
-  }, {
-    iccid: '8986061800002054586N',
-    nameAndId: '泰国监控40G共享/53357981207',
-    status: '沉默期'
-  },])
-const userName = ref('')
-const userType = ref(''); // 1平台 2用户
+{
+  iccid: '8986061800002054588N',
+  nameAndId: '泰国监控40G共享/53357981207',
+  status: '沉默期'
+}, {
+  iccid: '8986061800002054587N',
+  nameAndId: '泰国监控40G共享/53357981207',
+  status: '沉默期'
+}, {
+  iccid: '8986061800002054586N',
+  nameAndId: '泰国监控40G共享/53357981207',
+  status: '沉默期'
+},])
+const userName = ref(localStorage.getItem('remember_user_name'))
+const userType = ref(JSON.parse(localStorage.getItem('user_login_information'))?.userType);// 1平台 2用户
 const tableData = ref([]);
 const formRef = ref(null);
 const currentIndex = ref(null);
 const rules = {
-  source: [{required: true, trigger: 'change',}],
+  source: [{ required: true, trigger: 'change', }],
   tariffId: [
     {
       required: true,
@@ -341,12 +342,22 @@ const flowPoolData = ref([]); // 组池
 const showAudit = ref(false);
 
 const handleDictValue = async () => {
-  let one = await Getdictionary('source')
-  let two = await Getdictionary('cardType')
-  let tree = await Getdictionary('silenceOf')
-  sourceList.value = one.filter( (item) => item.typeKey == 'source')
-  orderType.value = two.filter( (item) => item.typeKey == 'cardType')
-  silenceOptions.value = tree.filter( (item) => item.typeKey == 'silenceOf')
+  sourceList.value = await Getdictionary('source')
+  orderType.value = await Getdictionary('cardType')
+  silenceOptions.value  = await Getdictionary('silenceOf')
+  flowPoolData.value = await Getdictionary('groupPool')
+
+  const param = {
+    current: 1,
+    size: 999,
+  }
+  tariffList(param).then(res => {
+    tariffData.value = res.data.records.map(item => ({
+      label: item.label,
+      value: item.id,
+      ...item
+    }));
+  })
 }
 // 订单列表
 const intData = async () => {
@@ -357,12 +368,13 @@ const intData = async () => {
   let res1 = await Getdictionary('subscriptionRelationshipStatus')
   let res2 = await Getdictionary('orderAuditStatus')
   purchaseOrderList(param).then(res => {
-    tableData.value = (res.data.records || []).map(item => {
-      const statusName = res1.filter( (item) => item.typeKey == 'subscriptionRelationshipStatus')?.find(val => item.status == val.value)?.label
-      const orderTypeName = res2.filter( (item) => item.typeKey == 'orderAuditStatus')?.find(val => item.status == val.value)?.label
+    tableData.value = (res.data.records || []).map((item,key) => {
+      const statusName = res1.filter((item) => item.typeKey == 'subscriptionRelationshipStatus')?.find(val => item.status == val.value)?.label
+      const orderTypeName = res2.filter((item) => item.typeKey == 'orderAuditStatus')?.find(val => item.status == val.value)?.label
 
       return {
         ...item,
+        index: key + 1,
         orderTypeName,
         statusName,
       }
@@ -371,29 +383,15 @@ const intData = async () => {
   })
 
 }
-// 资费
-const getTariff = () => {
-  const param = {
-    current: 1,
-    size: 999,
-  }
-  tariffList(param).then(res => {
-    tariffData.value = res.data.records.map(item => ({
-      label: item.label,
-      value: item.id,
-      ...item
-    }));
-  })
-}
 // 确认购卡
-const submitPurchase = ({values, errors}) => {
+const submitPurchase = ({ values, errors }) => {
   formRef.value.validate(async (errors) => {
     if (!errors) {
       const data = {
         source: String(formState.value.source),
-        tariff_id: formState.value.tariffId,
+        tariffId: formState.value.tariffId,
         quantity: Number(formState.value.num),
-        card_type: formState.value.cardType,
+        cardType: formState.value.cardType,
         periodOfSilence: String(formState.value.silencePeriod),
         isTrafficPool: formState.value.flowPool
       }
@@ -464,26 +462,23 @@ const evChangePage = (page) => {
 
 onMounted(() => {
   intData();
-  userName.value = localStorage.getItem('remember_user_name');
-  userType.value = localStorage.getItem('role');
 })
 
 // 上传合同的弹框
 const uploadContract = ref(false);
-const openContract = (item) => {
+const uploadModal = (item) => {
   uploadContract.value = true;
   formContract.customerName = item.customerName;
-  formContract.orderNumber = item.cardNumber;
+  formContract.orderNumber = item.sourceOrderId;
 };
 //订单详情的弹框
 const showDetail = ref(false);
 // 查看订单详情
 const openDetail = (item, current) => {
   currentIndex.value = current;
-  showDetail.value = true;
+  uploadContract.value = true;
 }
 const handleBeforeOk = (done) => {
-  console.log(formContract)
   window.setTimeout(() => {
     done()
     // prevent close
@@ -519,7 +514,6 @@ const formContract = reactive({
 const openAudit = () => {
   showAudit.value = true;
   handleDictValue();
-  getTariff();
 }
 
 // 分配卡号的值

+ 8 - 6
src/views/tariffManagement/config.js

@@ -25,16 +25,18 @@ export let columns = [
 
 export const columnsCustomer = [
     { title: window.$t('tariffManagement.id'), dataIndex: 'id', align: 'center', width: 200 },
-    { title: window.$t('tariffManagement.feeCode'), dataIndex: 'feeCode', align: 'center', width: 200 },
+    // { title: window.$t('tariffManagement.feeCode'), dataIndex: 'feeCode', align: 'center', width: 200 },
+    { title: window.$t('tariffManagement.userName'), dataIndex: 'userName', align: 'center', width: 200 },
     { title: window.$t('tariffManagement.label'), dataIndex: 'label', align: 'center', width: 200 },
     { title: window.$t('tariffManagement.source'), dataIndex: 'sourceName', align: 'center', width: 200 },
-    { title: window.$t('tariffManagement.trafficType'), dataIndex: 'trafficTypeName', align: 'center', width: 200 },
-    { title: window.$t('tariffManagement.billingType'), dataIndex: 'billingTypeName', align: 'center', width: 200 },
+    // { title: window.$t('tariffManagement.trafficType'), dataIndex: 'trafficTypeName', align: 'center', width: 200 },
+    // { title: window.$t('tariffManagement.billingType'), dataIndex: 'billingTypeName', align: 'center', width: 200 },
     { title: window.$t('tariffManagement.billingCycle'), dataIndex: 'billingCycleName', align: 'center', width: 200 },
-    { title: window.$t('tariffManagement.bagSize'), dataIndex: 'bag_size', align: 'center', width: 200 },
-    { title: window.$t('tariffManagement.pricing'), dataIndex: 'pricing', align: 'center', width: 200 },
+    // { title: window.$t('tariffManagement.bagSize'), dataIndex: 'bagSize', align: 'center', width: 200 },
+    { title: window.$t('tariffManagement.pricing'), dataIndex: 'pricingName', align: 'center', width: 200 },
     // { title: window.$t('tariffManagement.billingMethod'), dataIndex: 'billing_method', align: 'center', width: 200 },
-    { title: window.$t('tariffManagement.settlementCycleLabel'), dataIndex: 'settlement_cycle', align: 'center', width: 200 },
+    { title: window.$t('tariffManagement.settlementCycleLabel'), dataIndex: 'settlementCycle', align: 'center', width: 200 },
+    { title: window.$t('tariffManagement.ActivatedNames'), dataIndex: 'Activated', align: 'center', width: 200 },
     { title: window.$t('tariffManagement.feeStatus'), dataIndex: 'status', align: 'center', width: 200 },
 ]
 

+ 106 - 125
src/views/tariffManagement/customer/NewCustomerForm.vue

@@ -1,75 +1,68 @@
 <template>
-  <a-modal
-      :visible="visible"
-      :title="editMode ? $t('customer.editCustomer') : $t('customer.addCustomer')"
-      :loading="loading"
-      @ok="handleSubmit"
-      @cancel="handleCancel"
-      :width="720"
-      :okText="$t('customer.confirm')"
-  >
+  <a-modal :visible="visible" :title="editMode ? $t('customer.editCustomer') : $t('customer.addCustomer')"
+    :loading="loading" @ok="handleSubmit" @cancel="handleCancel" :width="720" :okText="$t('customer.confirm')">
     <a-tabs>
       <!-- 基本信息 Tab -->
       <a-tab-pane key="1" :title="$t('customer.basicInfo')">
         <a-form :model="formData" :rules="rules" ref="formRef" :label-col-props="{ span: 6 }"
-                :wrapper-col-props="{ span: 18 }">
+          :wrapper-col-props="{ span: 18 }">
           <a-divider>{{ $t('customer.basicInfoSection') }}</a-divider>
           <!-- Customer Code -->
           <a-form-item field="zip" :label="$t('customer.customerCode')" required validate-trigger="blur">
             <a-input v-model="formData.zip" :placeholder="$t('customer.enterCustomerCode')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
 
           <a-form-item field="email" :label="$t('customer.emailName')" required validate-trigger="blur">
             <a-input v-model="formData.email" :placeholder="$t('customer.emailType')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <a-form-item field="phone" :label="$t('customer.phoneName')" required validate-trigger="blur">
-            <a-input v-model="formData.phone" :placeholder="$t('customer.phoneType')"  show-word-limit/>
+            <a-input v-model="formData.phone" :placeholder="$t('customer.phoneType')" show-word-limit />
           </a-form-item>
           <!-- Customer Name -->
           <a-form-item field="name" :label="$t('customer.customerName')" required validate-trigger="blur">
             <a-input v-model="formData.name" :placeholder="$t('customer.enterCustomerName')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <!-- Account Number -->
           <a-form-item field="username" :label="$t('customer.accountNumber')" required validate-trigger="blur">
             <a-input v-model="formData.username" :placeholder="$t('customer.enterAccountNumber')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <!-- Password -->
           <a-form-item field="password" :label="$t('customer.password')" required validate-trigger="blur">
             <a-input-password v-model="formData.password" :placeholder="$t('customer.enterPassword')" :max-length="60"
-                              show-word-limit/>
+              show-word-limit />
             <a-button type="primary" @click="generatePassword">{{ $t('customer.generatePassword') }}</a-button>
           </a-form-item>
           <!--          role-->
-<!--          <a-form-item field="roleIds" :label="$t('customer.roleldsName')" required validate-trigger="blur">-->
-<!--            <a-select multiple v-model="formData.roleIds" :style="{width:'100%'}"-->
-<!--                      :placeholder="$t('customer.roleldsNamedType')">-->
-<!--              <a-option v-for="item of roles" :value="item.id" :label="item.name"/>-->
-<!--            </a-select>-->
-<!--          </a-form-item>-->
-<!--          <a-form-item field="userType" :label="$t('customer.userTypeName')" required validate-trigger="blur">-->
-<!--            <a-select  v-model="formData.userType" :style="{width:'100%'}"-->
-<!--                       :placeholder="$t('customer.userTypeNameType')">-->
-<!--              <a-option v-for="item of userTypeList" :value="item.value" :label="item.label"/>-->
-<!--            </a-select>-->
-<!--          </a-form-item>-->
+          <!--          <a-form-item field="roleIds" :label="$t('customer.roleldsName')" required validate-trigger="blur">-->
+          <!--            <a-select multiple v-model="formData.roleIds" :style="{width:'100%'}"-->
+          <!--                      :placeholder="$t('customer.roleldsNamedType')">-->
+          <!--              <a-option v-for="item of roles" :value="item.id" :label="item.name"/>-->
+          <!--            </a-select>-->
+          <!--          </a-form-item>-->
+          <!--          <a-form-item field="userType" :label="$t('customer.userTypeName')" required validate-trigger="blur">-->
+          <!--            <a-select  v-model="formData.userType" :style="{width:'100%'}"-->
+          <!--                       :placeholder="$t('customer.userTypeNameType')">-->
+          <!--              <a-option v-for="item of userTypeList" :value="item.value" :label="item.label"/>-->
+          <!--            </a-select>-->
+          <!--          </a-form-item>-->
           <!-- Remark -->
           <a-form-item field="note" :label="$t('customer.remark')" required validate-trigger="blur">
             <a-input v-model="formData.note" :placeholder="$t('customer.enterRemark')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <!-- Account Balance -->
           <a-form-item field="amount" :label="$t('customer.accountBalance')" required validate-trigger="blur">
             <a-input-number v-model="formData.amount" :min="0" :precision="2" :step="100"
-                            :suffix="$t('customer.currency')"/>
+              :suffix="$t('customer.currency')" />
           </a-form-item>
           <!-- Address -->
           <a-form-item field="addr" :label="$t('customer.address')" required validate-trigger="blur">
             <a-input v-model="formData.addr" :placeholder="$t('customer.addressMessage')" :max-length="50"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <!-- Status -->
           <a-form-item field="state" :label="$t('customer.statusName')" required validate-trigger="blur">
@@ -86,23 +79,23 @@
       <!-- SMS 信息 Tab -->
       <a-tab-pane key="2" :title="$t('customer.smsInfoSection')">
         <a-form :model="formData" :rules="rules" ref="formRef" :label-col-props="{ span: 6 }"
-                :wrapper-col-props="{ span: 18 }">
+          :wrapper-col-props="{ span: 18 }">
           <a-divider>{{ $t('customer.smsInfoSection') }}</a-divider>
           <a-form-item field="sms" :label="$t('customer.smsSubCode')" required validate-trigger="blur">
             <a-input v-model="formData.sms" :placeholder="$t('customer.enterSmsSubCode')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <a-form-item field="smsSignature" :label="$t('customer.smsName')" required validate-trigger="blur">
             <a-input v-model="formData.smsSignature" :placeholder="$t('customer.enterSmsName')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <a-form-item field="loginSms" :label="$t('customer.loginSmsTemplate')" required validate-trigger="blur">
             <a-input v-model="formData.loginSms" :placeholder="$t('customer.enterLoginSmsTemplate')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <a-form-item field="warnSms" :label="$t('customer.alarmSmsTemplate')" required validate-trigger="blur">
             <a-input v-model="formData.warnSms" :placeholder="$t('customer.enterAlarmSmsTemplate')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
         </a-form>
       </a-tab-pane>
@@ -110,45 +103,43 @@
       <!-- Billing Information Tab -->
       <a-tab-pane key="3" :title="$t('customer.billingInfo')">
         <a-form :model="formData" :rules="rules" ref="formRef" :label-col-props="{ span: 6 }"
-                :wrapper-col-props="{ span: 18 }">
+          :wrapper-col-props="{ span: 18 }">
           <a-divider>{{ $t('customer.InvoiceInformation') }}</a-divider>
           <a-form-item field="invoiceTitle" :label="$t('customer.invoiceTitle')" required validate-trigger="blur">
             <a-input v-model="formData.invoiceTitle" :placeholder="$t('customer.enterInvoiceTitle')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
-          <a-form-item field="invoiceType" :label="$t('customer.invoice_vatTextType')" required
-                       validate-trigger="blur">
-            <a-select v-model="formData.invoiceType" :style="{width:'100%'}"
-                      :placeholder="$t('customer.invoice_vatTextTypeSelect')">
-              <a-option v-for="item of invoiceList" :value="item.value" :label="item.label"/>
+          <a-form-item field="invoiceType" :label="$t('customer.invoice_vatTextType')" required validate-trigger="blur">
+            <a-select v-model="formData.invoiceType" :style="{ width: '100%' }"
+              :placeholder="$t('customer.invoice_vatTextTypeSelect')">
+              <a-option v-for="item of invoiceList" :value="item.value" :label="item.label" />
             </a-select>
           </a-form-item>
           <a-form-item field="invoiceAddr" :label="$t('customer.registeredAddress')" required validate-trigger="blur">
             <a-input v-model="formData.invoiceAddr" :placeholder="$t('customer.enterRegisteredAddress')"
-                     :max-length="60" show-word-limit/>
+              :max-length="60" show-word-limit />
           </a-form-item>
           <a-form-item field="invoiceZip" :label="$t('customer.invoiceCode')" required validate-trigger="blur">
             <a-input v-model="formData.invoiceZip" :placeholder="$t('customer.InvoiceCodeName')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <a-form-item field="invoiceEmail" :label="$t('customer.invoiceEmailName')" required validate-trigger="blur">
-            <a-input v-model="formData.invoiceEmail" :placeholder="$t('customer.invoiceEmailNameType')"
-                     :max-length="60" show-word-limit/>
+            <a-input v-model="formData.invoiceEmail" :placeholder="$t('customer.invoiceEmailNameType')" :max-length="60"
+              show-word-limit />
           </a-form-item>
           <a-form-item field="bankName" :label="$t('customer.bankName')" required validate-trigger="blur">
             <a-input v-model="formData.bankName" :placeholder="$t('customer.enterBankName')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <a-form-item field="bankAccount" :label="$t('customer.BankNumber')" required validate-trigger="blur">
             <a-input v-model="formData.bankAccount" :placeholder="$t('customer.BankNumberName')" :max-length="60"
-                     show-word-limit/>
+              show-word-limit />
           </a-form-item>
           <a-form-item field="bankBranch" :label="$t('customer.bank_branchName')" required validate-trigger="blur">
-            <a-input v-model="formData.bankBranch" :placeholder="$t('customer.bank_branchNameType')"  show-word-limit/>
+            <a-input v-model="formData.bankBranch" :placeholder="$t('customer.bank_branchNameType')" show-word-limit />
           </a-form-item>
-          <a-form-item field="businessLicense" :label="$t('customer.BusinessLicense')" required
-                       validate-trigger="blur">
-            <upload v-model="formData.businessLicense"/>
+          <a-form-item field="businessLicense" :label="$t('customer.BusinessLicense')" required validate-trigger="blur">
+            <upload v-model="formData.businessLicense" />
           </a-form-item>
         </a-form>
       </a-tab-pane>
@@ -156,15 +147,15 @@
       <!-- Tax Registration Tab -->
       <a-tab-pane key="4" :title="$t('customer.TaxRegistration')">
         <a-form :model="formData" :rules="rules" ref="formRef" :label-col-props="{ span: 8 }"
-                :wrapper-col-props="{ span: 16 }">
+          :wrapper-col-props="{ span: 16 }">
           <a-divider>{{ $t('customer.TaxRegistrationText') }}</a-divider>
           <a-form-item field="taxRegistrationCertificate" :label="$t('customer.photocopy')" required
-                       validate-trigger="blur">
-            <upload v-model:modelValue="formData.taxRegistrationCertificate"/>
+            validate-trigger="blur">
+            <upload v-model:modelValue="formData.taxRegistrationCertificate" />
           </a-form-item>
           <a-form-item field="taxpayerQualification" :label="$t('customer.CertificationQualification')" required
-                       validate-trigger="blur">
-            <upload v-model:modelValue="formData.taxpayerQualification"/>
+            validate-trigger="blur">
+            <upload v-model:modelValue="formData.taxpayerQualification" />
           </a-form-item>
         </a-form>
       </a-tab-pane>
@@ -174,15 +165,15 @@
 
 
 <script setup>
-import {ref, watch, onMounted} from 'vue';
-import {Message} from '@arco-design/web-vue';
-import {useI18n} from 'vue-i18n';
-import {useSystemStore} from '@/store/modules/systemStore.js'
-import {dictionaryDetail} from '@/api/path/dict.js'
+import { ref, watch, onMounted } from 'vue';
+import { Message } from '@arco-design/web-vue';
+import { useI18n } from 'vue-i18n';
+import { useSystemStore } from '@/store/modules/systemStore.js'
+import { dictionaryDetail } from '@/api/path/dict.js'
 import Upload from "@/components/upload/index.vue";
-import {systemFindRoleList} from "@/api/path/system.api.js";
-import {addCustomer, updateCustomer} from "@/api/customer.js";
-const {t} = useI18n();
+import { systemFindRoleList } from "@/api/path/system.api.js";
+import { addCustomer, updateCustomer } from "@/api/customer.js";
+const { t } = useI18n();
 const systemStore = useSystemStore()
 import { encryptByDES } from '@/utils/crypto.js'
 const props = defineProps({
@@ -196,28 +187,27 @@ const invoiceList = ref([])
 const roles = ref([])
 const userTypeList = ref([])
 watch(
-    () => props.editData,
-    (newVal) => {
-      if (newVal && props.editMode) {
-        // 深拷贝编辑数据
-        const editDataCopy = JSON.parse(JSON.stringify(newVal));
+  () => props.editData,
+  (newVal) => {
+    if (newVal && props.editMode) {
+      // 深拷贝编辑数据
+      const editDataCopy = JSON.parse(JSON.stringify(newVal));
 
-        // 将 formData 中嵌套的 info 展平为一层
-        const flattenedFormData = ref(Object.fromEntries(Object.entries(editDataCopy).flatMap(([key, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) ? Object.entries(value) : [[key, value]])));
-        if(editDataCopy.info) {
-          delete editDataCopy.info;
-        }
-        const formDataList = {...editDataCopy,...flattenedFormData.value}
-        console.log(formDataList)
-        formData.value = formDataList
-        // Object.keys(formData.value).forEach(key => {
-        //   if (formDataList[key]) {
-        //     formData.value[key] = formDataList[key];
-        //   }
-        // });
+      // 将 formData 中嵌套的 info 展平为一层
+      const flattenedFormData = ref(Object.fromEntries(Object.entries(editDataCopy).flatMap(([key, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) ? Object.entries(value) : [[key, value]])));
+      if (editDataCopy.info) {
+        delete editDataCopy.info;
       }
-    },
-    {deep: true, immediate: true}
+      const formDataList = { ...editDataCopy, ...flattenedFormData.value }
+      formData.value = formDataList
+      // Object.keys(formData.value).forEach(key => {
+      //   if (formDataList[key]) {
+      //     formData.value[key] = formDataList[key];
+      //   }
+      // });
+    }
+  },
+  { deep: true, immediate: true }
 );
 
 const emit = defineEmits(['update:visible', 'submit']);
@@ -252,38 +242,38 @@ const formData = ref({
 });
 
 const rules = {
-  userName: [{required: true, message: t('customer.enterAccountNumber')}],
-  state: [{required: true, message: t('customer.stateType')}],
-  name: [{required: true, message: t('customer.nameType')}],
-  password: [{required: true, message: t('customer.passwordRequired')}],
+  userName: [{ required: true, message: t('customer.enterAccountNumber') }],
+  state: [{ required: true, message: t('customer.stateType') }],
+  name: [{ required: true, message: t('customer.nameType') }],
+  password: [{ required: true, message: t('customer.passwordRequired') }],
   // roleIds: [{required: true, message: t('customer.roleIdsType')}],
   // userType: [{required: true, message: t('customer.userTypeType')}],
-  phone: [{required: true, message: t('customer.phoneType')}],
-  email: [{required: true, message: t('customer.emailType')}],
-  addr: [{required: true, message: t('customer.addressRequired')}],
-  amount: [{required: true, message: t('customer.amountRequired')}],
-  bankAccount: [{required: true, message: t('customer.bankAccountRequired')}],
-  bankBranch: [{required: true, message: t('customer.bankBranchRequired')}],
-  bankName: [{required: true, message: t('customer.bankNameRequired')}],
-  businessLicense: [{required: true, message: t('customer.businessLicenseRequired')}],
-  invoiceAddr: [{required: true, message: t('customer.invoiceAddressRequired')}],
-  invoiceEmail: [{required: true, message: t('customer.invoiceEmailRequired')}],
-  invoiceTitle: [{required: true, message: t('customer.invoiceTitleRequired')}],
-  invoiceType: [{required: true, message: t('customer.invoiceTypeRequired')}],
-  invoiceZip: [{required: true, message: t('customer.invoiceZipRequired')}],
-  loginSms: [{required: true, message: t('customer.loginSMSTemplateRequired')}],
-  note: [{required: true, message: t('customer.noteRequired')}],
-  sms: [{required: true, message: t('customer.smsRequired')}],
-  smsSignature: [{required: true, message: t('customer.smsSignatureRequired')}],
-  warnSms: [{required: true, message: t('customer.warnSMSTemplateRequired')}],
-  zip: [{required: true, message: t('customer.zipCodeRequired')}],
-  taxRegistrationCertificate: [{required: true, message: t('customer.taxRegistrationCertificateRequired')}],
-  taxpayerQualification: [{required: true, message: t('customer.taxpayerQualificationRequired')}]
+  phone: [{ required: true, message: t('customer.phoneType') }],
+  email: [{ required: true, message: t('customer.emailType') }],
+  addr: [{ required: true, message: t('customer.addressRequired') }],
+  amount: [{ required: true, message: t('customer.amountRequired') }],
+  bankAccount: [{ required: true, message: t('customer.bankAccountRequired') }],
+  bankBranch: [{ required: true, message: t('customer.bankBranchRequired') }],
+  bankName: [{ required: true, message: t('customer.bankNameRequired') }],
+  businessLicense: [{ required: true, message: t('customer.businessLicenseRequired') }],
+  invoiceAddr: [{ required: true, message: t('customer.invoiceAddressRequired') }],
+  invoiceEmail: [{ required: true, message: t('customer.invoiceEmailRequired') }],
+  invoiceTitle: [{ required: true, message: t('customer.invoiceTitleRequired') }],
+  invoiceType: [{ required: true, message: t('customer.invoiceTypeRequired') }],
+  invoiceZip: [{ required: true, message: t('customer.invoiceZipRequired') }],
+  loginSms: [{ required: true, message: t('customer.loginSMSTemplateRequired') }],
+  note: [{ required: true, message: t('customer.noteRequired') }],
+  sms: [{ required: true, message: t('customer.smsRequired') }],
+  smsSignature: [{ required: true, message: t('customer.smsSignatureRequired') }],
+  warnSms: [{ required: true, message: t('customer.warnSMSTemplateRequired') }],
+  zip: [{ required: true, message: t('customer.zipCodeRequired') }],
+  taxRegistrationCertificate: [{ required: true, message: t('customer.taxRegistrationCertificateRequired') }],
+  taxpayerQualification: [{ required: true, message: t('customer.taxpayerQualificationRequired') }]
 };
 
 
 const handleSubmit = () => {
-  formRef.value.validate(async  (errors) => {
+  formRef.value.validate(async (errors) => {
     if (!errors) {
       let response;
       formData.value.password = encryptByDES(formData.value.password);
@@ -309,10 +299,7 @@ const handleSubmit = () => {
 
 const handleCancel = () => {
   Object.keys(formData.value).forEach(key => {
-    if(key!=='userType'){
-      formData.value[key] = ''
-    }
-
+    formData.value[key] = ''
   })
   formRef.value = null
   emit('update:visible', false);
@@ -326,20 +313,14 @@ const generatePassword = () => {
 
 
 const getDistList = async () => {
-  let code = ['invoiceVat', 'userType'];
+  let code = ['invoiceVat'];
 
   for (let i = 0; i < code.length; i++) {
     let res = await dictionaryDetail({ typeKey: code[i] });
     if (res.code === 200) {
-      if (code[i] === 'invoiceVat') {
-        invoiceList.value = res.data;
-      } else if (code[i] === 'userType') {
-        userTypeList.value = res.data;
-      }
+      invoiceList.value = res.data;
     }
   }
-
-
 }
 
 const getRolesData = async () => {
@@ -349,8 +330,8 @@ const getRolesData = async () => {
   }
 }
 onMounted(() => {
-  getDistList();
   getRolesData()
+  getDistList()
 })
 
 </script>

+ 2 - 2
src/views/tariffManagement/customer/index.vue

@@ -29,13 +29,13 @@
     <div class="top-actions">
       <a-space>
         <a-button type="primary" @click="showNewCustomerForm">{{ $t('customer.addCustomer') }}</a-button>
-        <a-button @click="handleBatchDelete">{{ $t('customer.batchDelete') }}</a-button>
+        <!-- <a-button @click="handleBatchDelete">{{ $t('customer.batchDelete') }}</a-button> -->
       </a-space>
     </div>
 
     <!-- 数据表格 -->
     <a-table row-key="id" :columns="columns" :data="tableData" :pagination="pagination" :scroll="{ x: 'auto' }"
-             :row-selection="{ type: 'checkbox', showCheckedAll: true }" @page-change="onPageChange">
+    :row-selection="{ type: 'checkbox', showCheckedAll: true }" @page-change="onPageChange">
       <template #state="{ record }">
         <a-tag :color="getStatusColor(record.state)">
           {{ $t(`customer.status.${getStatusText(record.state)}`) }}

+ 1 - 1
src/views/tariffManagement/index.vue

@@ -252,7 +252,7 @@ const intData = async () => {
   dataSource.value = (data.records || []).map((item, index) => {
     const sourceName = sourceList.value.find(val => val.value == item.source)?.label
     const billingCycleName = cycleist.value.find(val => val.value == item.billingCycle)?.label
-    const pricingCurrty = currency.value.find(val => val.value == item.currency)?.label
+    const pricingCurrty = currency.value.find(val => val.value == item.currency)?.label || '人民币'
     const Activated = item.trafficBilling+'/'+item.trafficBillingType
 
     return {