Pārlūkot izejas kodu

资金日报表,form微调

asd26269546 2 gadi atpakaļ
vecāks
revīzija
070da1799a

BIN
src/assets/images/icon_zhangh1.png


BIN
src/assets/images/icon_zhangh2.png


BIN
src/assets/images/icon_zhangh3.png


BIN
src/assets/images/icon_zhangh4.png


+ 1 - 0
src/components/byForm/index.vue

@@ -7,6 +7,7 @@
       :rules="rules"
       :labelPosition="formOption.labelPosition || 'top'"
       ref="byForm"
+      :disabled='formOption.disabled || false'
     >
       <el-form-item
         :label="i.label"

+ 2 - 1
src/components/byTable/index.vue

@@ -471,12 +471,13 @@ export default defineComponent({
   ul {
     position: absolute;
     left: 0;
-    right: 0;
+    
     top: 32px;
     padding: 0;
     margin: 0;
     z-index: 100;
     display: none;
+    white-space: nowrap;
     li {
       list-style: none;
       font-size: 12px;

+ 2 - 0
src/layout/components/TagsView/index.vue

@@ -65,6 +65,7 @@ const routes = computed(() => usePermissionStore().routes);
 const theme = computed(() => useSettingsStore().theme);
 
 watch(route, () => {
+  
   addTags()
   moveToCurrentTag()
 })
@@ -140,6 +141,7 @@ function initTags() {
 }
 function addTags() {
   const { name } = route
+  console.log(route)
   if (name) {
     useTagsViewStore().addView(route)
     if (route.meta.link) {

+ 29 - 33
src/views/finance/fundManage/accountPayment/index.vue

@@ -28,7 +28,7 @@
 			</byTable>
 		</div>
 		<el-dialog
-			:title="modalType == 'add' ? '添加' : '编辑'"
+			:title="modalType == 'add' ? '打款' : '打款'"
 			v-model="dialogVisible"
 			width="500"
 			v-loading="loading"
@@ -154,9 +154,9 @@ const config = computed(() => {
 			attrs: {
 				label: '付款类型',
 				prop: 'type',
-				render(type) {
-					return proxy.dictDataEcho(type, dictsData.value.payment_type)
-				},
+			},
+			render(type) {
+				return proxy.dictDataEcho(type, dictsData.payment_status)
 			},
 		},
 		{
@@ -180,20 +180,25 @@ const config = computed(() => {
 		{
 			attrs: {
 				label: '金额',
-				prop: 'total',
+				prop: 'amount',
 			},
 		},
 		{
 			attrs: {
 				label: '款项说明',
-				prop: 'paymentRemarks',
+				prop: 'paymentRemark',
 			},
 		},
 		{
 			attrs: {
 				label: '打款状态',
 				prop: 'status',
+				
 			},
+			render(status) {
+				return proxy.dictDataEcho(status, dictsData.payment_type)
+			},
+
 		},
 		{
 			attrs: {
@@ -206,46 +211,26 @@ const config = computed(() => {
 				return [
 					{
 						attrs: {
-							label: '查看',
+							label: '打款',
 							type: 'primary',
 							text: true,
 						},
 						el: 'button',
 						click() {
+							formOption.disabled = false
 							getDtl(row)
 						},
 					},
 					{
 						attrs: {
-							label: '删除',
-							type: 'danger',
+							label: '查看',
+							type: 'primary',
 							text: true,
 						},
 						el: 'button',
 						click() {
-							// 弹窗提示是否删除
-							ElMessageBox.confirm(
-								'此操作将永久删除该数据, 是否继续?',
-								'提示',
-								{
-									confirmButtonText: '确定',
-									cancelButtonText: '取消',
-									type: 'warning',
-								}
-							).then(() => {
-								// 删除
-								proxy
-									.post('/productInfo/delete', {
-										id: row.id,
-									})
-									.then((res) => {
-										ElMessage({
-											message: '删除成功',
-											type: 'success',
-										})
-										getList()
-									})
-							})
+							formOption.disabled = true
+							getDtl(row)
 						},
 					},
 				]
@@ -262,6 +247,7 @@ const formOption = reactive({
 	labelWidth: 100,
 	itemWidth: 100,
 	rules: [],
+	disabled:false,
 })
 const byform = ref(null)
 const treeListData = ref([])
@@ -400,12 +386,22 @@ const getList = async (req) => {
 const uploadData = ref({})
 const fileList = ref([])
 const fileListCopy = ref([])
-let dictsData = reactive({})
+let dictsData = reactive({
+	payment_status: [],
+	payment_type: [],
+	account_currency: [],
+})
 proxy
 	.getDict(['payment_status', 'payment_type','account_currency'])
 	.then((res) => {
 		dictsData = res
 		console.log(res)
+		selectConfig.value[0].data = res.payment_status.map(item => {
+			return {
+				label: item.dictValue,
+				value: item.dictKey,
+			}
+		})
 		formConfig.value[11].data = res.account_currency.map(item => {
 			return {
 				label: item.dictValue,

+ 219 - 0
src/views/finance/fundManage/fundsStatement/index.vue

@@ -0,0 +1,219 @@
+<template>
+	<div class="fundsStatement">
+		<el-form :inline="true" :model="req" class="demo-form-inline">
+			
+			<el-form-item label="资金账户">
+				<el-select
+					v-model="req.managementId"
+					placeholder="请输入"
+				>
+					<el-option label="全部" value=""></el-option>
+					<el-option :label="i.name" :value="i.id" v-for="i in accountManagementData" :key='i.id' />
+				</el-select>
+			</el-form-item>
+			<el-form-item label="时间">
+				<!-- 选单月 -->
+				<el-date-picker
+					v-model="req.dateBetween"
+					type="month"
+					format="YYYY/MM"
+        			value-format="YYYY-MM"
+					placeholder="选择日期"
+				></el-date-picker>
+			</el-form-item>
+			<el-form-item>
+				<el-button type="primary" @click="getList">搜索</el-button>
+			</el-form-item>
+		</el-form>
+		<!--  -->
+		<el-table
+			:data="tableData"
+			style="width: 100%"
+			:span-method="objectSpanMethod"
+		>
+			<el-table-column
+				prop="accountManagementAlias"
+				label="账户信息"
+				width="400"
+				fixed
+			>
+				<template #default="{ row }">
+					<div class="account-box">
+						<div class="text">
+							<div class="account">账户名称:{{row.accountManagementAlias}}</div>
+							<div class="company">{{row.corporationName}}</div>
+						</div>
+						<div class="img"></div>
+					</div>
+				</template>
+			</el-table-column>
+			<el-table-column
+				prop="currencyType"
+				label="币种"
+				width="150"
+				fixed
+			/>
+			<el-table-column
+				:label="index + '日'"
+				v-for="index of dayNum"
+				:key="index"
+			>
+				<el-table-column :prop="index + 'income'" label="收入" />
+				<el-table-column :prop="index + 'expenditure'" label="支出" />
+				<el-table-column :prop="index + 'balance'" label="余额" />
+			</el-table-column>
+		</el-table>
+	</div>
+</template>
+<script setup>
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { formatDate } from '@/utils/index'
+const { proxy } = getCurrentInstance()
+const loading = ref(false)
+let tableData = ref([])
+const dayNum = ref(0)
+const objectSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
+	if (columnIndex === 0) {
+		const _row = flitterData(tableData.value).one[rowIndex]
+		const _col = _row > 0 ? 1 : 0
+		return {
+			rowspan: _row,
+			colspan: _col,
+		}
+	}
+}
+const flitterData = (arr) => {
+	let spanOneArr = []
+	let concatOne = 0
+	arr.forEach((item, index) => {
+		if (index === 0) {
+			spanOneArr.push(1)
+		} else {
+			//注意这里的quarterly是表格绑定的字段,根据自己的需求来改
+			if (
+				item.accountManagementAlias ===
+				arr[index - 1].accountManagementAlias
+			) {
+				//第一列需合并相同内容的判断条件
+				spanOneArr[concatOne] += 1
+				spanOneArr.push(0)
+			} else {
+				spanOneArr.push(1)
+				concatOne = index
+			}
+		}
+	})
+	return {
+		one: spanOneArr,
+	}
+}
+
+let req = ref({
+	dateBetween: formatDate(new Date(), 'yyyy-MM'),
+	managementId:null,
+})
+
+const getList = async () => {
+	console.log(req.value,123123123)
+	loading.value = true
+	proxy
+		.post('/accountStatement/capitalDaily',req.value)
+		.then((message) => {
+			console.log(message)
+			let arr = []
+			//公司循环
+			for (let i = 0; i < message.length; i++) {
+				const element = message[i]
+				//公司下的管理账户循环
+				for (let j = 0; j < element.managementList.length; j++) {
+					const jelement = element.managementList[j]
+					//管理账户下的币种循环
+					for (let k = 0; k < jelement.currencyList.length; k++) {
+						const kelement = jelement.currencyList[k]
+						let obj = {
+							corporationName: element.corporationName,
+							accountManagementAlias:
+								jelement.accountManagementAlias,
+							currencyType: kelement.currencyType,
+						}
+						//币种下的日期循环
+						for (
+							let l = 0;
+							l < kelement.flowingWaterList.length;
+							l++
+						) {
+							const lelement = kelement.flowingWaterList[l]
+							obj[lelement.day + 'balance'] = lelement.balance
+							obj[lelement.day + 'income'] = lelement.income
+							obj[lelement.day + 'expenditure'] =
+								lelement.expenditure
+						}
+						dayNum.value = kelement.flowingWaterList.length
+						arr.push(obj)
+					}
+				}
+			}
+			console.log(arr)
+			tableData.value = arr
+		})
+}
+const accountManagementData = ref([])
+const getAccountManagement = async () => {
+	proxy
+		.post('/accountManagement/page',{pageNum:1,pageSize:10000})
+		.then((message) => {
+			accountManagementData.value = message.rows
+		})
+}
+getList()
+getAccountManagement()
+</script>
+<style lang="scss">
+.fundsStatement {
+	padding: 20px;
+	margin: 20px;
+	background: #fff;
+	.account-box {
+		width: 360px;
+		height: 102px;
+		background: #eff6ff;
+		display: flex;
+		justify-content: space-between;
+		padding: 20px 10px 20px 33px;
+		margin: 20px 10px;
+		box-shadow: 0px 2px 10px 1px rgba(153, 153, 153, 0.1);
+		border-radius: 10px;
+		overflow: hidden;
+		position: relative;
+		.img {
+			width: 60px;
+			height: 60px;
+			background: url(../../../../assets/images/icon_zhangh1.png)
+				no-repeat;
+		}
+		.text {
+			padding-top: 10px;
+			.account {
+				color: #333;
+				font-size: 20px;
+				font-weight: bold;
+			}
+			.company {
+				color: #999;
+				font-weight: 400;
+				font-size: 14px;
+				margin-top: 10px;
+			}
+		}
+	}
+	.account-box:before {
+		content: '';
+		width: 10px;
+		height: 102px;
+		background: #0084ff;
+		position: absolute;
+		left: 0;
+		top: 0;
+	}
+}
+</style>