Переглянути джерело

打款模块,部门通用管理模块

asd26269546 2 роки тому
батько
коміт
20bc8a5683

+ 13 - 2
src/components/byForm/index.vue

@@ -35,6 +35,7 @@
           :max="i.max"
           :min="i.min"
           :maxlength="i.maxlength"
+          :readonly="i.readonly ? i.readonly : false"
         />
         <el-input
           v-if="i.type == 'selectInput'"
@@ -46,6 +47,7 @@
           :max="i.max"
           :min="i.min"
           :maxlength="i.maxlength"
+          :readonly="i.readonly ? i.readonly : false"
         >
           <template #prepend>
             <el-select
@@ -53,6 +55,7 @@
               :placeholder="i.selectPlaceholder || '请选择'"
               @change="(e) => commonsEmit(e, i)"
               :disabled="i.disabled ? i.disabled : false"
+              :readonly="i.readonly ? i.readonly : false"
               style="width:80px"
               
             >
@@ -75,6 +78,7 @@
           :disabled="i.disabled ? i.disabled : false"
           :filterable="i.filterable ? true : false"
           :style="i.style"
+          :readonly="i.readonly ? i.readonly : false"
         >
           <el-option
             :label="j.title || j.name || j.label"
@@ -88,6 +92,7 @@
           v-model="formData[i.prop]"
           v-else-if="i.type == 'treeSelect'"
           :data="i.data"
+          :readonly="i.readonly ? i.readonly : false"
           :props="{
             value: i.propsTreeValue || 'id',
             label: i.propsTreeLabel || 'label',
@@ -99,6 +104,7 @@
         />
         <el-date-picker
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           v-else-if="i.type == 'date'"
           :type="i.itemType"
           :placeholder="i.placeholder || '请选择时间'"
@@ -110,11 +116,13 @@
         <el-switch
           :disabled="i.disabled ? i.disabled : false"
           v-else-if="i.type == 'switch'"
+          :readonly="i.readonly ? i.readonly : false"
           v-model="formData[i.prop]"
         />
         <el-checkbox-group
           v-else-if="i.type == 'checkbox'"
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           :disabled="i.disabled ? i.disabled : false"
         >
           <el-checkbox
@@ -129,6 +137,7 @@
         <el-radio-group
           v-else-if="i.type == 'radio'"
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           :disabled="i.disabled ? i.disabled : false"
         >
           <el-radio
@@ -144,6 +153,7 @@
         <el-input-number
           v-else-if="i.type == 'number'"
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           :placeholder="i.placeholder || '请输入'"
           @input="commonsEmit"
           :disabled="i.disabled ? i.disabled : false"
@@ -159,6 +169,7 @@
           v-else-if="i.type == 'tree'"
           :data="i.data"
           :props="i.props"
+          :readonly="i.readonly ? i.readonly : false"
           :show-checkbox="i.showCheckbox || true"
         >
         </el-tree>
@@ -166,6 +177,7 @@
           v-else-if="i.type == 'cascader'"
           :options="i.data"
           :props="i.props"
+          :readonly="i.readonly ? i.readonly : false"
           :placeholder="i.placeholder || '请选择'"
           @change="commonsEmit"
           :disabled="i.disabled ? i.disabled : false"
@@ -184,6 +196,7 @@
             :formOption="formOption"
             v-model="formData[i.prop]"
             ref="byform"
+            :rules="rules"
           >
           </byForm>
         </div>
@@ -255,14 +268,12 @@ const dateFormatInit = (itemType) => {
     datetimerange: "YYYY-MM-DD hh:mm:ss",
     daterange: "YYYY-MM-DD hh:mm:ss",
   };
-  console.log(formatObj);
   return formatObj[itemType];
 };
 
 //公用递归,保证key,val统一
 const commonRecursive = (arr, labelKey, labelVal, childrenName) => {
   for (let i = 0; i < arr.length; i++) {
-    console.log(arr[i]);
     if (labelKey == "stringArray") {
       arr[i] = {
         label: arr[i],

+ 3 - 3
src/layout/components/AppMain.vue

@@ -21,10 +21,10 @@ const tagsViewStore = useTagsViewStore()
 <style lang="scss" scoped>
 .app-main {
   /* 50= navbar  50  */
-  min-height: calc(100vh - 50px);
+  height: calc(100vh - 100px);
   width: 100%;
   position: relative;
-  overflow: hidden;
+  overflow-y: auto;
 }
 
 .fixed-header + .app-main {
@@ -34,7 +34,7 @@ const tagsViewStore = useTagsViewStore()
 .hasTagsView {
   .app-main {
     /* 84 = navbar + tags-view = 50 + 34 */
-    min-height: calc(100vh - 100px);
+    height: calc(100vh - 100px);
   }
 
   .fixed-header + .app-main {

+ 101 - 78
src/views/finance/fundManage/accountPayment/index.vue

@@ -12,18 +12,7 @@
 					//element talbe事件都能传
 					select: select,
 				}"
-				:action-list="[
-					{
-						text: 'Excel导入',
-						action: () => openExcel(),
-						disabled: false,
-					},
-					{
-						text: '添加物料',
-						action: () => openModal('add'),
-						disabled: false,
-					},
-				]"
+				:action-list="[]"
 				@get-list="getList"
 			>
 				<template #pic="{ item }">
@@ -109,7 +98,7 @@
 import { ElMessage, ElMessageBox } from 'element-plus'
 import byTable from '@/components/byTable/index'
 import byForm from '@/components/byForm/index'
-
+import Cookies from 'js-cookie'
 import { computed, defineComponent, ref } from 'vue'
 const loading = ref(false)
 const submitLoading = ref(false)
@@ -165,9 +154,9 @@ const config = computed(() => {
 			attrs: {
 				label: '付款类型',
 				prop: 'type',
-                render(type) {
-                    return proxy.dictDataEcho(type, fundsType.value);
-                },
+				render(type) {
+					return proxy.dictDataEcho(type, dictsData.value.payment_type)
+				},
 			},
 		},
 		{
@@ -279,77 +268,105 @@ const treeListData = ref([])
 const formConfig = computed(() => {
 	return [
 		{
-			type: 'treeSelect',
-			prop: 'productClassifyId',
-			label: '物料分类',
-			data: [],
+			type: 'title',
+			label: '请款信息',
 		},
 		{
-			type: 'select',
-			prop: 'type',
-			label: '物料类型',
-			required: true,
-			data: [
-				{
-					label: '原料',
-					id: '1',
-				},
-				{
-					label: '辅料',
-					id: '2',
-				},
-				{
-					label: '配件',
-					id: '3',
-				},
-				{
-					label: '包材',
-					id: '4',
-				},
-				{
-					label: '其他',
-					id: '5',
-				},
-			],
+			type: 'input',
+			prop: 'businessManagementName',
+			label: '付款账户',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'incomeAmount',
+			label: '请款金额',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'paymentMethod',
+			label: '付款方式',
+			readonly: true,
 		},
 		{
 			type: 'input',
 			prop: 'name',
-			label: '物料名称',
+			label: '户名',
+			readonly: true,
 		},
 		{
 			type: 'input',
-			prop: 'spec',
-			label: '规格型号',
+			prop: 'accountOpening',
+			label: '银行账号',
+			readonly: true,
 		},
 		{
+			type: 'input',
+			prop: 'openingBank',
+			label: '开户银行',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'interbankNumber',
+			label: '联行号',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'remark',
+			label: '摘要',
+			readonly: true,
+		},
+		{
+			type: 'title',
+			label: '付款信息',
+		},
+
+		{
 			type: 'select',
-			prop: 'unit',
-			label: '单位',
+			prop: 'accountManagementId',
+			label: '付款账户',
 			required: true,
-			data: [
-				{
-					label: '个',
-					id: '个',
-				},
-				{
-					label: '双',
-					id: '双',
+			isLoad: {
+				url: '/accountManagement/page',
+				req: {
+					pageNum: 1,
+					pageSize: 9999,
 				},
-			],
+				labelKey: 'name',
+				labelVal: 'id',
+				method: 'post',
+				resUrl: 'rows',
+			},
 		},
 		{
-			type: 'slot',
-			slotName: 'productPic',
-			prop: 'fileList',
-			label: '产品图片',
+			type: 'selectInput',
+			label: '付款金额',
+			itemWidth: 60,
+			prop: 'amount',
+			data: [],
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'businessCurrency',
+			
+		},
+		{
+			type: 'date',
+			prop: 'expensesTime',
+			label: '打款时间',
 		},
-
 		{
 			type: 'input',
 			prop: 'remark',
-			label: '备注',
-			itemType: 'textarea',
+			label: '摘要',
+		},
+		{
+			type: 'slot',
+			slotName: 'productPic',
+			prop: 'fileList',
+			label: '上传附件',
 		},
 	]
 })
@@ -366,7 +383,6 @@ const generatePassword = () => {
 	}
 	return password
 }
-
 const getList = async (req) => {
 	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
 	loading.value = true
@@ -384,9 +400,20 @@ const getList = async (req) => {
 const uploadData = ref({})
 const fileList = ref([])
 const fileListCopy = ref([])
-proxy.getDict(['payment_status','funds_type','funds_payment_method']).then((res) => {
-	console.log(res)
-})
+let dictsData = reactive({})
+proxy
+	.getDict(['payment_status', 'payment_type','account_currency'])
+	.then((res) => {
+		dictsData = res
+		console.log(res)
+		formConfig.value[11].data = res.account_currency.map(item => {
+			return {
+				label: item.dictValue,
+				value: item.dictKey,
+			}
+		})
+		console.log(formConfig.value[11].data)	
+	})
 const openModal = () => {
 	dialogVisible.value = true
 	modalType.value = 'add'
@@ -416,15 +443,12 @@ const select = (_selection, row) => {
 const submitForm = () => {
 	console.log(byform.value)
 	byform.value.handleSubmit((valid) => {
-		formData.data.fileList = fileListCopy.value.map((x) => ({
-			id: x.id,
-			fileName: x.fileName,
-		}))
+		
 		submitLoading.value = true
-		proxy.post('/productInfo/' + modalType.value, formData.data).then(
+		proxy.post('/accountPayment/add', formData.data).then(
 			(res) => {
 				ElMessage({
-					message: modalType.value == 'add' ? '添加成功' : '编辑成功',
+					message: '打款成功',
 					type: 'success',
 				})
 				dialogVisible.value = false
@@ -454,7 +478,6 @@ const getTreeList = () => {
 const getDtl = (row) => {
 	modalType.value = 'edit'
 	proxy.post('/accountPayment/detail', { id: row.id }).then((res) => {
-		
 		formData.data = res
 		dialogVisible.value = true
 	})

+ 200 - 113
src/views/finance/fundManage/depExpenses/index.vue

@@ -10,32 +10,21 @@
         highlight-current-row
         :selectConfig="selectConfig"
         :table-events="{
-          //element talbe事件都能传
           select: select,
         }"
         :action-list="[]"
         @get-list="getList"
       >
-        <template #phoneNumber="{ item }">
-          <div>
-            <span v-for="(x, index) in getTypeData(item, 0)">
-              {{ x.contactNumber }}
-              <span v-if="index < getTypeData(item, 0).length - 1">,</span>
-            </span>
-          </div>
-        </template>
-        <template #email="{ item }">
-          <div>
-            <span v-for="(x, index) in getTypeData(item, 1)">
-              {{ x.contactNumber }}
-              <span v-if="index < getTypeData(item, 1).length - 1">,</span>
-            </span>
+        <template #amount="{ item }">
+          <div :style="`color: ${item.amount <= 0 ? 'red' : '#39C55A'}`">
+            {{dictDataEcho(item.currency,dictsData.account_currency) + ' ' + item.amount}}
           </div>
         </template>
+        
       </byTable>
     </div>
     <el-dialog
-      :title="modalType == 'add' ? '添加IoT平台' : '编辑'"
+      title="拆分"
       v-model="dialogVisible"
       width="600"
       v-loading="loading"
@@ -57,60 +46,63 @@
               label-width="0px"
               style="margin-top: 15px"
             >
-              <el-table :data="formData.data.internalAddressBookList">
-                <el-table-column prop="type" label="部门">
+              <el-table :data="formData.data.accountDeptRunningWaterDetailList">
+                <el-table-column prop="deptId" label="部门">
                   <template #default="{ row, $index }">
                     <el-form-item
-                      :prop="'internalAddressBookList.' + $index + '.type123'"
-                      :rules="rules.type"
+                      :prop="'accountDeptRunningWaterDetailList.' + $index + '.deptId'"
+                      :rules="rules.deptId"
                       :inline-message="true"
                     >
-                      <el-select v-model="row.type" placeholder="请选择">
-                        <el-option
-                          v-for="item in contactInformationType"
-                          :label="item.dictValue"
-                          :value="item.dictKey"
-                        >
-                        </el-option>
-                      </el-select>
+                      <el-cascader
+                        v-model="row.deptId"
+                        :options="deptTreeData"
+                        :props="{
+                          value: 'deptId',
+                        }"
+                        clearable
+                        filterable
+                        style="width: 100%"
+                      />
                     </el-form-item>
                   </template>
                 </el-table-column>
                 <el-table-column
-                  prop="contactNumber"
+                  prop="amount"
                   label="分拆金额"
                   
                 >
                   <template #default="{ row, $index }">
                     <el-form-item
                       :prop="
-                        'internalAddressBookList.' + $index + '.type456'
+                        'accountDeptRunningWaterDetailList.' + $index + '.amount'
                       "
-                      :rules="rules.contactNumber"
+                      :rules="rules.amount"
                       :inline-message="true"
                     >
                       <el-input
-                        v-model="row.contactNumber"
+                        v-model="row.amount"
                         placeholder="请输入"
+                        type="number"
                       />
                     </el-form-item>
                   </template>
                 </el-table-column>
                 <el-table-column
-                  prop="contactNumber"
+                  prop="remarks"
                   label="备注"
                   
                 >
                   <template #default="{ row, $index }">
                     <el-form-item
                       :prop="
-                        'internalAddressBookList.' + $index + '.type789'
+                        'accountDeptRunningWaterDetailList.' + $index + '.remarks'
                       "
-                      :rules="rules.contactNumber"
+                      :rules="rules.remarks"
                       :inline-message="true"
                     >
                       <el-input
-                        v-model="row.contactNumber"
+                        v-model="row.remarks"
                         placeholder="请输入"
                       />
                     </el-form-item>
@@ -140,6 +132,35 @@
         </el-button>
       </template>
     </el-dialog>
+    <el-dialog
+      title="调整部门"
+      v-model="depModal"
+      width="600"
+      v-loading="loading"
+    >
+      <p>部门名称</p>
+      <el-cascader
+          v-model="departmentId"
+          :options="deptTreeData"
+          :props="{
+            value: 'deptId',
+          }"
+          clearable
+          filterable
+          style="width: 100%"
+        />
+      <template #footer>
+        <el-button @click="depModal = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitDeptForm(departmentId)"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -170,65 +191,59 @@ let rules = ref({
     { required: true, message: "请输入联系号码", trigger: "blur" },
   ],
 });
+import Cookies from 'js-cookie'
+
 const { proxy } = getCurrentInstance();
 const selectConfig = [];
 const config = computed(() => {
   return [
     {
       attrs: {
-        label: "归属部门",
-      },
-      render(row) {
-        return row.dept.deptName;
-      },
-    },
-    {
-      attrs: {
         label: "资金账户",
-        prop: "deptId",
+        prop: "accountManagementName",
       },
     },
     {
       attrs: {
         label: "交易时间",
-        prop: "nickName",
+        prop: "transactionTime",
       },
     },
     {
       attrs: {
-        type: "slot",
-        slot: "phoneNumber",
         label: "交易金额",
+        prop: "amount",
+        slot:'amount'
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "accountOpening",
         label: "对方账户",
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "openingBank",
         label: "对方银行",
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "name",
         label: "对方账号",
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "remarks",
         label: "摘要",
       },
     },
     {
       attrs: {
         label: "操作",
-        width: "100",
+        width: "200",
         align: "right",
       },
       // 渲染 el-button,一般用在最后一列。
@@ -236,7 +251,20 @@ const config = computed(() => {
         return [
           {
             attrs: {
-              label: "分析",
+              label: "调整部门",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              depModal.value = true;
+              runningWaterId = row.id
+              departmentId.value = []
+            },
+          },
+          {
+            attrs: {
+              label: "分拆",
               type: "primary",
               text: true,
             },
@@ -265,27 +293,86 @@ const formOption = reactive({
 });
 const byform = ref(null);
 const treeData = ref([]);
+const depModal = ref(false);
+let deptTreeData = ref([]);
+let departmentId = ref([])
+let runningWaterId = ''
+const getDept = async (row) => {
+  // 部门树
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      tenantId: Cookies.get('tenantId')
+    })
+    .then((message) => {
+      recursive(message.data);
+      deptTreeData.value = proxy.handleTree(message.data, "corporationId");
+    });
+};
+getDept()
+
+const submitDeptForm = async (departmentId) => {
+  
+  if (departmentId.length == 0) {
+    ElMessage.error("请选择部门");
+    return;
+  }
+  const params = {
+    deptId: departmentId[departmentId.length - 1],
+    accountDeptRunningWaterId:  runningWaterId
+  };
+  proxy
+    .post("/accountDeptRunningWaterDetail/add", params)
+    .then((message) => {
+      ElMessage.success("调整部门成功");
+      depModal.value = false;
+      getList();
+    })
+    .catch((error) => {
+      ElMessage.error(error);
+    });
+};
+
+const recursive = (data) => {
+  data.map((item) => {
+    item.label = item.deptName;
+    item.id = item.corporationId;
+    if (item.children) {
+      recursive(item.children);
+    } else {
+      item.children = [];
+    }
+  });
+};
+
 const formConfig = computed(() => {
   return [
     {
-      type: "input",
-      prop: "deptName",
-      label: "选择账户",
+			type: 'select',
+			prop: 'accountManagementId',
+			label: '付款账户',
+			required: true,
       disabled: true,
-    },
+			isLoad: {
+				url: '/accountManagement/page',
+				req: {
+					pageNum: 1,
+					pageSize: 9999,
+				},
+				labelKey: 'name',
+				labelVal: 'id',
+				method: 'post',
+				resUrl: 'rows',
+			},
+		},
     {
       type: "date",
-      prop: "nickName",
+      prop: "transactionTime",
       label: "交易时间",
       disabled: true,
     },
     {
-      type: "select",
-      label: "交易金额",
-      itemWidth: 20,
-      data:[]
-    },
-    {
       type: "selectInput",
       label: "交易金额",
       itemWidth: 60,
@@ -293,24 +380,16 @@ const formConfig = computed(() => {
       placeholder: "请输入",
       selectPlaceholder: "币种",
       selectProp: "currency",
-      isLoad: {
-        url: "/supplierInfo/page",
-        req: {
-          pageNum: 1,
-          pageSize: 9999,
-        },
-        labelKey: "name",
-        labelVal: "id",
-        method: "post",
-        resUrl: "rows",
-      },
+      prop: "amount",
+      disabled: true,
     },
     {
       type: "input",
-      prop: "deptName",
+      prop: "remarks",
       label: "摘要",
       disabled: true,
       itemType: "textarea",
+      disabled: true,
     },
     {
       type:'slot',
@@ -326,6 +405,7 @@ const getList = async (req) => {
   proxy
     .post("/accountDeptRunningWater/page", sourceList.value.pagination)
     .then((message) => {
+      console.log(message)
       sourceList.value.data = message.rows;
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
@@ -333,21 +413,45 @@ const getList = async (req) => {
       }, 200);
     });
 };
+let dictsData = reactive({})
+proxy
+	.getDict(['payment_status', 'payment_type','account_currency'])
+	.then((res) => {
+		dictsData = res
+		console.log(res)
+		formConfig.value[2].data = res.account_currency.map(item => {
+			return {
+				label: item.dictValue,
+				value: item.dictKey,
+			}
+		})
+	})
+
 
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
   formData.data = {};
 };
-openModal()
+
 
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
     submitLoading.value = true;
-    proxy.post("/internalAddressBook/" + modalType.value, formData.data).then(
+    const params = {
+      id: formData.data.id,
+      deptRunningWaterDetailList: formData.data.accountDeptRunningWaterDetailList,
+      accountDeptRunningWaterId: formData.data.accountDeptRunningWaterId,
+    };
+    params.deptRunningWaterDetailList.map((item) => {
+      item.deptId = item.deptId[item.deptId.length - 1];
+    })
+    proxy.post("/accountDeptRunningWaterDetail/add", {
+      ...params
+    }).then(
       (res) => {
         ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          message: "拆分成功",
           type: "success",
         });
         dialogVisible.value = false;
@@ -361,34 +465,30 @@ const submitForm = () => {
 
 const getDtl = (row) => {
   modalType.value = "edit";
+  dialogVisible.value = true;
   proxy
-    .post("/internalAddressBook/detail", { userId: row.userId })
+    .post("/accountDeptRunningWaterDetail/detail", { id: row.id })
     .then((res) => {
-      res.forEach((x) => {
-        x.type = x.type + "";
+      console.log(res)
+      res.accountDeptRunningWaterDetailList = res.deptRunningWaterDetailList.map((item) => {
+        item.deptId = [item.deptId];
+        return item;
       });
-      formData.data = {
-        deptName: row.dept.deptName,
-        nickName: row.nickName,
-        internalAddressBookList: res,
-        userId: row.userId,
-      };
+      formData.data = res
       dialogVisible.value = true;
     });
 };
 
 const addRow = () => {
-  console.log(formData.data)
-  formData.data.internalAddressBookList = []
-  formData.data.internalAddressBookList.push({
-    type789: "",
-    type456: "",
-    type123: "",
+  formData.data.accountDeptRunningWaterDetailList.push({
+    remarks: "",
+    amount: null,
+    deptId: [],
   });
 };
 
 const handleRemove = (index) => {
-  formData.data.internalAddressBookList.splice(index, 1);
+  formData.data.accountDeptRunningWaterDetailList.splice(index, 1);
   return ElMessage({
     message: "删除成功!",
     type: "success",
@@ -396,27 +496,14 @@ const handleRemove = (index) => {
 };
 
 const contactInformationType = ref([]);
-const getDict = () => {
-  const tenantId = useUserStore().user.tenantId;
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      tenantId: tenantId,
-      dictCode: "contact_information",
-    })
-    .then((res) => {
-      contactInformationType.value = res.rows;
-    });
-};
 
 const getTypeData = (item, type) => {
-  if (item.internalAddressBookList)
-    return item.internalAddressBookList.filter((x) => x.type === type) || [];
+  if (item.accountDeptRunningWaterDetailList)
+    return item.accountDeptRunningWaterDetailList.filter((x) => x.type === type) || [];
 };
 
-//getList();
-getDict();
+getList();
+
 </script>
   
 <style lang="scss" scoped>