huangbin 4 years ago
parent
commit
504c2f1f05

+ 101 - 39
src/views/information/account_info/list/account_info_trade/index.vue

@@ -2,60 +2,122 @@
   <!-- 交易账户 -->
   <div class="account_info_trade"
        :loading="loading">
-    交易账户
+    <filterCustomTable @search="search"></filterCustomTable>
+    <div class="tltLeft">
+      <span class="blue">
+        <svg class="icon svg-icon"
+             aria-hidden="true">
+          <use xlink:href="#icon-shuzhuangtu"></use>
+        </svg>
+        多元世纪信息技术有限公司(6)
+      </span>
+    </div>
+    <a-collapse class="spotCollapse"
+                :bordered="false">
+      <template #expandIcon="props">
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-if="props.isActive == 0">
+          <use xlink:href="#icon-shouqi1"></use>
+        </svg>
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-else>
+          <use xlink:href="#icon-shouqi2"></use>
+        </svg>
+      </template>
+      <a-collapse-panel>
+        <template #header>
+          <a-row class="headRow">
+            <a-col :span="12">业务员(2)</a-col>
+            <a-col :span="12">
+              <BtnList :btnList="commonBtn" />
+            </a-col>
+          </a-row>
+        </template>
+        <a-row class="contRow"
+               v-for="(item, i) in businesserList"
+               :key="i + '11'">
+          <a-col :span="12">{{item.accountname}}-{{item.logincode}}</a-col>
+          <a-col :span="12">{{getLoginStatus(item.loginstatus)}}</a-col>
+        </a-row>
+      </a-collapse-panel>
+    </a-collapse>
+    <a-collapse class="spotCollapse"
+                :bordered="false">
+      <template #expandIcon="props">
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-if="props.isActive == 0">
+          <use xlink:href="#icon-shouqi1"></use>
+        </svg>
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-else>
+          <use xlink:href="#icon-shouqi2"></use>
+        </svg>
+      </template>
+      <a-collapse-panel>
+        <template #header>
+          <a-row class="headRow">
+            <a-col :span="12">跟单员(3)</a-col>
+            <a-col :span="12">
+              <BtnList :btnList="commonBtn" />
+            </a-col>
+          </a-row>
+        </template>
+        <a-collapse class="spotCollapse"
+                    v-for="(item, i) in merchandiserList"
+                    :key="i + '11'"
+                    :bordered="false">
+          <a-collapse-panel :show-arrow="false">
+            <template #header>
+              <a-row class="headRow">
+                <a-col :span="12">{{item.accountname}}-{{item.logincode}}</a-col>
+                <a-col :span="12">{{getLoginStatus(item.loginstatus)}}</a-col>
+              </a-row>
+            </template>
+            <BtnList :btnList="forDataBtn" />
+          </a-collapse-panel>
+        </a-collapse>
+      </a-collapse-panel>
+    </a-collapse>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-
-// import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom} from '../../compoments';
-// import {queryTableList, getFilterTableCB, QueryCustomInfoType} from '../index';
-import { getCardTypeName, getStatusName } from '@/views/information/custom/setup';
+import { defineComponent, initData, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
+import { ref } from 'vue';
+import { handleAccountManager, getLoginStatus } from '../setup';
 
 export default defineComponent({
     name: 'account_info_trade',
     components: {
         contextMenu,
         BtnList,
+        filterCustomTable,
     },
     setup() {
-        // // 表头数据
-        // const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
-        // // 表格事件
-        // const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QueryCustomInfoType>({});
-        // // 表格操作按钮列表
-        // const {commonBtn, forDataBtn} = getBtnList('custom_info_normal', true);
-        // // 表格列表数据
-        // const {loading, tableList, queryTable} = queryTableList(3);
-        // initData(() => {
-        //     // 获取列表数据
-        //     queryTable();
-        //     // 注册表头信息 过滤
-        //     registerColumn('table_pcweb_userinfo', getFilterTableCB);
-        // });
+        const { businesserList, merchandiserList, getBusinesserList } = handleAccountManager();
+
+        const { commonBtn, forDataBtn } = getBtnList('account_info_business', true);
+        const loading = ref<boolean>(false);
+        initData(() => {
+            getBusinesserList();
+        });
 
-        // // 查询
-        // function search(value: any) {
-        //     filteredInfo.value = value;
-        //     // 更新表信息
-        //     updateColumn();
-        // }
+        // 查询
+        function search(value: any) {}
 
         return {
-            // columns,
-            // filteredInfo,
-            // expandedRowKeys,
-            // selectedRow,
-            // Rowclick,
-            // commonBtn,
-            // forDataBtn,
-            // loading,
-            // tableList,
-            // search,
-            // getStatusName,
-            // getCardTypeName,
-            // queryTable,
+            commonBtn,
+            forDataBtn,
+            loading,
+            search,
+            businesserList,
+            merchandiserList,
+            getLoginStatus,
         };
     },
 });

+ 35 - 21
src/views/information/warehouse-info/compoments/modify/index.vue

@@ -8,10 +8,10 @@
            @cancel="cancel"
            width="890px">
     <template #footer>
-        <a-button key="submit"
-                  type="primary"
-                  :loading="loading"
-                  @click="cancel">关闭</a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="cancel">关闭</a-button>
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
@@ -84,7 +84,7 @@
             <a-select class="inlineFormSelect"
                       style="width: 205px"
                       v-model:value="formState.provinceid"
-                      @change="getCityList"
+                      @change="provinceChange"
                       placeholder="请选择省">
               <a-select-option v-for="item in provinceList"
                                :key="item.autoid"
@@ -95,7 +95,7 @@
             <a-select class="inlineFormSelect ml9"
                       style="width: 205px"
                       v-model:value="formState.cityid"
-                      @change="getDistrictList"
+                      @change="cityChange"
                       placeholder="请选择市">
               <a-select-option v-for="item in cityList"
                                :key="item.autoid"
@@ -152,7 +152,7 @@ export default defineComponent({
         },
     },
     components: {},
-    setup(props,context) {
+    setup(props, context) {
         const { visible, cancel } = closeModal('warehouse_info_btn_modify');
         const loading = ref<boolean>(false);
         const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
@@ -162,6 +162,13 @@ export default defineComponent({
             if (props.selectedRow.warehousename) {
                 console.log('props.selectedRow,', props.selectedRow);
                 mergeTwoObj(formState, props.selectedRow);
+                const { provinceid, cityid } = props.selectedRow;
+                if (provinceid) {
+                    getCityList(provinceid);
+                }
+                if (cityid) {
+                    getDistrictList(cityid);
+                }
             }
         });
         function submit() {
@@ -170,31 +177,38 @@ export default defineComponent({
                 .then(() => {
                     const param = toRaw(formState);
                     const reqParam: WarehouseApplyReq = {
-                        type: 2,// int32 类型 1 新增 2 修改
+                        type: 2, // int32 类型 1 新增 2 修改
                         warehouseid: props.selectedRow.autoid, // uint64 仓库ID
                         warehousecode: props.selectedRow.warehousecode, // string 仓库代码
                         warehousename: param.warehousename, // string 仓库名称
-                        warehousetype: undefined === param.warehousetype ? 0 : param.warehousetype as number,  // int32 仓库类型 - 1 厂库  2 自有库  3 合作库
-                        provinceid: undefined === param.provinceid ? 0 : param.provinceid as number,  // uint64 省
-                        cityid: undefined === param.cityid ? 0 : param.cityid as number,  // uint64 市
-                        districtid: undefined === param.districtid ? 0 : param.districtid as number,  // int32 区
+                        warehousetype: undefined === param.warehousetype ? 0 : (param.warehousetype as number), // int32 仓库类型 - 1 厂库  2 自有库  3 合作库
+                        provinceid: undefined === param.provinceid ? 0 : (param.provinceid as number), // uint64 省
+                        cityid: undefined === param.cityid ? 0 : (param.cityid as number), // uint64 市
+                        districtid: undefined === param.districtid ? 0 : (param.districtid as number), // int32 区
                         address: param.address, // string 详细地址
                         contactname: param.contactname, // string 联系人
                         contactnum: param.contactnum, // string 联系电话
-                    }
+                    };
                     warehouseApply(reqParam, loading)
-                        .then(res => {
-                            cancel()
-                            context.emit("refresh")
-                        })
-                        .catch(err => {
-
+                        .then((res) => {
+                            cancel();
+                            context.emit('refresh');
                         })
+                        .catch((err) => {});
                 })
                 .catch((error: ValidateErrorEntity<FormState>) => {
                     console.log('error', error);
                 });
         }
+        function provinceChange(id: number) {
+            getCityList(id);
+            formState.cityid = undefined;
+            formState.districtid = undefined;
+        }
+        function cityChange(id: number) {
+            getDistrictList(id);
+            formState.districtid = undefined;
+        }
         return {
             visible,
             cancel,
@@ -204,8 +218,8 @@ export default defineComponent({
             cityList,
             districtList,
             provinceList,
-            getCityList,
-            getDistrictList,
+            provinceChange,
+            cityChange,
             formRef,
             formState,
             rules,