浏览代码

Merge branch 'dev0.3' into stage

asd26269546 1 年之前
父节点
当前提交
5c2cf88301

+ 55 - 47
src/components/PDF/purchasePDF.vue

@@ -2,41 +2,47 @@
   <div>
     <div id="pdfDom" ref="pdfDom" style="width: 776px">
       <div style="border: 1px solid #000; border-collapse: collapse">
-        <div style="text-align: right; padding: 2px 4px 0 0">
+        <div style="text-align: right; padding: 10px 10px 0 0">
           合同号:{{ pdfData.code }}
         </div>
         <div class="title">购销合同</div>
         <div style="display: flex">
-          <div style="display: flex; width: 50%; padding-right: 20px">
+          <div style="display: flex; width: 50%" class="padding-10px">
             <div style="width: 60px">买方:</div>
             <div style="width: calc(100% - 60px)">
               <div>福建宏星电子科技有限公司</div>
-              <div>福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层</div>
+              <div class="margin-top-5px">
+                福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
+              </div>
             </div>
           </div>
-          <div style="display: flex; width: 50%; padding-left: 20px">
+          <div style="display: flex; width: 50%" class="padding-10px">
             <div style="width: 60px">卖方:</div>
             <div style="width: calc(100% - 60px)">
               {{ pdfData.supplyName }}
             </div>
           </div>
         </div>
-        <div style="display: flex">
-          <div style="display: flex; width: 50%; padding-right: 20px">
+        <div style="display: flex" class="margin-top-5px">
+          <div style="display: flex; width: 50%" class="padding-10px">
             <div style="width: 60px">经手人:</div>
             <div style="width: calc(100% - 60px)">
               {{ pdfData.purchaseName }}
             </div>
           </div>
-          <div style="display: flex; width: 50%; padding-left: 20px">
+          <div style="display: flex; width: 50%" class="padding-10px">
             <div style="width: 60px">经手人:</div>
             <div style="width: calc(100% - 60px)">
               {{ pdfData.contactPerson }}
             </div>
           </div>
         </div>
-        <div>买卖双方经协商,一致同意签订以下合同</div>
-        <div>货物名称、规格型号、单位、数量、单价及金额:</div>
+        <div class="padding-10px margin-top-5px">
+          买卖双方经协商,一致同意签订以下合同
+        </div>
+        <div class="padding-10px margin-top-5px" style="padding-bottom: 10px">
+          货物名称、规格型号、单位、数量、单价及金额:
+        </div>
         <table border="1" style="width: 100%" class="table">
           <tr>
             <td style="width: 70px">序号</td>
@@ -63,7 +69,7 @@
             </td>
           </tr>
           <tr>
-            <td colspan="4" style="text-align: right">其他收费项目</td>
+            <td colspan="4" style="text-align: right">其他收费项目</td>
             <td></td>
             <td></td>
             <td>
@@ -72,7 +78,7 @@
             </td>
           </tr>
           <tr>
-            <td colspan="4" style="text-align: right">合计</td>
+            <td colspan="4" style="text-align: right">合计</td>
             <td>{{ pdfData.countTotal }}</td>
             <td></td>
             <td>
@@ -86,7 +92,7 @@
             </td>
           </tr>
           <tr>
-            <td>交货地点</td>
+            <td>交货地点</td>
             <td colspan="6" style="text-align: left">
               福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
             </td>
@@ -96,50 +102,50 @@
               <td colspan="6" style="text-align: left"></td>
             </tr> -->
           <tr>
-            <td>保修期</td>
+            <td>保修期</td>
             <td colspan="6" style="text-align: left">一年</td>
           </tr>
           <tr>
-            <td colspan="7" style="text-align: left; padding: 0px">
-              <div style="padding: 2px 0px">
-                一、交货地点:福州软件园A区28座5层。
-              </div>
-              <div style="padding: 2px 0px">二、运输方式及运费:买方承担。</div>
-              <div style="padding: 2px 0px">
+            <td colspan="7" style="text-align: left; padding: 10px">
+              <div>一、交货地点:福州软件园A区28座5层。</div>
+              <div class="margin-top-5px">二、运输方式及运费:买方承担。</div>
+              <div class="margin-top-5px">
                 三、质量要求:样品品质、型号、规格、数量如同买方确认上表规格所示,不符合则由卖方承担责任。
               </div>
-              <div style="padding: 2px 0px">四、交货时间:2023年4月13日。</div>
-              <div style="padding: 2px 0px">五、付款方式:银行转账。</div>
-              <div style="padding: 2px 0px">六、保修期:一年。</div>
-              <div style="padding: 2px 0px">
+              <div class="margin-top-5px">四、交货时间:2023年4月13日。</div>
+              <div class="margin-top-5px">五、付款方式:银行转账。</div>
+              <div class="margin-top-5px">六、保修期:一年。</div>
+              <div class="margin-top-5px">
                 七、本合同经买卖双方签字盖章后生效,传真件有效。
               </div>
-              <div style="padding: 2px 0px">
+              <div class="margin-top-5px">
                 八、解决合同纠纷:原双方另有约定外,均按《中华人民共和国合同法》有关规定处理。
               </div>
-              <div style="padding: 2px 0px">九、其他约定事项:友好解决。</div>
+              <div class="margin-top-5px">九、其他约定事项:友好解决。</div>
             </td>
           </tr>
         </table>
         <div style="display: flex">
-          <div style="width: 50%; padding-right: 20px">
+          <div style="width: 50%; padding: 10px">
             <div>买方:</div>
-            <div>单位名称:福建宏星电子科技有限公司</div>
-            <div>
+            <div class="margin-top-5px">单位名称:福建宏星电子科技有限公司</div>
+            <div class="margin-top-5px">
               地址:福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
             </div>
-            <div>电话:</div>
-            <div>传真:</div>
-            <div style="opacity: 0">|</div>
-            <div style="margin-top: auto">代表人签字:</div>
+            <div class="margin-top-5px">电话:</div>
+            <div class="margin-top-5px">传真:</div>
+            <!-- <div style="opacity: 0.1" class="margin-top-5px">|</div> -->
+            <div class="margin-top-5px">代表人签字:</div>
           </div>
-          <div style="width: 50%; padding-left: 20px">
+          <div style="width: 50%; padding: 10px">
             <div>卖方:</div>
-            <div>单位名称:{{ pdfData.supplyName }}</div>
-            <div>统一社会信用代码:</div>
-            <div>开户银行:{{ pdfData.openingBank }}</div>
-            <div>帐号:{{ pdfData.accountOpening }}</div>
-            <div>
+            <div class="margin-top-5px">单位名称:{{ pdfData.supplyName }}</div>
+            <div class="margin-top-5px">统一社会信用代码:</div>
+            <div class="margin-top-5px">
+              开户银行:{{ pdfData.openingBank }}
+            </div>
+            <div class="margin-top-5px">帐号:{{ pdfData.accountOpening }}</div>
+            <div class="margin-top-5px">
               地址:<span
                 v-if="
                   pdfData.supplyAddress && pdfData.supplyAddress.countryName
@@ -161,16 +167,12 @@
                 >,{{ pdfData.supplyAddress.areaDetail }}</span
               >
             </div>
-            <div>电话:{{ pdfData.contactNumber }}</div>
-            <div>代表人签字:</div>
+            <div class="margin-top-5px">电话:{{ pdfData.contactNumber }}</div>
+            <div class="margin-top-5px">代表人签字:</div>
           </div>
         </div>
         <div
-          style="
-            padding: 30px 0px 20px 0;
-            text-align: right;
-            border-top: 1px solid #000;
-          "
+          style="padding: 10px; text-align: right; border-top: 1px solid #000"
         >
           签订日期:{{ pdfData.approvedDate }}
         </div>
@@ -265,8 +267,8 @@ watch(
     // margin-right: -1px;
 
     td {
-      text-align: center;
-      padding: 8px 0px;
+      // text-align: center;
+      padding: 5px 10px;
     }
     // tr td:last-child {
     //   border-right: 0 !important;
@@ -277,5 +279,11 @@ watch(
     justify-content: space-between;
     margin: 5px 0px;
   }
+  .padding-10px {
+    padding: 0px 10px;
+  }
+  .margin-top-5px {
+    margin-top: 5px;
+  }
 }
 </style>

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

@@ -520,9 +520,16 @@ loadInit();
 }
 .by-form .el-form--inline .el-form-item {
   margin-right: 0px;
-  padding: 0 10px;
+  
   box-sizing: border-box;
 }
+.by-form .el-form--inline>.el-form-item{
+  padding: 0 10px;
+}
+
+/* .el-form--inline.el-form--label-top{
+  justify-content: space-between;
+} */
 
 .dn {
   display: none !important;

+ 6 - 0
src/components/byTable/demo.vue

@@ -294,6 +294,9 @@ const statConfig = computed(() => {
 					label:'吃鸡数量',
 					num:100000.00,
 					type:6,//一共6总样式,默认1
+					click:(e,index)=>{//点击事件
+						console.log(e,index)
+					},
 				},
 				{
 					label:'吃鸡数量',
@@ -329,6 +332,9 @@ const statConfig = computed(() => {
 				//一个卡牌多数据配置
 				{
 					label:'刺激战场',
+					click:(e,index)=>{//点击事件
+						console.log(e,index)
+					},
 					data:[
 						{
 							label:'吃鸡数量',

+ 14 - 16
src/components/byTable/index.vue

@@ -46,6 +46,8 @@
         :class="'theme' + i.type"
         v-for="(i, index) in statConfig[statSelectVal].data"
         :key="index"
+        @click="i.click ? i.click(i, index) : ''"
+        :style="i.click ? 'cursor: pointer' : ''"
       >
         <div class="label">{{ i.label }}</div>
         <div class="num">{{ i.num }}</div>
@@ -55,6 +57,9 @@
         v-for="(i, index) in statConfig[statSelectVal].data"
         :key="index"
         class="multi-data"
+        :class="'theme' + i.type"
+        @click="i.click ? i.click(i, index) : ''"
+        :style="i.click ? 'cursor: pointer' : ''"
       >
         <div class="label">{{ i.label }}</div>
         <div class="num-warp">
@@ -82,11 +87,15 @@
           style="margin-right: 10px"
         >
           <div class="by-dropdown-title">
-            {{ i.label || i.labelCopy
-            }}<i
-              style="margin-left: 5px"
-              class="iconfont icon-iconm_xialan1"
-            ></i>
+            {{
+              pagination[i.prop]
+                ? i.data.find((j) => j.value === pagination[i.prop])
+                  ? i.data.find((j) => j.value === pagination[i.prop]).label
+                  : i.label
+                : i.labelCopy
+            }}
+            <!-- {{ i.label || i.labelCopy }} -->
+            <i style="margin-left: 5px" class="iconfont icon-iconm_xialan1"></i>
           </div>
           <ul class="by-dropdown-lists">
             <li
@@ -490,7 +499,6 @@ export default defineComponent({
     //下拉搜索相关
 
     const searchItemSelct = (item, i, index) => {
-      console.log(item, i, index, "www");
       if (item == "all") {
         i.label = { ...props.selectConfig[index] }.labelCopy;
         proxy.$emit(
@@ -518,16 +526,6 @@ export default defineComponent({
       }
     };
     const hocElTable = ref();
-    // const sortableInit = () => {
-    // 	console.log(hocElTable)
-    // 	const el = hocElTable.value.$el.querySelector('.el-table__body tbody')
-    // 	Sortable.create(el, {
-    // 		ghostClass: "sortableActive",
-    // 		onEnd(evt) {
-    // 			console.log(evt,proxy.source)
-    // 		}
-    // 	})
-    // }
 
     return {
       getParent,

+ 4 - 2
src/components/headerBar/header-bar.vue

@@ -133,12 +133,12 @@
       </ul>
       <div class="fr">
         <!-- :value="12" -->
-        <el-badge style="cursor: pointer;" class="badge" @click="noticeTableModal = true">
+        <el-badge :value="badgeNum" style="cursor: pointer;" class="badge" @click="noticeTableModal = true">
           <el-icon :size="20">
             <BellFilled />
           </el-icon>
         </el-badge>
-        <notice v-model='noticeTableModal'></notice>
+        <notice v-model='noticeTableModal' @changeNum="(e)=> badgeNum = e"></notice>
         <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
           <div class="dropdown-box">
             {{ userData }}
@@ -187,6 +187,8 @@ const openLeftBaner = (i, index) => {
   menuName.value = i.menuName;
   routerInit(i);
 };
+
+const badgeNum = ref(0);
 let menuName = ref("");
 const logoUrl = ref();
 const getLogo = () => {

+ 92 - 23
src/components/notice/index.vue

@@ -15,11 +15,12 @@
 				v-if="data.length > 0"
 				style="margin-top: 10px"
 			>
-				{{ data[index].content }}
+				<h3>{{ data[index].title }}</h3>
+				{{ data[index].businessData }}
 			</div>
 			<template #footer>
 				<span class="dialog-footer">
-					<!-- <el-button
+					<el-button
 						size="small"
 						@click="index--"
 						:disabled="data.length < 2 || index == 0"
@@ -30,14 +31,14 @@
 						@click="index++"
 						:disabled="data.length == index + 1"
 						>下一条</el-button
-					> -->
-					<!-- <el-button
+					>
+					<el-button
 						type="primary"
 						size="small"
-						:disabled="data.length == 0"
+						:disabled="data.length == 0 || data[index].isRead"
 						@click="confirm"
 						>确认已读</el-button
-					> -->
+					>
 					<!-- <span class="more" @click="moreFn">查看更多 &gt;</span> -->
 				</span>
 			</template>
@@ -47,30 +48,41 @@
 			:class="modelValue ? 'notice-table-warp-open' : ''"
 			@click.stop="closeNoticeTableModal"
 		>
-			<div class="notice-table" @click.stop>
+			<div class="notice-table" @click.stop  v-loading="loading" >
 				<div class="tabs">
 					<ul>
-						<li style="padding-left: 0; border: none" @click="tableTagType = 1" :class="tableTagType == 1 ? 'active' : ''">
-							全部(0
+						<li style="padding-left: 0; border: none" @click="pushInfoReq.type = '';getPushInfo()" :class="pushInfoReq.type == '' ? 'active' : ''">
+							全部({{pushInfoReq.total}}
 						</li>
-						<li  @click="tableTagType = 2" :class="tableTagType == 2 ? 'active' : ''">待办(0)</li>
-						<li  @click="tableTagType = 3" :class="tableTagType == 3 ? 'active' : ''">通知(0)</li>
+						<li  @click="pushInfoReq.type = 1;getPushInfo()" :class="pushInfoReq.type == 1 ? 'active' : ''">流程(0)</li>
+						<li  @click="pushInfoReq.type = 2;getPushInfo()" :class="pushInfoReq.type == 2 ? 'active' : ''">业务(0)</li>
 					</ul>
-					<div class="more">查看更多&gt;</div>
+					<!-- <div class="more">查看更多&gt;</div> -->
 				</div>
 				<el-table :data="noticeData" style="width: 100%">
-					<el-table-column prop="date" label="标题内容" width="250">
+					<el-table-column prop="title" label="标题内容" width="250">
+						<template #default="scope">
+							<el-tooltip
+								class="box-item"
+								effect="dark"
+								:content="scope.row.title"
+								placement="top"
+							>
+								<span>{{ scope.row.title.slice(0,12) }}</span><span v-if="scope.row.title.length > 12">..</span>
+							</el-tooltip>
+							
+						</template>
 					</el-table-column>
-					<el-table-column prop="name" label="类型" width="120">
+					<el-table-column prop="businessType" label="类型" width="120">
 					</el-table-column>
 					<el-table-column prop="address" label="操作">
 						<template #default="scope">
-							<span style="cursor: pointer">未读</span>
+							<span style="cursor: pointer" @click="readFn(scope)">未读</span>
 						</template>
 					</el-table-column>
 				</el-table>
 				<div class="notice-btn-box" style="margin-top: 20px">
-					<el-button plain disabled>点击清空</el-button>
+					<!-- <el-button plain disabled>点击清空</el-button> -->
 					<el-button type="primary" disabled>全部已读</el-button>
 				</div>
 			</div>
@@ -78,7 +90,7 @@
 	</div>
 </template>
 <script setup>
-import { ElMessageBox, ElNotification } from 'element-plus'
+import { ElMessageBox, ElNotification,ElMessage } from 'element-plus'
 import {
   getToken
 } from '@/utils/auth'
@@ -89,11 +101,10 @@ defineProps({
     default: false,
   },
 });
-const emit = defineEmits(["update:modelValue"]);
+const emit = defineEmits(["update:modelValue"],'changeNum');
 const closeNoticeTableModal = () => {
 	emit("update:modelValue", false);
 };
-const tableTagType = ref(1)
 let noticeData = ref([
 	// {
 	// 	date: '2016-05-02',
@@ -123,8 +134,27 @@ const moreFn = () => {
 	noticeTableModal.value = true
 }
 
+const readFn = (item) => {
+	commonRead([item.row.id])
+}
+const commonRead = (ids,type) => {
+	proxy.post('/pushInfo/read',{idList:ids}).then(res=>{
+		console.log(res)
+		ElMessage({
+			message: '已读成功',
+			type: 'success',
+		})
+		if(type == 'confirm'){
+			data.value[index].isRead = true
+		}else{
+			getPushInfo()
+		}
+	})
+}
 const confirm = () => {
 	value.value = false
+	commonRead([data.value[index.value].id],'confirm')
+	
 }
 // proxy.post('sendMeg/page',{
 // 	pageNum:1,
@@ -147,11 +177,27 @@ const socketInit = () => {
 	window.ws.onmessage = function (e) {
 		//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
 		//在data.value前面插入
-		console.log(JSON.parse(e.data).data)
-		data.value.unshift({title:"最新公告",content:JSON.parse(e.data).data})
-		index.value = 0
-		value.value = true
+		const res = JSON.parse(e.data)
+		console.log(res)
+		
 		
+		if(res.type == 1) {
+			index.value = 0
+			data.value = res.list
+			if(res.list.length > 0) value.value = true
+		}
+		if(res.type == 2) {
+			emit('changeNum',res.count * 1)
+			getPushInfo()
+		}
+		if(res.type == 3) {
+			ElNotification({
+				title: '提示',
+				message: res.title,
+				position: 'bottom-right',
+				duration:0,
+			})
+		}
 		
 	}
 	window.ws.onclose = function (e) {
@@ -163,6 +209,29 @@ const socketInit = () => {
 		console.log(error)
 	}
 }
+let pushInfoReq = ref({
+	pageNum: 1,
+	pageSize: 5,
+	pushRead: 0,
+	type: '',
+	total:0,
+})
+const loading = ref(false)
+const getPushInfo = () => {
+	loading.value = true
+	proxy.post('/pushInfo/page',{
+		pageNum:1,
+		pageSize:5,
+		pushRead:0,
+		type:2,
+	}).then(res=>{
+		noticeData.value = res.rows
+		pushInfoReq.value.total = res.total
+		setTimeout(() => {
+			loading.value = false
+		}, 500);
+	})
+}
 socketInit()
 const handleClose = () => {
 	value.value = false

+ 35 - 29
src/components/process/Contract.vue

@@ -148,7 +148,7 @@
               </template>
             </el-table-column>
             <el-table-column prop="unit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.unit, productUnit)" />
-            <el-table-column label="数量" width="150">
+            <el-table-column label="数量" width="160">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                   <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
@@ -157,10 +157,13 @@
                       v-model="row.quantity"
                       placeholder="请输入数量"
                       style="width: 100%"
-                      :precision="4"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('contractProductList', $index, 'quantity');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -174,10 +177,13 @@
                       v-model="row.price"
                       placeholder="请输入单价"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('contractProductList', $index, 'price');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -214,10 +220,13 @@
                       v-model="row.amount"
                       placeholder="请输入金额"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="totalAmount()" />
+                      @change="
+                        () => {
+                          return totalAmount('contractProjectList', $index, 'amount');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -254,18 +263,6 @@
                 <el-input v-model="formData.data.amount" placeholder="合同总金额" disabled />
               </el-form-item>
             </el-col>
-            <!-- <el-col :span="4">
-              <el-form-item label="报价有效期 (天)" prop="effective">
-                <el-input-number onmousewheel="return false;"
-                  v-model="formData.data.effective"
-                  placeholder="请输入有效期"
-                  style="width: 100%"
-                  :precision="0"
-                  :controls="false"
-                  :min="0"
-                />
-              </el-form-item>
-            </el-col> -->
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
@@ -375,7 +372,6 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
               <el-form-item label="交货期限 (天)" prop="deliveryTime">
-                <!-- <el-date-picker v-model="formData.data.deliveryTime" type="date" placeholder="请选择交货期限" value-format="YYYY-MM-DD" /> -->
                 <el-input-number
                   onmousewheel="return false;"
                   v-model="formData.data.deliveryTime"
@@ -424,10 +420,13 @@
                       v-model="row.quantity"
                       placeholder="请输入数量"
                       style="width: 100%"
-                      :precision="4"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('contractShipmentList', $index, 'quantity');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -1115,13 +1114,18 @@ const handleRemove = async (index, row) => {
   totalAmount();
   getDecisionAids();
 };
-const calculationAmount = () => {
+const calculationAmount = (listLabel, index, label) => {
+  if (formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   nextTick(() => {
     if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
       for (let i = 0; i < formData.data.contractProductList.length; i++) {
         let money = 0;
         if (formData.data.contractProductList[i].quantity && formData.data.contractProductList[i].price) {
-          money = parseFloat(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price)).toFixed(2);
+          money = Number(
+            Math.round(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price) * 10000) / 10000
+          );
         }
         formData.data.contractProductList[i].amount = money;
       }
@@ -1131,19 +1135,22 @@ const calculationAmount = () => {
     });
   });
 };
-const totalAmount = () => {
+const totalAmount = (listLabel, index, label) => {
+  if (listLabel && formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   let money = 0;
   if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
     for (let i = 0; i < formData.data.contractProductList.length; i++) {
       if (formData.data.contractProductList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.contractProductList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.contractProductList[i].amount)) * 10000) / 10000);
       }
     }
   }
   if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
     for (let i = 0; i < formData.data.contractProjectList.length; i++) {
       if (formData.data.contractProjectList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.contractProjectList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.contractProjectList[i].amount)) * 10000) / 10000);
       }
     }
   }
@@ -1260,7 +1267,6 @@ watch(
       }
       getDecisionAids();
     }
-    console.log('111');
   },
   {
     deep: true,
@@ -1279,7 +1285,7 @@ const acquireSelectList = () => {
   return data;
 };
 onMounted(() => {
-  if(!route.query.processType || route.query.processType == 30) {
+  if (!route.query.processType || route.query.processType == 30) {
     proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
       customerList.value = res.rows.map((item) => {
         return {

+ 34 - 27
src/components/process/ContractAlteration.vue

@@ -148,7 +148,7 @@
               </template>
             </el-table-column>
             <el-table-column label="单位" width="100" :formatter="(row) => dictValueLabel(row.productUnit, productUnit)" />
-            <el-table-column label="数量" width="150">
+            <el-table-column label="数量" width="160">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                   <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
@@ -157,10 +157,13 @@
                       v-model="row.quantity"
                       placeholder="请输入数量"
                       style="width: 100%"
-                      :precision="4"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('contractProductList', $index, 'quantity');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -174,10 +177,13 @@
                       v-model="row.price"
                       placeholder="请输入单价"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('contractProductList', $index, 'price');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -214,10 +220,13 @@
                       v-model="row.amount"
                       placeholder="请输入金额"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="totalAmount()" />
+                      @change="
+                        () => {
+                          return totalAmount('contractProjectList', $index, 'amount');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -254,18 +263,6 @@
                 <el-input v-model="formData.data.amount" placeholder="合同总金额" disabled />
               </el-form-item>
             </el-col>
-            <!-- <el-col :span="4">
-                <el-form-item label="报价有效期 (天)" prop="effective">
-                  <el-input-number onmousewheel="return false;"
-                    v-model="formData.data.effective"
-                    placeholder="请输入有效期"
-                    style="width: 100%"
-                    :precision="0"
-                    :controls="false"
-                    :min="0"
-                  />
-                </el-form-item>
-              </el-col> -->
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
@@ -375,7 +372,6 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
               <el-form-item label="交货期限 (天)" prop="deliveryTime">
-                <!-- <el-date-picker v-model="formData.data.deliveryTime" type="date" placeholder="请选择交货期限" value-format="YYYY-MM-DD" /> -->
                 <el-input-number
                   onmousewheel="return false;"
                   v-model="formData.data.deliveryTime"
@@ -424,10 +420,13 @@
                       v-model="row.quantity"
                       placeholder="请输入数量"
                       style="width: 100%"
-                      :precision="4"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('contractShipmentList', $index, 'quantity');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -1075,13 +1074,18 @@ const handleRemove = async (index, row) => {
   totalAmount();
   getDecisionAids();
 };
-const calculationAmount = () => {
+const calculationAmount = (listLabel, index, label) => {
+  if (formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   nextTick(() => {
     if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
       for (let i = 0; i < formData.data.contractProductList.length; i++) {
         let money = 0;
         if (formData.data.contractProductList[i].quantity && formData.data.contractProductList[i].price) {
-          money = parseFloat(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price)).toFixed(2);
+          money = Number(
+            Math.round(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price) * 10000) / 10000
+          );
         }
         formData.data.contractProductList[i].amount = money;
       }
@@ -1091,19 +1095,22 @@ const calculationAmount = () => {
     });
   });
 };
-const totalAmount = () => {
+const totalAmount = (listLabel, index, label) => {
+  if (listLabel && formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   let money = 0;
   if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
     for (let i = 0; i < formData.data.contractProductList.length; i++) {
       if (formData.data.contractProductList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.contractProductList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.contractProductList[i].amount)) * 10000) / 10000);
       }
     }
   }
   if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
     for (let i = 0; i < formData.data.contractProjectList.length; i++) {
       if (formData.data.contractProjectList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.contractProjectList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.contractProjectList[i].amount)) * 10000) / 10000);
       }
     }
   }

+ 30 - 13
src/components/process/PriceSheet.vue

@@ -156,10 +156,13 @@
                       v-model="row.quantity"
                       placeholder="请输入数量"
                       style="width: 100%"
-                      :precision="4"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('quotationProductList', $index, 'quantity');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -173,10 +176,13 @@
                       v-model="row.price"
                       placeholder="请输入单价"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('quotationProductList', $index, 'price');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -212,10 +218,13 @@
                       v-model="row.amount"
                       placeholder="请输入金额"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="totalAmount()" />
+                      @change="
+                        () => {
+                          return totalAmount('quotationPayList', $index, 'amount');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -386,7 +395,7 @@ const judgeStatus = () => {
     }
   }
   return false;
-};;
+};
 const formOption = reactive({
   inline: true,
   labelWidth: 100,
@@ -715,13 +724,18 @@ const handleRemove = async (index) => {
   await formData.data.quotationProductList.splice(index, 1);
   totalAmount();
 };
-const calculationAmount = () => {
+const calculationAmount = (listLabel, index, label) => {
+  if (formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   nextTick(() => {
     if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
       for (let i = 0; i < formData.data.quotationProductList.length; i++) {
         let money = 0;
         if (formData.data.quotationProductList[i].quantity && formData.data.quotationProductList[i].price) {
-          money = parseFloat(Number(formData.data.quotationProductList[i].quantity) * Number(formData.data.quotationProductList[i].price)).toFixed(2);
+          money = Number(
+            Math.round(Number(formData.data.quotationProductList[i].quantity) * Number(formData.data.quotationProductList[i].price) * 10000) / 10000
+          );
         }
         formData.data.quotationProductList[i].amount = money;
       }
@@ -731,19 +745,22 @@ const calculationAmount = () => {
     });
   });
 };
-const totalAmount = () => {
+const totalAmount = (listLabel, index, label) => {
+  if (listLabel && formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   let money = 0;
   if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
     for (let i = 0; i < formData.data.quotationProductList.length; i++) {
       if (formData.data.quotationProductList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.quotationProductList[i].amount)) * 10000) / 10000);
       }
     }
   }
   if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
     for (let i = 0; i < formData.data.quotationPayList.length; i++) {
       if (formData.data.quotationPayList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.quotationPayList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.quotationPayList[i].amount)) * 10000) / 10000);
       }
     }
   }
@@ -838,7 +855,7 @@ watch(
   }
 );
 onMounted(() => {
-  if(!route.query.processType || route.query.processType == 30) {
+  if (!route.query.processType || route.query.processType == 30) {
     proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
       customerList.value = res.rows.map((item) => {
         return {

+ 99 - 35
src/components/process/SendFunds.vue

@@ -2,7 +2,7 @@
   <div style="width: 100%; padding: 0px 15px">
     <el-form :model="formData.data" :rules="rules" ref="formDom" label-position="top" :disabled="judgeStatus()">
       <div class="_t">基础信息</div>
-      <el-row :gutter="10">
+      <el-row :gutter="20">
         <el-col :span="6">
           <el-form-item label="归属公司" prop="corporationId">
             <el-select v-model="formData.data.corporationId" placeholder="请选择" filterable style="width: 100%" @change="changeType">
@@ -23,7 +23,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row :gutter="10">
+      <el-row :gutter="20">
         <el-col :span="6">
           <el-form-item label="币种" prop="currency">
             <el-select v-model="formData.data.currency" placeholder="请选择" filterable style="width: 100%">
@@ -51,35 +51,39 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row>
+      <el-row :gutter="20">
         <el-col :span="6">
           <el-form-item label="用款时间" prop="paymentTime">
-            <el-date-picker v-model="formData.data.paymentTime" type="datetime" placeholder="请选择" value-format="YYYY-MM-DD HH:mm:ss" />
+            <el-date-picker v-model="formData.data.paymentTime" type="datetime" placeholder="请选择" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="用款说明" prop="paymentRemarks">
+            <el-input v-model="formData.data.paymentRemarks" placeholder="请输入" type="textarea"> </el-input>
+          </el-form-item>
+          <el-form-item label="上传附件">
+            <div style="width: 100%">
+              <el-upload
+                v-model:fileList="fileList"
+                action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+                :data="uploadData"
+                multiple
+                :before-upload="handleBeforeUpload"
+                :on-success="handleSuccess"
+                :on-preview="onPreviewFile">
+                <el-button>选择</el-button>
+              </el-upload>
+            </div>
           </el-form-item>
         </el-col>
       </el-row>
-      <el-form-item label="用款说明" prop="paymentRemarks">
-        <el-input v-model="formData.data.paymentRemarks" placeholder="请输入" type="textarea"> </el-input>
-      </el-form-item>
-      <el-form-item label="上传附件">
-        <div style="width: 100%">
-          <el-upload
-            v-model:fileList="fileList"
-            action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-            :data="uploadData"
-            multiple
-            :before-upload="handleBeforeUpload"
-            :on-success="handleSuccess"
-            :on-preview="onPreviewFile">
-            <el-button>选择</el-button>
-          </el-upload>
-        </div>
-      </el-form-item>
       <div class="_t">请款明细</div>
       <el-form-item>
         <el-button type="primary" @click="handleAddRow" v-if="formData.data.type !== '3'" style="margin: 10px 0"> 添加行 </el-button>
         <el-table :data="formData.data.accountRequestFundsDetailList">
-          <el-table-column prop="count" label="费用类型" min-width="150">
+          <el-table-column prop="count" label="费用类型" width="220">
             <template #default="{ row, $index }">
               <el-form-item :prop="'accountRequestFundsDetailList.' + $index + '.costType'" :rules="rules.costType" :inline-message="true">
                 <el-select v-model="row.costType" placeholder="请选择" filterable style="width: 100%">
@@ -88,7 +92,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column prop="count" label="关联合同" min-width="150">
+          <el-table-column prop="count" label="关联合同" width="220">
             <template #default="{ row, $index }">
               <el-form-item :prop="'accountRequestFundsDetailList.' + $index + '.contractId'" :rules="rules.contractId" :inline-message="true">
                 <el-select v-model="row.contractId" placeholder="请选择" filterable style="width: 100%">
@@ -97,15 +101,15 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column prop="count" label="款项说明" min-width="150">
+          <el-table-column prop="count" label="款项说明" min-width="200">
             <template #default="{ row, $index }">
               <el-form-item :prop="'accountRequestFundsDetailList.' + $index + '.remarks'" :rules="rules.remarks" :inline-message="true">
                 <el-input v-model="row.remarks" placeholder="请输入" type="textarea" />
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column prop="advanceAmount" label="预支金额" width="120" v-if="formData.data.type === '3'" />
-          <el-table-column prop="amount" :label="formData.data.type !== '3' ? '请款金额' : '核销金额'" min-width="150">
+          <el-table-column prop="advanceAmount" label="预支金额" width="140" v-if="formData.data.type === '3'" />
+          <el-table-column prop="amount" :label="formData.data.type !== '3' ? '请款金额' : '核销金额'" width="160">
             <template #default="{ row, $index }">
               <el-form-item :prop="'accountRequestFundsDetailList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true">
                 <el-input-number
@@ -119,14 +123,14 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column prop="zip" label="操作" width="100" v-if="formData.data.type !== '3'">
+          <el-table-column prop="zip" label="操作" width="100" align="center" v-if="formData.data.type !== '3'">
             <template #default="{ $index }">
               <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
             </template>
           </el-table-column>
         </el-table>
       </el-form-item>
-      <el-row :gutter="10">
+      <el-row :gutter="20">
         <el-col :span="6" v-if="formData.data.type === '3'">
           <el-form-item label="预支总额" prop="advanceAmounts">
             <el-input v-model="formData.data.advanceAmounts" placeholder="请输入" disabled />
@@ -151,7 +155,7 @@
         </el-col>
       </el-row>
       <div class="_t">收付款信息</div>
-      <el-row :gutter="10">
+      <el-row :gutter="20">
         <el-col :span="6">
           <el-form-item label="付款方式" prop="paymentMethod">
             <el-select v-model="formData.data.paymentMethod" placeholder="请选择" filterable style="width: 100%">
@@ -167,7 +171,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row :gutter="10">
+      <el-row :gutter="20">
         <el-col :span="6">
           <el-form-item label="户名" prop="name">
             <el-input v-model="formData.data.name" placeholder="请输入" />
@@ -178,8 +182,13 @@
             <el-input v-model="formData.data.accountOpening" placeholder="请输入" />
           </el-form-item>
         </el-col>
+        <el-col :span="3">
+          <el-form-item label="  ">
+            <el-button type="primary" @click="clickSelect" text>选择</el-button>
+          </el-form-item>
+        </el-col>
       </el-row>
-      <el-row :gutter="10">
+      <el-row :gutter="20">
         <el-col :span="6">
           <el-form-item label="开户银行" prop="openingBank">
             <el-input v-model="formData.data.openingBank" placeholder="请输入" />
@@ -409,6 +418,23 @@
         <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="选择付款信息" v-if="openSelect" v-model="openSelect" width="800">
+      <el-table :data="bankList" style="width: 100%">
+        <el-table-column prop="name" label="户名" />
+        <el-table-column prop="accountOpening" label="银行账号" />
+        <el-table-column prop="openingBank" label="开户银行" width="140" />
+        <el-table-column prop="interbankNumber" label="联行号 / SWIFT Code" />
+        <el-table-column align="center" label="操作" width="80">
+          <template #default="{ row }">
+            <el-button type="primary" link @click="handleSelect(row)">选择</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <template #footer>
+        <el-button @click="openSelect = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -428,8 +454,20 @@ const defaultProps = {
 const userList = ref([]);
 const formData = reactive({
   data: {
+    currency: "CNY",
+    type: "2",
     paymentTime: "",
-    accountRequestFundsDetailList: [],
+    departmentId: useUserStore().user.deptId,
+    quantity: 0,
+    paymentMethod: "bank",
+    accountRequestFundsDetailList: [
+      {
+        costType: "",
+        contractId: "",
+        remarks: "",
+        amount: undefined,
+      },
+    ],
     fileList: [],
   },
 });
@@ -445,6 +483,7 @@ let rules = ref({
   //   { required: true, message: "请选择付款账号", trigger: "change" },
   // ],
   costType: [{ required: true, message: "请选择费用类型", trigger: "change" }],
+  quantity: [{ required: true, message: "请输入单据数量", trigger: "blur" }],
   remarks: [{ required: true, message: "请输入款项说明", trigger: "blur" }],
   amount: [{ required: true, message: "请输入请款金额", trigger: "blur" }],
 });
@@ -452,6 +491,7 @@ let rules = ref({
 const handleAddRow = () => {
   formData.data.accountRequestFundsDetailList.push({
     costType: "",
+    contractId: "",
     remarks: "",
     amount: undefined,
   });
@@ -534,7 +574,7 @@ watch(
 );
 
 onMounted(() => {
-  formData.data.paymentTime = proxy.parseTime(new Date());
+  // formData.data.paymentTime = proxy.parseTime(new Date());
   // 核销
   if (route.query.advanceId) {
     formData.data.type = "3";
@@ -554,6 +594,7 @@ const fundsPaymentMethod = ref([]);
 const currencyType = ref([]);
 const advanceList = ref([]);
 const contractList = ref([]);
+const bankList = ref([]);
 const getDictData = () => {
   // 获取归属公司数据
   proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
@@ -618,7 +659,13 @@ const getDictData = () => {
       dictCode: "funds_payment_method",
     })
     .then((res) => {
-      fundsPaymentMethod.value = res.rows;
+      if (res.rows && res.rows.length > 0) {
+        fundsPaymentMethod.value = res.rows;
+        let list = res.rows.filter((item) => item.dictKey === "bank");
+        if (!(list && list.length > 0) && formData.data.paymentMethod === "bank") {
+          formData.data.paymentMethod = "";
+        }
+      }
     });
   // 币种数据
   proxy
@@ -630,6 +677,10 @@ const getDictData = () => {
     })
     .then((res) => {
       currencyType.value = res.rows;
+      let list = res.rows.filter((item) => item.dictKey === "CNY");
+      if (!(list && list.length > 0) && formData.data.currency === "CNY") {
+        formData.data.currency = "";
+      }
     });
   proxy
     .get("/tenantUser/list", {
@@ -648,6 +699,9 @@ const getDictData = () => {
         });
       }
     });
+  proxy.get("/accountRequestFunds/getPayHistoricalInfo", {}).then((res) => {
+    bankList.value = res.data;
+  });
 };
 getDictData();
 const recursive = (data) => {
@@ -829,7 +883,6 @@ const computeMoney = (label) => {
   }
   return amount;
 };
-
 const computeBalance = () => {
   let balance = 0;
   let advanceAmount = computeMoney("advanceAmount");
@@ -842,6 +895,17 @@ const computeBalance = () => {
   }
   return balance;
 };
+const openSelect = ref(false);
+const clickSelect = () => {
+  openSelect.value = true;
+};
+const handleSelect = (item) => {
+  formData.data.name = item.name;
+  formData.data.accountOpening = item.accountOpening;
+  formData.data.openingBank = item.openingBank;
+  formData.data.interbankNumber = item.interbankNumber;
+  openSelect.value = false;
+};
 </script>
 
 <style lang="scss" scoped>

+ 28 - 13
src/components/process/ServiceContract.vue

@@ -164,10 +164,13 @@
                       v-model="row.quantity"
                       placeholder="请输入数量"
                       style="width: 100%"
-                      :precision="4"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('serviceContractProductList', $index, 'quantity');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -181,10 +184,13 @@
                       v-model="row.price"
                       placeholder="请输入单价"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()" />
+                      @change="
+                        () => {
+                          return calculationAmount('serviceContractProductList', $index, 'price');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -221,10 +227,13 @@
                       v-model="row.amount"
                       placeholder="请输入金额"
                       style="width: 100%"
-                      :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="totalAmount()" />
+                      @change="
+                        () => {
+                          return totalAmount('serviceContractPayList', $index, 'amount');
+                        }
+                      " />
                   </el-form-item>
                 </div>
               </template>
@@ -374,7 +383,7 @@ const judgeStatus = () => {
     }
   }
   return false;
-};;
+};
 const formOption = reactive({
   inline: true,
   labelWidth: 100,
@@ -814,14 +823,17 @@ const handleRemove = async (index) => {
   await formData.data.serviceContractProductList.splice(index, 1);
   totalAmount();
 };
-const calculationAmount = () => {
+const calculationAmount = (listLabel, index, label) => {
+  if (formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   nextTick(() => {
     if (formData.data.serviceContractProductList && formData.data.serviceContractProductList.length > 0) {
       for (let i = 0; i < formData.data.serviceContractProductList.length; i++) {
         let money = 0;
         if (formData.data.serviceContractProductList[i].quantity && formData.data.serviceContractProductList[i].price) {
-          money = parseFloat(Number(formData.data.serviceContractProductList[i].quantity) * Number(formData.data.serviceContractProductList[i].price)).toFixed(
-            2
+          money = Number(
+            Math.round(Number(formData.data.serviceContractProductList[i].quantity) * Number(formData.data.serviceContractProductList[i].price) * 10000) / 10000
           );
         }
         formData.data.serviceContractProductList[i].amount = money;
@@ -832,19 +844,22 @@ const calculationAmount = () => {
     });
   });
 };
-const totalAmount = () => {
+const totalAmount = (listLabel, index, label) => {
+  if (listLabel && formData.data[listLabel][index][label]) {
+    formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
+  }
   let money = 0;
   if (formData.data.serviceContractProductList && formData.data.serviceContractProductList.length > 0) {
     for (let i = 0; i < formData.data.serviceContractProductList.length; i++) {
       if (formData.data.serviceContractProductList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.serviceContractProductList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.serviceContractProductList[i].amount)) * 10000) / 10000);
       }
     }
   }
   if (formData.data.serviceContractPayList && formData.data.serviceContractPayList.length > 0) {
     for (let i = 0; i < formData.data.serviceContractPayList.length; i++) {
       if (formData.data.serviceContractPayList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.serviceContractPayList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.serviceContractPayList[i].amount)) * 10000) / 10000);
       }
     }
   }

+ 5 - 15
src/utils/util.js

@@ -1,8 +1,5 @@
 import moment from "moment";
-import {
-  post,
-  get
-} from "@/utils/request";
+import { post, get } from "@/utils/request";
 import Cookies from "js-cookie";
 import html2Canvas from "html2canvas";
 import JsPDF from "jspdf";
@@ -38,11 +35,6 @@ export function getDict(key) {
     let dictObj = {};
     let arr = {};
     let num = 0;
-    // if (!sessionStorage.getItem("dict")) {
-    //   sessionStorage.setItem("dict", JSON.stringify(dictObj));
-    // } else {
-    //   dictObj = JSON.parse(sessionStorage.getItem("dict"));
-    // }
     for (let i = 0; i < key.length; i++) {
       const element = key[i];
       if (dictObj[element]) {
@@ -62,7 +54,6 @@ export function getDict(key) {
           arr[element] = res.rows;
           sessionStorage.setItem("dict", JSON.stringify(dictObj));
           num++;
-          console.log(num);
           if (num === key.length) {
             resolve(arr);
           }
@@ -360,14 +351,14 @@ export function timeInterval(smallTime, largeTime) {
       days: days,
       hours: hours,
       minutes: minutes,
-      seconds: seconds
+      seconds: seconds,
     };
   }
   return {
     days: 0,
     hours: 0,
     minutes: 0,
-    seconds: 0
+    seconds: 0,
   };
 }
 
@@ -405,8 +396,7 @@ export function toDx(n) {
     case "9":
       return "玖";
   }
-};
-
+}
 
 // 金额转大写
 export function NumberToChinese(m) {
@@ -434,4 +424,4 @@ export function NumberToChinese(m) {
   }
   result += result.charAt(result.length - 1) == "元" ? "整" : "";
   return result;
-};
+}

+ 28 - 5
src/views/customer/file/index.vue

@@ -163,8 +163,13 @@
                     <div style="width: 100%">
                       <div style="color: #909399; margin: 8px 0">跟进时间: {{ record.date }}</div>
                       <div style="margin: 8px 0">跟进人: {{ dictValueLabel(record.createUser, userList) }}</div>
-                      <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
-                      <div v-else>跟进记录:</div>
+                      <div v-if="record.type == '30'">
+                        <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
+                        <div v-else>跟进记录:</div>
+                      </div>
+                      <div v-else>
+                        <div style="word-wrap: break-word; margin: 8px 0">{{ getContent(record) }}</div>
+                      </div>
                       <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
                         <div style="width: 36px">附件:</div>
                         <div style="width: calc(100% - 36px)">
@@ -355,8 +360,13 @@
                     <span>{{ dictValueLabel(record.createUser, userList) }}</span>
                     <span>{{ record.date }}</span>
                   </div>
-                  <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
-                  <div style="margin: 8px 0" v-else>跟进记录:</div>
+                  <div v-if="record.type == '30'">
+                    <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
+                    <div v-else>跟进记录:</div>
+                  </div>
+                  <div v-else>
+                    <div style="word-wrap: break-word; margin: 8px 0">{{ getContent(record) }}</div>
+                  </div>
                   <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
                     <div style="width: 36px">附件:</div>
                     <div style="width: calc(100% - 36px)">
@@ -882,6 +892,12 @@ const openModal = () => {
   formData.data = {
     countryId: "44",
     tags: [],
+    customerUserList: [
+      {
+        name: "",
+        email: "",
+      },
+    ],
   };
   getCityData(formData.data.countryId, "20");
   loadingOperation.value = false;
@@ -1110,8 +1126,15 @@ const getStyle = (val) => {
     return "";
   }
 };
+const getContent = (item) => {
+  if (item.type === "10") {
+    return "跟进记录: " + "报价单总金额 " + proxy.moneyFormat(item.amount, 2);
+  } else if (item.type === "20") {
+    return "跟进记录: " + "合同总金额 " + proxy.moneyFormat(item.amount, 2) + ` (${item.contractCode}) `;
+  }
+};
 const recordShow = (item) => {
-  if (!(item.fileList && item.fileList.length > 0)) {
+  if (!(item.fileList && item.fileList.length > 0) && JSON.stringify(item.fileList) !== "[]") {
     proxy.post("/fileInfo/getList", { businessIdList: [item.id] }).then((fileObj) => {
       item.fileList = fileObj[item.id] || [];
     });

+ 28 - 9
src/views/customer/highseas/index.vue

@@ -163,8 +163,13 @@
                     <div style="width: 100%">
                       <div style="color: #909399; margin: 8px 0">跟进时间: {{ record.date }}</div>
                       <div style="margin: 8px 0">跟进人: {{ dictValueLabel(record.createUser, userList) }}</div>
-                      <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
-                      <div v-else>跟进记录:</div>
+                      <div v-if="record.type == '30'">
+                        <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
+                        <div v-else>跟进记录:</div>
+                      </div>
+                      <div v-else>
+                        <div style="word-wrap: break-word; margin: 8px 0">{{ getContent(record) }}</div>
+                      </div>
                       <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
                         <div style="width: 36px">附件:</div>
                         <div style="width: calc(100% - 36px)">
@@ -347,8 +352,13 @@
                     <span>{{ dictValueLabel(record.createUser, userList) }}</span>
                     <span>{{ record.date }}</span>
                   </div>
-                  <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
-                  <div style="margin: 8px 0" v-else>跟进记录:</div>
+                  <div v-if="record.type == '30'">
+                    <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
+                    <div v-else>跟进记录:</div>
+                  </div>
+                  <div v-else>
+                    <div style="word-wrap: break-word; margin: 8px 0">{{ getContent(record) }}</div>
+                  </div>
                   <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
                     <div style="width: 36px">附件:</div>
                     <div style="width: calc(100% - 36px)">
@@ -459,10 +469,6 @@ const statisticsType = ref([
     label: "客户类型统计",
     value: 2,
   },
-  {
-    label: "业务员统计",
-    value: 3,
-  },
 ]);
 const sourceList = ref({
   data: [],
@@ -793,6 +799,12 @@ const openModal = () => {
   formData.data = {
     countryId: "44",
     tags: [],
+    customerUserList: [
+      {
+        name: "",
+        email: "",
+      },
+    ],
   };
   getCityData(formData.data.countryId, "20");
   loadingOperation.value = false;
@@ -1033,8 +1045,15 @@ const getStyle = (val) => {
     return "";
   }
 };
+const getContent = (item) => {
+  if (item.type === "10") {
+    return "跟进记录: " + "报价单总金额 " + proxy.moneyFormat(item.amount, 2);
+  } else if (item.type === "20") {
+    return "跟进记录: " + "合同总金额 " + proxy.moneyFormat(item.amount, 2) + ` (${item.contractCode}) `;
+  }
+};
 const recordShow = (item) => {
-  if (!(item.fileList && item.fileList.length > 0)) {
+  if (!(item.fileList && item.fileList.length > 0) && JSON.stringify(item.fileList) !== "[]") {
     proxy.post("/fileInfo/getList", { businessIdList: [item.id] }).then((fileObj) => {
       item.fileList = fileObj[item.id] || [];
     });

+ 28 - 9
src/views/customer/privatesea/index.vue

@@ -163,8 +163,13 @@
                     <div style="width: 100%">
                       <div style="color: #909399; margin: 8px 0">跟进时间: {{ record.date }}</div>
                       <div style="margin: 8px 0">跟进人: {{ dictValueLabel(record.createUser, userList) }}</div>
-                      <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
-                      <div v-else>跟进记录:</div>
+                      <div v-if="record.type == '30'">
+                        <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
+                        <div v-else>跟进记录:</div>
+                      </div>
+                      <div v-else>
+                        <div style="word-wrap: break-word; margin: 8px 0">{{ getContent(record) }}</div>
+                      </div>
                       <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
                         <div style="width: 36px">附件:</div>
                         <div style="width: calc(100% - 36px)">
@@ -347,8 +352,13 @@
                     <span>{{ dictValueLabel(record.createUser, userList) }}</span>
                     <span>{{ record.date }}</span>
                   </div>
-                  <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
-                  <div style="margin: 8px 0" v-else>跟进记录:</div>
+                  <div v-if="record.type == '30'">
+                    <div style="word-wrap: break-word; margin: 8px 0" v-html="getStyle(record.content)" v-if="record.content"></div>
+                    <div v-else>跟进记录:</div>
+                  </div>
+                  <div v-else>
+                    <div style="word-wrap: break-word; margin: 8px 0">{{ getContent(record) }}</div>
+                  </div>
                   <div style="margin: 8px 0; display: flex" v-if="record.fileList && record.fileList.length > 0">
                     <div style="width: 36px">附件:</div>
                     <div style="width: calc(100% - 36px)">
@@ -460,10 +470,6 @@ const statisticsType = ref([
     label: "客户类型统计",
     value: 2,
   },
-  {
-    label: "业务员统计",
-    value: 3,
-  },
 ]);
 const sourceList = ref({
   data: [],
@@ -794,6 +800,12 @@ const openModal = () => {
     countryId: "44",
     userId: useUserStore().user.userId,
     tags: [],
+    customerUserList: [
+      {
+        name: "",
+        email: "",
+      },
+    ],
   };
   getCityData(formData.data.countryId, "20");
   loadingOperation.value = false;
@@ -1034,8 +1046,15 @@ const getStyle = (val) => {
     return "";
   }
 };
+const getContent = (item) => {
+  if (item.type === "10") {
+    return "跟进记录: " + "报价单总金额 " + proxy.moneyFormat(item.amount, 2);
+  } else if (item.type === "20") {
+    return "跟进记录: " + "合同总金额 " + proxy.moneyFormat(item.amount, 2) + ` (${item.contractCode}) `;
+  }
+};
 const recordShow = (item) => {
-  if (!(item.fileList && item.fileList.length > 0)) {
+  if (!(item.fileList && item.fileList.length > 0) && JSON.stringify(item.fileList) !== "[]") {
     proxy.post("/fileInfo/getList", { businessIdList: [item.id] }).then((fileObj) => {
       item.fileList = fileObj[item.id] || [];
     });

+ 171 - 54
src/views/finance/fundManage/accountPayment/index.vue

@@ -9,7 +9,6 @@
         highlight-current-row
         :selectConfig="selectConfig"
         :table-events="{
-          //element talbe事件都能传
           select: select,
         }"
         :action-list="[]"
@@ -22,30 +21,30 @@
         </template>
       </byTable>
     </div>
-    <el-dialog :title="modalType == 'add' ? '打款' : '打款'" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
+    <el-dialog title="打款" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
-        <template #productPic>
-          <div>
+        <template #fileSlot>
+          <div style="width: 100%">
             <el-upload
               v-model:fileList="fileList"
               action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
               :data="uploadData"
-              list-type="picture-card"
-              :on-remove="handleRemove"
-              :before-upload="handleBeforeUpload">
-              <el-icon><Plus /></el-icon>
+              multiple
+              :before-upload="uploadFile"
+              :on-preview="onPreviewFile">
+              <el-button type="primary">文件上传</el-button>
             </el-upload>
           </div>
         </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading"> 确 定 </el-button>
+        <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading"> 确 定 </el-button>
       </template>
     </el-dialog>
 
     <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
-      <byForm :formConfig="formSearchConfig" :formOption="formOption" v-model="sourceList.pagination">
+      <byForm :formConfig="formSearchConfig" :formOption="formOptionTwo" v-model="sourceList.pagination">
         <template #departmentId>
           <div>
             <el-tree-select
@@ -147,11 +146,30 @@
         <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="冲销" v-if="openCancelledOut" v-model="openCancelledOut" width="500">
+      <byForm
+        :formConfig="formCancelledOutConfig"
+        :formOption="formOptionTwo"
+        v-model="formCancelledOutData.data"
+        :rules="rulesCancelledOut"
+        ref="cancelledOut">
+        <template #detail>
+          <div style="width: 100%">
+            <el-button type="primary" style="margin-left: -15px" @click="clickDetail" text>查看详情</el-button>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openCancelledOut = false" size="large">取 消</el-button>
+        <el-button type="danger" @click="submitCancelledOutForm()" size="large" :loading="submitCancelledOutLoading">冲 销</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import { ElMessage } from "element-plus";
+import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, ref } from "vue";
@@ -185,7 +203,6 @@ const sourceList = ref({
   },
 });
 let dialogVisible = ref(false);
-let modalType = ref("add");
 let rules = ref({
   productClassifyId: [{ required: true, message: "请选择物料分类", trigger: "change" }],
   type: [{ required: true, message: "请选择物料类型", trigger: "change" }],
@@ -292,6 +309,43 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
+          row.status == "20"
+            ? {
+                attrs: {
+                  label: "打款",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  formOption.disabled = false;
+                  getDtl(row);
+                },
+              }
+            : {
+                attrs: {
+                  label: "冲销",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click(item) {
+                  ElMessageBox.confirm("冲销后,已生成的资金流水数据会被删除,且关联的数据状态会由“已打款”退回至“未打款”,并支持重新打款。是否继续?", "提示", {
+                    confirmButtonText: "继续",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  })
+                    .then(() => {
+                      rowData.value = item;
+                      formCancelledOutData.data = {
+                        accountPaymentId: item.id,
+                        remark: "",
+                      };
+                      openCancelledOut.value = true;
+                    })
+                    .catch(() => {});
+                },
+              },
           {
             attrs: {
               label: "打印",
@@ -305,18 +359,6 @@ const config = computed(() => {
           },
           {
             attrs: {
-              label: "打款",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              formOption.disabled = false;
-              getDtl(row);
-            },
-          },
-          {
-            attrs: {
               label: "查看",
               type: "primary",
               text: true,
@@ -334,7 +376,9 @@ const config = computed(() => {
 });
 
 let formData = reactive({
-  data: {},
+  data: {
+    fileList: [],
+  },
 });
 const formOption = reactive({
   inline: true,
@@ -343,6 +387,13 @@ const formOption = reactive({
   rules: [],
   disabled: false,
 });
+const formOptionTwo = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+  disabled: false,
+});
 const byform = ref(null);
 const treeListData = ref([]);
 const formConfig = computed(() => {
@@ -436,8 +487,27 @@ const formConfig = computed(() => {
       label: "摘要",
       itemType: "textarea",
     },
+    {
+      type: "slot",
+      label: "上传附件",
+      prop: "fileList",
+      slotName: "fileSlot",
+    },
   ];
 });
+const fileList = ref([]);
+const uploadData = ref({});
+const uploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  return true;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
 const recursive = (data) => {
   data.map((item) => {
     item.label = item.deptName;
@@ -538,8 +608,6 @@ const getList = async (req) => {
     }, 200);
   });
 };
-const uploadData = ref({});
-const fileList = ref([]);
 const paymentType = ref([
   {
     label: "已打款",
@@ -550,19 +618,28 @@ const paymentType = ref([
     value: 20,
   },
 ]);
-const fileListCopy = ref([]);
 const selection = ref({
   data: [],
 });
 const select = (_selection, row) => {
   selection.value.data = _selection;
 };
-
 const submitForm = () => {
-  byform.value.handleSubmit((valid) => {
+  byform.value.handleSubmit(() => {
+    if (fileList.value && fileList.value.length > 0) {
+      formData.data.fileList = fileList.value.map((item) => {
+        return {
+          id: item.raw.id,
+          fileName: item.raw.fileName,
+          fileUrl: item.raw.fileUrl,
+        };
+      });
+    } else {
+      formData.data.fileList = [];
+    }
     submitLoading.value = true;
     proxy.post("/accountPayment/add", formData.data).then(
-      (res) => {
+      () => {
         ElMessage({
           message: "打款成功",
           type: "success",
@@ -571,13 +648,12 @@ const submitForm = () => {
         submitLoading.value = false;
         getList();
       },
-      (err) => {
+      () => {
         submitLoading.value = false;
       }
     );
   });
 };
-
 const getTreeList = () => {
   proxy
     .post("/productClassify/tree", {
@@ -590,35 +666,29 @@ const getTreeList = () => {
       formConfig.value[0].data = message;
     });
 };
-
 const getDtl = (row) => {
-  modalType.value = "edit";
   proxy.post("/accountPayment/detail", { id: row.id }).then((res) => {
     formData.data = res;
     formData.data.expensesTime = moment().format("yyyy-MM-DD HH:mm:ss");
+    proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((fileObj) => {
+      formData.data.fileList = fileObj[row.id] || [];
+      if (formData.data.fileList && formData.data.fileList.length > 0) {
+        fileList.value = formData.data.fileList.map((item) => {
+          return {
+            raw: item,
+            name: item.fileName,
+            url: item.fileUrl,
+          };
+        });
+      } else {
+        fileList.value = [];
+      }
+    });
     dialogVisible.value = true;
   });
 };
 getTreeList();
 getList();
-const handleBeforeUpload = async (file) => {
-  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
-  uploadData.value = res.uploadBody;
-  fileListCopy.value.push({
-    id: res.id,
-    fileName: res.fileName,
-    path: res.fileUrl,
-    url: res.fileUrl,
-    uid: file.uid,
-  });
-};
-const handleRemove = (file) => {
-  const index = fileListCopy.value.findIndex((x) => x.uid === file.uid || x.id === file.id);
-  fileListCopy.value.splice(index, 1);
-};
-const handleClickFile = (file) => {
-  window.open(file.fileUrl, "_blank");
-};
 const openSearch = ref(false);
 const formSearchConfig = computed(() => {
   return [
@@ -717,7 +787,7 @@ const submitSearch = () => {
     return ElMessage("开始时间不能大于结束时间");
   }
   openSearch.value = false;
-  sourceList.value.pagination.keyword = '';
+  sourceList.value.pagination.keyword = "";
   sourceList.value.pagination.pageNum = 1;
   getList();
 };
@@ -737,6 +807,53 @@ const clickDownload = () => {
     proxy.getPdf("采购付款PDF文件");
   }
 };
+let formCancelledOutData = reactive({
+  data: {},
+});
+const cancelledOut = ref(null);
+const formCancelledOutConfig = computed(() => {
+  return [
+    {
+      type: "slot",
+      label: "打款明细",
+      slotName: "detail",
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remark",
+      label: "冲销原因",
+    },
+  ];
+});
+let rulesCancelledOut = ref({
+  remark: [{ required: true, message: "请输入冲销原因", trigger: "blur" }],
+});
+const openCancelledOut = ref(false);
+const submitCancelledOutLoading = ref(false);
+const submitCancelledOutForm = () => {
+  cancelledOut.value.handleSubmit(() => {
+    submitCancelledOutLoading.value = true;
+    proxy.post("/writeOffRecords/add", formCancelledOutData.data).then(
+      () => {
+        ElMessage({
+          message: "冲销完成",
+          type: "success",
+        });
+        openCancelledOut.value = false;
+        submitCancelledOutLoading.value = false;
+        getList();
+      },
+      () => {
+        submitCancelledOutLoading.value = false;
+      }
+    );
+  });
+};
+const clickDetail = () => {
+  formOption.disabled = true;
+  getDtl(rowData.value);
+};
 </script>
 
 <style lang="scss" scoped>

+ 195 - 0
src/views/finance/fundManage/offsetRecord/index.vue

@@ -0,0 +1,195 @@
+<template>
+  <div class="tenant">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      :selectConfig="selectConfig"
+      highlight-current-row
+      @get-list="getList">
+      <template #amount="{ item }">
+        <div>
+          <span style="padding-right: 4px">{{ item.currency }}</span>
+          <span>{{ moneyFormat(item.amount, 2) }}</span>
+        </div>
+      </template>
+      <template #contractCodes="{ item }">
+        <div>
+          <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickPrint(item)">{{ item.contractCodes }}</a>
+        </div>
+      </template>
+    </byTable>
+
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
+      <FundsPDF v-if="rowData.type != '20'" :rowData="rowData"></FundsPDF>
+      <PaymentPDF v-else :rowData="rowData"></PaymentPDF>
+      <template #footer>
+        <el-button @click="openPrint = false" size="large">取消</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import FundsPDF from "@/components/PDF/fundsPDF.vue";
+import PaymentPDF from "@/components/PDF/paymentPDF.vue";
+
+const { proxy } = getCurrentInstance();
+const corporationList = ref([]);
+const fundsType = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    corporationId: "",
+    type: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "归属公司",
+      prop: "corporationId",
+      data: corporationList.value,
+    },
+    {
+      label: "数据来源",
+      prop: "type",
+      data: fundsType.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "归属公司",
+        prop: "corporationName",
+        "min-width": 220,
+      },
+    },
+    {
+      attrs: {
+        label: "数据来源",
+        prop: "type",
+        "min-width": 130,
+      },
+      render(type) {
+        if (type != 20) {
+          return "请款: " + proxy.dictValueLabel(type, fundsType.value);
+        } else {
+          return "采购付款";
+        }
+      },
+    },
+    {
+      attrs: {
+        label: "关联单号",
+        slot: "contractCodes",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "申请时间",
+        prop: "applicationTime",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "申请金额",
+        slot: "amount",
+        align: "right",
+        "min-width": 120,
+      },
+    },
+    {
+      attrs: {
+        label: "打款时间",
+        prop: "accountPaymentDate",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "冲销人",
+        prop: "writeOffUserName",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "冲销时间",
+        prop: "createTime",
+        "min-width": 160,
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy.getDictOne(["founds_type"]).then((res) => {
+    fundsType.value = res["founds_type"]
+      .map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }))
+      .concat({
+        label: "采购付款",
+        value: "20",
+      });
+  });
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      corporationList.value = res.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/writeOffRecords/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+getList();
+const openPrint = ref(false);
+const rowData = ref({});
+const clickPrint = (row) => {
+  rowData.value = {
+    id: row.businessId,
+    type: row.type,
+  };
+  openPrint.value = true;
+};
+const clickDownload = () => {
+  if (rowData.value.type != "20") {
+    proxy.getPdf("请款PDF文件");
+  } else {
+    proxy.getPdf("采购付款PDF文件");
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 11 - 5
src/views/index.vue

@@ -3,14 +3,14 @@
 		
 		<div class="stat-warp">
 			<ul>
-				<li class="theme1">
+				<li class="theme1" @click="toUrl('DealWith',1)">
 					<div class="num">{{toBeProcessedData.total}}</div>
 					<div class="label">我的待审批</div>
 					<div class="icon-box">
 						<i class="icon iconfont icon-iconm_waixht"></i>
 					</div>
 				</li>
-				<li class="theme2">
+				<li class="theme2" @click="toUrl('DealWith',2)">
 					<div class="num">{{haveInitiatedData.total}}</div>
 					<div class="label">我的发起(未结束)</div>
 					<div class="icon-box">
@@ -44,7 +44,7 @@
 								size="small"
 								@click="pushProcessApproval(scope.row)"
 							>
-								查看
+								审批
 							</el-button>
 						</template>
 					</el-table-column>
@@ -167,14 +167,19 @@ const getData = (() => {
 	}).then(res=>{
 		haveInitiatedData.value = res
 	})
-	proxy.post('sendMeg/page',{
+	proxy.post('pushAnnouncement/page',{
 		pageNum:1,
 		pageSize:3,
 	}).then(res=>{
 		sendMegData.value = res
 	})
-	
 })
+const toUrl = (name,type) => {
+	//获取name为name的路由的基础信息
+	const route = proxy.$router.resolve({ name: name, params: {  } })
+	console.log(route)
+	proxy.$router.push(route.path + '?type=' + type)
+}
 getData()
 // ​
 onMounted(() => {})
@@ -280,6 +285,7 @@ onMounted(() => {})
 				color: #333333;
 				position: relative;
 				border-radius: 10px;
+				cursor: pointer;
 				.label {
 					font-size: 14px;
 					margin-top: 10px;

+ 6 - 2
src/views/process/dealWith/index.vue

@@ -51,7 +51,7 @@
 	</div>
 </template>
     
-  <script setup>
+  <script setup name="DealWith">
 /* eslint-disable vue/no-unused-components */
 import { ElMessage, ElMessageBox } from 'element-plus'
 import byTable from '@/components/byTable/index'
@@ -346,8 +346,12 @@ const changeStatus = (row) => {
 			getList()
 		})
 }
+onMounted(() => {
+	const route = useRoute();
+	sourceList.value.pagination.status = route.query.type ? route.query.type : 1
+	getList()
+})
 
-getList()
 </script>
     
   <style lang="scss" scoped>

+ 8 - 8
src/views/publicModule/companyConfig/index.vue

@@ -35,15 +35,15 @@
           </div>
         </template>
         <template #allAddress>
-          <el-row style="width: 100%">
-            <el-col :span="8">
+          <el-row style="width: 100%;display: flex;justify-content: space-between;">
+            <el-col :span="7">
               <el-form-item prop="countryId">
                 <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
                   <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="7">
               <el-form-item prop="provinceName">
                 <selectCity
                   placeholder="省/洲"
@@ -55,7 +55,7 @@
                 </selectCity>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="7">
               <el-form-item prop="cityName">
                 <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
               </el-form-item>
@@ -70,18 +70,18 @@
           </el-row>
         </template>
         <template #allAddressEnglish>
-          <el-row style="width: 100%">
-            <el-col :span="8">
+          <el-row style="width: 100%;display: flex;justify-content: space-between;">
+            <el-col :span="7">
               <el-form-item prop="countryEnStr">
                 <el-input v-model="formData.data.countryEnStr" placeholder="请输入国家 (英文)" />
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="7">
               <el-form-item prop="provinceEnStr">
                 <el-input v-model="formData.data.provinceEnStr" placeholder="请输入省/洲 (英文)" />
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="7">
               <el-form-item prop="cityEnStr">
                 <el-input v-model="formData.data.cityEnStr" placeholder="请输入城市 (英文)" />
               </el-form-item>

+ 126 - 1
src/views/purchaseManage/purchaseManage/alreadyPurchase/index.vue

@@ -8,6 +8,7 @@
         :config="config"
         :loading="loading"
         highlight-current-row
+        :statConfig="statConfig"
         :selectConfig="selectConfig"
         :table-events="{
           //element talbe事件都能传
@@ -28,6 +29,14 @@
             {{ item.code }}
           </div>
         </template>
+        <template #contractCode="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickcontractCode(item)"
+          >
+            {{ item.contractCode }}
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog
@@ -396,6 +405,94 @@ const paymentStatus = ref([
     value: "20",
   },
 ]);
+const headerData = ref({
+  sumOrderCount: 0,
+  sumPurchaseMoney: 0,
+  noArrivalOrderCount: 0,
+  noArrivalPurchaseMoney: 0,
+  partArrivalOrderCount: 0,
+  partArrivalPurchaseMoney: 0,
+  alArrivalPurchaseMoney: 0,
+  alArrivalOrderCount: 0,
+});
+const getHeaderData = () => {
+  proxy.post("/purchase/statisticsPurchaseHead").then((res) => {
+    headerData.value = res;
+  });
+};
+
+const statConfig = computed(() => [
+  {
+    label: "统计",
+    data: [
+      //一个卡牌多数据配置
+      {
+        label: "合计",
+        type: 2,
+        data: [
+          {
+            label: "订单数",
+            num: headerData.value.sumOrderCount,
+            color: "#C280FF",
+          },
+          {
+            label: "采购金额",
+            num: proxy.moneyFormat(headerData.value.sumPurchaseMoney, 2),
+            color: "#C280FF",
+          },
+        ],
+      },
+      {
+        label: "未到货",
+        data: [
+          {
+            label: "订单数",
+            num: headerData.value.noArrivalOrderCount,
+            color: "#0084FF",
+          },
+          {
+            label: "采购金额",
+            num: proxy.moneyFormat(headerData.value.noArrivalPurchaseMoney, 2),
+            color: "#0084FF",
+          },
+        ],
+      },
+      {
+        label: "部分到货",
+        data: [
+          {
+            label: "订单数",
+            num: headerData.value.partArrivalOrderCount,
+            color: "#0084FF",
+          },
+          {
+            label: "采购金额",
+            num: proxy.moneyFormat(
+              headerData.value.partArrivalPurchaseMoney,
+              2
+            ),
+            color: "#0084FF",
+          },
+        ],
+      },
+      {
+        label: "已到货",
+        data: [
+          {
+            label: "订单数",
+            num: headerData.value.alArrivalOrderCount,
+            color: "#0084FF",
+          },
+          {
+            label: "采购金额",
+            num: proxy.moneyFormat(headerData.value.alArrivalPurchaseMoney, 2),
+            color: "#0084FF",
+          },
+        ],
+      },
+    ],
+  },
+]);
 const selectConfig = reactive([
   {
     label: "采购状态",
@@ -424,6 +521,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "关联销售合同",
+        prop: "contractCode",
+        slot: "contractCode",
+      },
+    },
+    {
+      attrs: {
         label: "供应商",
         prop: "supplyName",
       },
@@ -441,6 +545,16 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "已付款金额(CNY)",
+        prop: "paySumAmount",
+        width: 160,
+      },
+      render(amount) {
+        return proxy.moneyFormat(amount, 2);
+      },
+    },
+    {
+      attrs: {
         label: "采购人",
         prop: "purchaseName",
       },
@@ -738,8 +852,10 @@ const handleArrival = (row) => {
   });
 };
 
-getList();
 getDict();
+getHeaderData();
+getList();
+
 const start = () => {
   proxy.$router.replace({
     path: "/platform_manage/process/processApproval",
@@ -763,6 +879,15 @@ const handleClickCode = (row) => {
   });
 };
 
+const handleClickcontractCode = (row) => {
+  proxy.$router.push({
+    name: "Contract",
+    query: {
+      code: row.contractCode,
+    },
+  });
+};
+
 const openPdf = ref(false);
 const pdfData = ref({});
 const rowData = ref({});

+ 7 - 0
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -382,6 +382,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "已发起数量",
+        prop: "startPurchaseCount",
+        width: "110",
+      },
+    },
+    {
+      attrs: {
         label: "待处理数量",
         prop: "expendQuantity",
         width: "110",

+ 60 - 35
src/views/salesMange/saleContract/contract/index.vue

@@ -15,15 +15,6 @@
           },
         ]"
         @get-list="getList">
-        <!-- <template #code="{ item }">
-          <div style="width: 100%">
-            <a
-              style="color: #409eff; cursor: pointer; word-break: break-all"
-              @click="pushProcessApproval(item)"
-              >{{ item.code }}</a
-            >
-          </div>
-        </template> -->
         <template #code="{ item }">
           <div style="width: 100%">
             <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(item)">{{ item.code }}</a>
@@ -37,14 +28,30 @@
         </template>
         <template #amountCNY="{ item }">
           <div>
-            <!-- <span style="padding-right: 4px">{{ item.currency }}</span> -->
             <span>{{ moneyFormat(item.amountCNY, 2) }}</span>
           </div>
         </template>
         <template #sumClaimMoney="{ item }">
           <div>
-            <!-- <span style="padding-right: 4px">{{ item.currency }}</span> -->
-            <span>{{ moneyFormat(item.sumClaimMoney, 2) }}</span>
+            <el-popover :width="400" trigger="hover" @show="recordShow(item)">
+              <template #reference>
+                <a style="color: #409eff; cursor: pointer; word-break: break-all">{{ moneyFormat(item.sumClaimMoney, 2) }}</a>
+              </template>
+              <template #default>
+                <div style="width: 100%; max-height: 60vh; overflow-y: auto; overflow-x: hidden" v-if="item.claimRecord && item.claimRecord.length > 0">
+                  <div v-for="(record, index) in item.claimRecord" :key="index" style="margin-bottom: 20px">
+                    <div style="display: flex; justify-content: space-between">
+                      <span style="color: #909399">{{ record.createTime }}</span>
+                      <span style="color: #909399">{{ dictValueLabel(record.createUser, userList) }}</span>
+                    </div>
+                    <div style="display: flex; justify-content: space-between; padding: 8px 0">
+                      <span>认领金额: {{ record.currency }} {{ record.money }}</span>
+                      <span>汇率: {{ item.rate }}</span>
+                    </div>
+                  </div>
+                </div>
+              </template>
+            </el-popover>
           </div>
         </template>
         <template #scale="{ item }">
@@ -65,6 +72,11 @@
             <span :style="getStyle(item.status)">{{ dictValueLabel(item.status, status) }}</span>
           </div>
         </template>
+        <template #buyCorporationId="{ item }">
+          <div style="cursor: pointer; color: #409eff; word-break: break-all" @click="handleClickName(item)">
+            {{ item.buyCorporationName }}
+          </div>
+        </template>
       </byTable>
     </div>
 
@@ -184,7 +196,7 @@ const config = computed(() => {
       attrs: {
         label: "合同类型",
         prop: "contractType",
-        width: 120,
+        width: 100,
       },
       render(type) {
         return proxy.dictValueLabel(type, contractType.value);
@@ -194,31 +206,29 @@ const config = computed(() => {
       attrs: {
         label: "合同编码",
         slot: "code",
-        width: 180,
+        width: 160,
       },
     },
     {
       attrs: {
         label: "客户",
-        prop: "buyCorporationId",
+        slot: "buyCorporationId",
         "min-width": 180,
       },
-      render(type) {
-        return proxy.dictValueLabel(type, customerList.value);
-      },
     },
-    // {
-    //   attrs: {
-    //     label: "版本号",
-    //     prop: "version",
-    //     width: 80,
-    //   },
-    // },
     {
       attrs: {
         label: "合同金额",
         slot: "amount",
-        width: 120,
+        width: 140,
+        align: "right",
+      },
+    },
+    {
+      attrs: {
+        label: "合同汇率",
+        prop: "rate",
+        width: 100,
       },
     },
     {
@@ -226,6 +236,7 @@ const config = computed(() => {
         label: "合同金额(CNY)",
         slot: "amountCNY",
         width: 120,
+        align: "right",
       },
     },
     {
@@ -233,6 +244,7 @@ const config = computed(() => {
         label: "已到账金额(CNY)",
         slot: "sumClaimMoney",
         width: 140,
+        align: "right",
       },
     },
     {
@@ -353,15 +365,11 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              ElMessageBox.confirm(
-                "此操作将作废该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
+              ElMessageBox.confirm("此操作将作废该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
                 proxy
                   .post("/contract/edit", {
                     id: row.id,
@@ -596,6 +604,23 @@ const getStyle = (status) => {
     return {};
   }
 };
+const handleClickName = (row) => {
+  proxy.$router.push({
+    path: "/ERP/customer/portrait",
+    query: {
+      id: row.buyCorporationId,
+    },
+  });
+};
+const recordShow = (item) => {
+  if (!(item.claimRecord && item.claimRecord.length > 0)) {
+    proxy.post("/claimContract/getListByContractIds", [item.id]).then((res) => {
+      if (res && res.length > 0) {
+        item.claimRecord = res;
+      }
+    });
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 3 - 2
src/views/system/langConfig/index.vue

@@ -39,7 +39,6 @@
 				:formConfig="formConfig"
 				:formOption="formOption"
 				v-model="formData.data"
-				:rules="rules"
 				ref="byform"
 			>
 			</byForm>
@@ -205,13 +204,14 @@ const submitData = ref('')
 const getList = async (req) => {
 	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
 	console.log(sourceList.value.pagination.type)
-	loading.value = false
+	loading.value = true
 	proxy
 		.get('/open/multilingual/getJson', {})
 		.then((message) => {
 			if (message.data) {
 				submitData.value = JSON.parse(message.data)
 				const res = JSON.parse(message.data)
+				console.log(res)
 				const tableData = getAllKeys(res.app.cn)
 				console.log(tableData)
 				//根据key获取res里其他语言的值
@@ -221,6 +221,7 @@ const getList = async (req) => {
 				}
 				sourceList.value.data = tableData
 			}
+			loading.value = false
 			// proxy.post('/open/multilingual/setJson',{configValue:JSON.stringify(res)}).then((message) => {
 			// })
 		})

+ 16 - 25
src/views/system/msg/index.vue

@@ -229,7 +229,7 @@ const getDict = () => {
 const getList = async (req) => {
 	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
 	loading.value = true
-	proxy.post('/sendMeg/page', sourceList.value.pagination).then((res) => {
+	proxy.post('/pushAnnouncement/page', sourceList.value.pagination).then((res) => {
 		sourceList.value.data = res.rows
 		sourceList.value.pagination.total = res.total
 		setTimeout(() => {
@@ -256,20 +256,20 @@ const formOption = reactive({
 })
 const formConfig = computed(() => {
 	return [
-		{
-			label: '基础信息',
-		},
-		{
-			type: 'select',
-			prop: 'type',
-			label: '消息类型',
-            data: [
-				{
-					label: '系统公告',
-					value: '1',
-				},
-			],
-		},
+		// {
+		// 	label: '基础信息',
+		// },
+		// {
+		// 	type: 'select',
+		// 	prop: 'type',
+		// 	label: '消息类型',
+        //     data: [
+		// 		{
+		// 			label: '系统公告',
+		// 			value: '1',
+		// 		},
+		// 	],
+		// },
 		{
 			type: 'input',
 			prop: 'title',
@@ -325,7 +325,7 @@ const openModal = () => {
 const submitForm = () => {
 	submit.value.handleSubmit(() => {
 		loadingOperation.value = true
-		proxy.post('/sendMeg/' + modalType.value, formData.data).then(
+		proxy.post('/pushAnnouncement/' + modalType.value, formData.data).then(
 			() => {
 				ElMessage({
 					message: modalType.value == 'add' ? '添加成功' : '编辑成功',
@@ -341,15 +341,6 @@ const submitForm = () => {
 		)
 	})
 }
-const update = (row) => {
-	modalType.value = 'edit'
-	loadingOperation.value = true
-	proxy.post('/contractTemplate/detail', { id: row.id }).then((res) => {
-		formData.data = res
-		loadingOperation.value = false
-		dialogVisible.value = true
-	})
-}
 </script>
 
 <style lang="scss" scoped>