From 161355f01e267159f065ec0b277c6735437b1eab Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期五, 29 八月 2025 16:30:03 +0800
Subject: [PATCH] '弹出交易主体并审核'

---
 Web/src/views/Customer/fBS_CusExtend/component/fBS_Customer/roles.vue |  300 ++++++++++++++++++++++++++++++++++++++++++++++++++
 Web/src/views/Customer/fBS_CusExtend/index.vue                        |   10 +
 2 files changed, 306 insertions(+), 4 deletions(-)

diff --git a/Web/src/views/Customer/fBS_CusExtend/component/fBS_Customer/roles.vue b/Web/src/views/Customer/fBS_CusExtend/component/fBS_Customer/roles.vue
new file mode 100644
index 0000000..8e1d4f2
--- /dev/null
+++ b/Web/src/views/Customer/fBS_CusExtend/component/fBS_Customer/roles.vue
@@ -0,0 +1,300 @@
+锘�<script lang="ts" name="fBS_Customer" setup>
+import { ref, reactive, onMounted } from "vue";
+import type { FormRules } from "element-plus";
+import { formatDate } from '/@/utils/formatTime';
+import { useFBS_CustomerApi } from '/@/api/Customer/fBS_Customer';
+import { useFBS_CusExtendApi } from '/@/api/Customer/fBS_CusExtend';
+import { auth } from '/@/utils/authFunction';
+import { ElMessageBox, ElMessage } from "element-plus";
+import { downloadStreamFile } from "/@/utils/download";
+import editDialog from '/@/views/Customer/fBS_CusExtend/component/fBS_Customer/component/editDialog.vue'
+import printDialog from '/@/views/system/print/component/hiprint/preview.vue'
+import ModifyRecord from '/@/components/table/modifyRecord.vue';
+import ImportData from "/@/components/table/importData.vue";
+
+const fBS_CusExtendApi = useFBS_CusExtendApi();
+
+const fBS_CustomerApi = useFBS_CustomerApi();
+const printDialogRef = ref();
+const editDialogRef = ref();
+const importDataRef = ref();
+const state = reactive({
+	title: '',
+	loading: false,
+	showDialog: false,
+	ruleForm: {} as any,
+	stores: {},
+	dropdownData: {} as any,
+	exportLoading: false,
+	tableLoading: false,
+	showAdvanceQueryUI: false,
+	selectData: [] as any[],
+	tableQueryParams: {} as any,
+	tableParams: {
+		page: 1,
+		pageSize: 20,
+		total: 0,
+		field: 'createTime', // 榛樿鐨勬帓搴忓瓧娈�
+		order: 'descending', // 鎺掑簭鏂瑰悜
+		descStr: 'descending', // 闄嶅簭鎺掑簭鐨勫叧閿瓧绗�
+	},
+	tableData: [],
+	listRow:{}
+});
+
+// 椤甸潰鍔犺浇鏃�
+onMounted(async () => {
+});
+
+/**
+ * 鏍规嵁id瀵规暟缁勫厓绱犺繘琛屾搷浣滐細瀛樺湪鍒欐浛鎹紝涓嶅瓨鍦ㄥ垯娣诲姞锛屾寚瀹氬垹闄ゅ垯绉婚櫎
+ * @param {Array} array - 瑕佹搷浣滅殑鍘熸暟缁�
+ * @param {Object} item - 瑕佹搷浣滅殑鍏冪礌锛屽繀椤诲寘鍚玦d灞炴��
+ * @param {boolean} [deleteFlag=false] - 鏄惁鎵ц鍒犻櫎鎿嶄綔
+ * @returns {Array} 澶勭悊鍚庣殑鏁扮粍
+ */
+function operateByid(array, item, deleteFlag = false) {
+    // 妫�鏌ュ厓绱犳槸鍚﹀寘鍚玦d
+    // if (!item || !('id' in item)) {
+    //     console.warn('鍏冪礌蹇呴』鍖呭惈id灞炴��');
+    //     return [...array];
+    // }
+    
+    // 鍒涘缓鍘熸暟缁勭殑鍓湰锛岄伩鍏嶇洿鎺ヤ慨鏀瑰師鏁扮粍
+    const newArray = [...array];
+    // 鏌ユ壘鏁扮粍涓槸鍚﹀瓨鍦ㄧ浉鍚宨d鐨勫厓绱�
+    const index = newArray.findIndex(i => i.id === item.id);
+    
+    if (deleteFlag) {
+        // 濡傛灉闇�瑕佸垹闄や笖鍏冪礌瀛樺湪锛屽垯浠庢暟缁勪腑绉婚櫎
+        if (index !== -1) {
+            newArray.splice(index, 1);
+        }
+    } else {
+        if (index !== -1) {
+            // 瀛樺湪鍒欐浛鎹�
+            newArray[index] = item;
+        } else {
+            // 涓嶅瓨鍦ㄥ垯娣诲姞
+            newArray.push(item);
+        }
+    }
+    
+    return newArray;
+}
+// 鏌ヨ鎿嶄綔
+const handleQuery = async (params: any = {}, deleteFlag:false) => {
+  // state.tableLoading = true;
+  // state.tableData = operateByid(state.tableData,params,deleteFlag)
+  // console.log(params);
+  
+  // state.tableLoading = false;
+};
+
+// 鍒楁帓搴�
+const sortChange = async (column: any) => {
+  state.tableParams.field = column.prop;
+  state.tableParams.order = column.order;
+  await handleQuery();
+};
+
+// 鍒犻櫎
+const delFBS_Customer = (row: any) => {
+	console.log(row,'rowrow');
+	
+  ElMessageBox.confirm(`纭畾瑕佸垹闄ゅ悧?`, "鎻愮ず", {
+    confirmButtonText: "纭畾",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  }).then(async () => {
+    await fBS_CusExtendApi.delCustormerUser(row.id);
+    handleQuery(row,true);
+    ElMessage.success("鍒犻櫎鎴愬姛");
+  }).catch(() => {});
+};
+
+// 鎵归噺鍒犻櫎
+const batchDelFBS_Customer = () => {
+  ElMessageBox.confirm(`纭畾瑕佸垹闄�${state.selectData.length}鏉¤褰曞悧?`, "鎻愮ず", {
+    confirmButtonText: "纭畾",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  }).then(async () => {
+    await fBS_CustomerApi.batchDelete(state.selectData.map(u => ({ id: u.id }) )).then(res => {
+      ElMessage.success(`鎴愬姛鎵归噺鍒犻櫎${res.data.result}鏉¤褰昤);
+      handleQuery();
+    });
+  }).catch(() => {});
+};
+
+const applyFBS_Customer = async(row: any,val:Number)=>{
+  let res = await fBS_CusExtendApi.changeSteps(row.id,val);
+  if(res.data.code==200){
+    ElMessage({
+      message: `閫氳繃鎴愬姛锛乣,
+      type: "success",
+    });
+    row.steps = val
+  }else{
+    ElMessage({
+      message: res.message||`閫氳繃澶辫触锛乣,
+      type: "error",
+    });
+  }
+}
+
+const noFBS_Customer=(row: any,val:Number)=>{
+   ElMessageBox.confirm(`纭畾涓嶉�氳繃鍚�?`, "鎻愮ず", {
+    confirmButtonText: "纭畾",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  }).then(async () => {
+    let res = await fBS_CusExtendApi.changeSteps(row.id,val);
+    if(res.data.code==200){
+      ElMessage({
+        message: `涓嶉�氳繃鎴愬姛锛乣,
+        type: "success",
+      });
+    row.steps = val
+    }else{
+      ElMessage({
+        message: res.message||`涓嶉�氳繃澶辫触锛乣,
+        type: "error",
+      });
+    }
+  }).catch(() => {});
+}
+
+// // 璁剧疆鐘舵��
+// const changeFBS_CustomerStatus = async (row: any) => {
+//   await fBS_CusExtendApi.setStatus({ id: row.id, status: row.status }).then(() => ElMessage.success('鐘舵�佽缃垚鍔�'));
+// };
+
+// 瀵煎嚭鏁版嵁
+const exportFBS_CustomerCommand = async (command: string) => {
+  try {
+    state.exportLoading = true;
+    if (command === 'select') {
+      const params = Object.assign({}, state.tableQueryParams, state.tableParams, { selectKeyList: state.selectData.map(u => u.id) });
+      await fBS_CustomerApi.exportData(params).then(res => downloadStreamFile(res));
+    } else if (command === 'current') {
+      const params = Object.assign({}, state.tableQueryParams, state.tableParams);
+      await fBS_CustomerApi.exportData(params).then(res => downloadStreamFile(res));
+    } else if (command === 'all') {
+      const params = Object.assign({}, state.tableQueryParams, state.tableParams, { page: 1, pageSize: 99999999 });
+      await fBS_CustomerApi.exportData(params).then(res => downloadStreamFile(res));
+    }
+  } finally {
+    state.exportLoading = false;
+  }
+}
+
+handleQuery();
+//鐖剁骇浼犻�掓潵鐨勫嚱鏁帮紝鐢ㄤ簬鍥炶皟
+const emit = defineEmits(["reloadTable"]);
+const ruleFormRef = ref();
+
+
+
+
+// 椤甸潰鍔犺浇鏃�
+onMounted(async () => {
+});
+
+// 鎵撳紑寮圭獥
+const openDialog = async (row: any, title: string) => {
+  state.tableLoading = true;
+	state.title = title;
+	let res = JSON.parse(JSON.stringify(row))
+	state.tableData = res.exRoles
+	state.listRow = row
+  state.tableLoading = false;
+	state.showDialog = true;
+};
+
+// 鍏抽棴寮圭獥
+const closeDialog = () => {
+	emit("reloadTable");
+	state.showDialog = false;
+};
+
+// 鎻愪氦
+const submit = async () => {
+	closeDialog();
+};
+
+//灏嗗睘鎬ф垨鑰呭嚱鏁版毚闇茬粰鐖剁粍浠�
+defineExpose({ openDialog });
+</script>
+<template>
+	<div class="fBS_Customer-container">
+		<el-dialog v-model="state.showDialog" :width="1200" draggable @close="closeDialog" :close-on-click-modal="false">
+			<template #header>
+				<div style="color: #fff">
+					<span>{{ state.title }}</span>
+				</div>
+			</template>
+			<el-card class="full-table" shadow="hover" style="margin-top: 5px">
+				<el-table :data="state.tableData" @selection-change="(val: any[]) => { state.selectData = val; }"
+					style="width: 100%" v-loading="state.tableLoading" tooltip-effect="light" row-key="id"
+					@sort-change="sortChange" border>
+					<el-table-column type="selection" width="40" align="center"
+						v-if="false" />
+					<!-- <el-table-column type="index" label="搴忓彿" width="55" align="center" /> -->
+					<el-table-column prop='exRole.name' label='浜ゆ槗涓讳綋'  show-overflow-tooltip />
+					<!-- <el-table-column prop='isManager' label='code' sortable='custom' show-overflow-tooltip >
+					<template #default="scope">
+						<el-switch 
+						disabled="disabled"
+						v-model="scope.row.isManager" 
+						:active-value='true'
+            			:inactive-value='false'
+            			active-text="绠$悊鍛�"
+            			inactive-text="鍛樺伐" 
+						size="small"
+						inline-prompt
+						/>
+					</template>
+						</el-table-column> -->
+					<el-table-column prop='exRole.code' label='code' show-overflow-tooltip />
+					<el-table-column prop='steps' label='鐘舵��' v-auth="'fBS_Customer:setStatus'" show-overflow-tooltip>
+						<template #default="scope">
+							<el-tag :type="scope.row.steps== 2?'success':scope.row.steps== 3?'error':'primary'">{{ scope.row.steps== 2?'宸查�氳繃':scope.row.steps== 3?'鏈�氳繃':'瀹℃牳涓�' }}</el-tag>
+						</template>
+					</el-table-column>
+					<!-- <el-table-column prop='remark' label='澶囨敞' show-overflow-tooltip /> -->
+					<el-table-column label="鎿嶄綔" width="70" align="center" fixed="right" show-overflow-tooltip
+						>
+						<template #default="scope">
+							<!-- <el-button icon="ele-Edit" size="small" text type="primary"
+								@click="editDialogRef.openDialog(scope.row, '缂栬緫鐢ㄦ埛淇℃伅')" v-auth="'fBS_Customer:update'">
+							</el-button> -->
+							<el-button icon="ele-Check" size="small" text type="primary" v-if="scope.row.steps!= 2"
+								@click="applyFBS_Customer(scope.row,2)" > </el-button>
+                <el-button icon="ele-Close" size="small" text type="primary" v-if="scope.row.steps!= 2"
+								@click="noFBS_Customer(scope.row,3)" > </el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				
+				<ImportData ref="importDataRef" :import="fBS_CustomerApi.importData"
+					:download="fBS_CustomerApi.downloadTemplate" v-auth="'fBS_Customer:import'"
+					@refresh="handleQuery" />
+				<!-- <printDialog ref="printDialogRef" :title="'鎵撳嵃瀹㈡埛琛�'" @reloadTable="handleQuery" />
+				<editDialog ref="editDialogRef" @reloadTable="handleQuery" /> -->
+			</el-card>
+			<template #footer>
+				<span class="dialog-footer">
+					<el-button @click="submit">鍙� 娑�</el-button>
+					<el-button @click="submit" type="primary" v-reclick="1000">纭� 瀹�</el-button>
+				</span>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+<style lang="scss" scoped>
+:deep(.el-select),
+:deep(.el-input-number) {
+	width: 100%;
+}
+</style>
\ No newline at end of file
diff --git a/Web/src/views/Customer/fBS_CusExtend/index.vue b/Web/src/views/Customer/fBS_CusExtend/index.vue
index ccfe4d3..78c5f83 100644
--- a/Web/src/views/Customer/fBS_CusExtend/index.vue
+++ b/Web/src/views/Customer/fBS_CusExtend/index.vue
@@ -6,18 +6,19 @@
 import { useFBS_CusExtendApi } from '/@/api/Customer/fBS_CusExtend';
 import editDialog from '/@/views/Customer/fBS_CusExtend/component/editDialog.vue'
 import userManagement from '/@/views/Customer/fBS_CusExtend/component/fBS_Customer/editDialog.vue'
+import editDialogRefApply from '/@/views/Customer/fBS_CusExtend/component/fBS_Customer/roles.vue'
 import printDialog from '/@/views/system/print/component/hiprint/preview.vue'
 import ModifyRecord from '/@/components/table/modifyRecord.vue';
 import ImportData from "/@/components/table/importData.vue";
 import { useFBS_ExRoleApi } from '/@/api/Customer/fBS_ExRole';
 import { formatDate } from '/@/utils/formatTime';
 
-
 const fBS_CusExtendApi = useFBS_CusExtendApi();
 const fBS_ExRoleApi = useFBS_ExRoleApi();
 const printDialogRef = ref();
 const editDialogRef = ref();
 const userManagementRef = ref();
+const editDialogRefApplyRef = ref();
 const dialogVisible = ref(false);
 const importDataRef = ref();
 const state = reactive({
@@ -281,7 +282,7 @@
         </el-table-column>
         <el-table-column prop='enterpriseName' label='浼佷笟鍚嶇О' show-overflow-tooltip width="180"/>
         <el-table-column prop='unifiedSocialCreditCode' label='缁熶竴绀句細淇$敤浠g爜' show-overflow-tooltip width="150"/>
-        <el-table-column prop='exRoles' label='瑙掕壊' show-overflow-tooltip width="180">
+        <el-table-column prop='exRoles' label='浜ゆ槗涓讳綋' show-overflow-tooltip width="180">
           <template #default="scope">
               {{ changeExroles(scope.row.exRoles) }}
             </template>
@@ -338,10 +339,10 @@
             <ModifyRecord :data="scope.row" />
           </template>
         </el-table-column> -->
-        <el-table-column label="鎿嶄綔" width="100" align="center" fixed="right" show-overflow-tooltip v-if="auth('fBS_CusExtend:update') || auth('fBS_CusExtend:delete')">
+        <el-table-column label="鎿嶄綔" width="120" align="center" fixed="right" show-overflow-tooltip v-if="auth('fBS_CusExtend:update') || auth('fBS_CusExtend:delete')">
           <template #default="scope">
             <el-button icon="ele-Edit" size="small" text type="primary" @click="editDialogRef.openDialog(scope.row, '缂栬緫浼佷笟璧勬枡', state.qiyeList,state.roleList)" v-auth="'fBS_CusExtend:update'">  </el-button>
-            <!-- <el-button icon="ele-Check" size="small" text type="primary" @click="editDialogRefApplyRef.openDialog(scope.row, '瀹℃牳浼佷笟璧勬枡', state.qiyeList,state.roleList,state.shenheList)" v-auth="'fBS_CusExtend:update'">  </el-button> -->
+            <el-button icon="ele-List" size="small" text type="primary" @click="editDialogRefApplyRef.openDialog(scope.row, '瀹℃牳浼佷笟璧勬枡')" v-auth="'fBS_CusExtend:update'">  </el-button>
             <el-button icon="ele-User" size="small" text type="primary" @click="userManagementRef.openDialog(scope.row, '绠$悊浼佷笟鐢ㄦ埛', state.qiyeList,state.roleList,state.shenheList)" v-auth="'fBS_CusExtend:update'">  </el-button>
             <el-button icon="ele-Delete" size="small" text type="primary" @click="delFBS_CusExtend(scope.row)" v-auth="'fBS_CusExtend:delete'">  </el-button>
           </template>
@@ -361,6 +362,7 @@
       <printDialog ref="printDialogRef" :title="'鎵撳嵃浼佷笟璧勬枡'" @reloadTable="handleQuery" />
       <editDialog ref="editDialogRef" @reloadTable="handleQuery" />
       <userManagement ref="userManagementRef" @reloadTable="handleQuery"/>
+      <editDialogRefApply ref="editDialogRefApplyRef" @reloadTable="handleQuery"> </editDialogRefApply>
       
     </el-card>
     <el-dialog title="绠$悊浼佷笟鐢ㄦ埛" :visible.sync="dialogVisible" width="width">

--
Gitblit v1.9.1