index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <div class="tenant">
  3. <byTable :hideTable="true" :hidePagination="true" :source="sourceList.data" :pagination="sourceList.pagination" :config="config"
  4. :selectConfig="selectConfig" highlight-current-row :onMoreSearch="true" @moreSearch="clickMoreSearch" @get-list="getList">
  5. </byTable>
  6. <div style="padding: 0 20px 20px 20px; background-color: white">
  7. <el-table v-loading="loading" :data="sourceList.data">
  8. <el-table-column label="合同编号" prop="code" width="160" fixed />
  9. <el-table-column label="客户名称" prop="customerName" min-width="200" fixed />
  10. <el-table-column label="业务员" prop="userName" width="120" fixed />
  11. <el-table-column label="合同金额" width="120" fixed="">
  12. <template #default="{ row }">
  13. <div>{{ row.currency }} {{ moneyFormat( row.amount,2) }}</div>
  14. </template>
  15. </el-table-column>
  16. <!-- <el-table-column label="是否已结清" width="120" fixed>
  17. <template #default="{ row }">
  18. <div> {{ dictValueLabel(row.isSettled, isSettled) }}</div>
  19. </template>
  20. </el-table-column> -->
  21. <el-table-column label="是否已结清" width="120" fixed>
  22. <template #default="{ row }">
  23. <div>
  24. <span style="padding: 4px" :class="[row.isSettled == 1 ? 'active' : '']">
  25. {{
  26. proxy.dictValueLabel(row.isSettled, isSettled)
  27. }}</span>
  28. </div>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="统计" fixed>
  32. <el-table-column label="收入合计" prop="incomeAmount" width="120">
  33. <template #default="{ row }">
  34. <div> {{ moneyFormat(row.incomeAmount ,2) }}</div>
  35. </template>
  36. </el-table-column>
  37. <el-table-column label="支出合计" prop="expenditureAmount" width="120">
  38. <template #default="{ row }">
  39. <div> {{ moneyFormat(row.expenditureAmount ,2) }}</div>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="毛利" prop="gross" width="120">
  43. <template #default="{ row }">
  44. <div> {{ moneyFormat(row.gross ,2) }}</div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="毛利率" width="120">
  48. <template #default="{ row }">
  49. <div> {{ moneyFormat(row.gross ,2) }}%</div>
  50. </template>
  51. </el-table-column>
  52. </el-table-column>
  53. <el-table-column label="收入">
  54. <el-table-column label="到账金额" prop="sumClaimMoney" width="120">
  55. <template #default="{ row }">
  56. <div> {{ moneyFormat(row.sumClaimMoney ,2) }}</div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="退税金额" prop="refundableAmount" width="120">
  60. <template #default="{ row }">
  61. <div> {{ moneyFormat(row.refundableAmount ,2) }}</div>
  62. </template></el-table-column>
  63. <el-table-column label="其他收入" prop="otherIncomeAmount" width="120">
  64. <template #default="{ row }">
  65. <div> {{ moneyFormat(row.otherIncomeAmount ,2) }}</div>
  66. </template>
  67. </el-table-column>
  68. </el-table-column>
  69. <el-table-column label="采购合同金额" prop="sumPurchaseContractMoney" width="120">
  70. <template #default="{ row }">
  71. <div> {{ moneyFormat(row.sumPurchaseContractMoney ,2) }}</div>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="支出">
  75. <el-table-column label="已付货款" prop="accountPaid" width="120">
  76. <template #default="{ row }">
  77. <div> {{ moneyFormat(row.accountPaid ,2) }}</div>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="代理费" prop="agencyFee" width="120">
  81. <template #default="{ row }">
  82. <div> {{ moneyFormat(row.agencyFee ,2) }}</div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="拖车费" prop="trailerFee" width="120">
  86. <template #default="{ row }">
  87. <div> {{ moneyFormat(row.trailerFee ,2) }}</div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="报关费" prop="customsFee" width="120">
  91. <template #default="{ row }">
  92. <div> {{ moneyFormat(row.customsFee ,2) }}</div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="港杂费" prop="portMixedFee" width="120">
  96. <template #default="{ row }">
  97. <div> {{ moneyFormat(row.portMixedFee ,2) }}</div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="验货红包" prop="inspectionRedPack" width="120">
  101. <template #default="{ row }">
  102. <div> {{ moneyFormat(row.inspectionRedPack ,2) }}</div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="佣金" prop="commission" width="120">
  106. <template #default="{ row }">
  107. <div> {{ moneyFormat(row.commission ,2) }}</div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="检测费" prop="checkout" width="120">
  111. <template #default="{ row }">
  112. <div> {{ moneyFormat(row.checkout ,2) }}</div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="验货费" prop="inspectionCharge" width="120">
  116. <template #default="{ row }">
  117. <div> {{ moneyFormat(row.inspectionCharge ,2) }}</div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="运费" prop="freight" width="120">
  121. <template #default="{ row }">
  122. <div> {{ moneyFormat(row.freight ,2) }}</div>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="产地证费" prop="certificateOfOrigin" width="120">
  126. <template #default="{ row }">
  127. <div> {{ moneyFormat(row.certificateOfOrigin ,2) }}</div>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="其他" prop="other" width="120">
  131. <template #default="{ row }">
  132. <div> {{ moneyFormat(row.other ,2) }}</div>
  133. </template>
  134. </el-table-column>
  135. </el-table-column>
  136. <el-table-column label="备注" prop="remark" width="200" />
  137. <el-table-column label="操作" align="center" width="120" fixed="right">
  138. <template #default="{ row }">
  139. <div>
  140. <el-button type="primary" @click="changeAgencyFee(row)" link>代理费</el-button>
  141. <el-button type="primary" @click="changeRemark(row)" link>备注</el-button>
  142. </div>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. <el-row style="padding: 20px" justify="end" type="flex">
  147. <el-pagination background layout="total, sizes, prev, pager, next, jumper" :current-page="sourceList.pagination.pageNum"
  148. :page-size="sourceList.pagination.pageSize" :total="sourceList.pagination.total" @size-change="handleSizeChange"
  149. @current-change="handlePageChange" />
  150. </el-row>
  151. </div>
  152. <el-dialog title="代理费" v-if="openAgencyFee" v-model="openAgencyFee" width="400">
  153. <byForm :formConfig="formAgencyFeeConfig" :formOption="formOption" v-model="formAgencyFeeData.data" ref="agencyFee">
  154. <template #agencyFee>
  155. <div style="width: 100%">
  156. <el-form-item label="代理费" prop="agencyFee">
  157. <el-input-number onmousewheel="return false;" v-model="formAgencyFeeData.data.agencyFee" :precision="2" :controls="false" :min="0" />
  158. </el-form-item>
  159. </div>
  160. </template>
  161. </byForm>
  162. <template #footer>
  163. <el-button @click="openAgencyFee = false" size="large">取 消</el-button>
  164. <el-button type="primary" @click="submitAgencyFeeForm()" size="large">确 定</el-button>
  165. </template>
  166. </el-dialog>
  167. <el-dialog title="备注" v-if="openRemark" v-model="openRemark" width="400">
  168. <byForm :formConfig="formRemarkConfig" :formOption="formOption" v-model="formRemarkData.data" ref="remark">
  169. <template #remark>
  170. <div style="width: 100%">
  171. <el-form-item label="备注" prop="remark">
  172. <el-input v-model="formRemarkData.data.remark" :rows="4" type="textarea" />
  173. </el-form-item>
  174. </div>
  175. </template>
  176. </byForm>
  177. <template #footer>
  178. <el-button @click="openRemark = false" size="large">取 消</el-button>
  179. <el-button type="primary" @click="submitRemarkForm()" size="large">确 定</el-button>
  180. </template>
  181. </el-dialog>
  182. <el-dialog :title="'高级检索'" v-model="moreSearchDialog" width="500px" destroy-on-close>
  183. <byForm :formConfig="formSearchConfig" :formOption="formOption" v-model="sourceList.pagination">
  184. </byForm>
  185. <template #footer>
  186. <el-button @click="moreSearchReset" size="large">重置</el-button>
  187. <el-button @click="moreSearchQuery" type="primary" size="large">搜索</el-button>
  188. </template>
  189. </el-dialog>
  190. </div>
  191. </template>
  192. <script setup>
  193. import { computed, ref } from "vue";
  194. import byTable from "@/components/byTable/index";
  195. import byForm from "@/components/byForm/index";
  196. import useUserStore from "@/store/modules/user";
  197. import { ElMessage } from "element-plus";
  198. const { proxy } = getCurrentInstance();
  199. const accountCurrency = ref([]);
  200. const sourceList = ref({
  201. data: [],
  202. pagination: {
  203. total: 0,
  204. pageNum: 1,
  205. pageSize: 10,
  206. keyword: "",
  207. userId: "",
  208. userName: "",
  209. contractCode: "",
  210. customerName: "",
  211. beginTime: "",
  212. endTime: "",
  213. },
  214. });
  215. const loading = ref(false);
  216. const isSettled = ref([
  217. {
  218. label: "已结清",
  219. value: "1",
  220. },
  221. {
  222. label: "未结清",
  223. value: "0",
  224. },
  225. ]);
  226. const selectConfig = computed(() => {
  227. return [
  228. {
  229. label: "是否已结清",
  230. prop: "isSettled",
  231. data: isSettled.value,
  232. },
  233. ];
  234. });
  235. const config = computed(() => {
  236. return [];
  237. });
  238. const getDict = () => {
  239. proxy
  240. .post("/dictTenantData/page", {
  241. pageNum: 1,
  242. pageSize: 999,
  243. dictCode: "account_currency",
  244. tenantId: useUserStore().user.tenantId,
  245. })
  246. .then((res) => {
  247. if (res.rows && res.rows.length > 0) {
  248. accountCurrency.value = res.rows.map((item) => {
  249. return {
  250. label: item.dictValue,
  251. value: item.dictKey,
  252. };
  253. });
  254. }
  255. });
  256. };
  257. const getList = async (req) => {
  258. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  259. loading.value = true;
  260. proxy
  261. .post("/contract/getProfitClearingPage", sourceList.value.pagination)
  262. .then((res) => {
  263. sourceList.value.data = res.rows;
  264. sourceList.value.pagination.total = res.total;
  265. setTimeout(() => {
  266. loading.value = false;
  267. }, 200);
  268. });
  269. };
  270. getDict();
  271. getList();
  272. const handleSizeChange = (val) => {
  273. sourceList.value.pagination.pageNum = 1;
  274. sourceList.value.pagination.pageSize = val;
  275. getList();
  276. };
  277. const handlePageChange = (val) => {
  278. sourceList.value.pagination.pageNum = val;
  279. getList();
  280. };
  281. const formOption = reactive({
  282. inline: true,
  283. labelWidth: 100,
  284. itemWidth: 100,
  285. rules: [],
  286. });
  287. const openAgencyFee = ref(false);
  288. const agencyFee = ref(null);
  289. const formAgencyFeeData = reactive({
  290. data: {},
  291. });
  292. const formAgencyFeeConfig = computed(() => {
  293. return [
  294. {
  295. type: "slot",
  296. slotName: "agencyFee",
  297. },
  298. ];
  299. });
  300. const changeAgencyFee = (row) => {
  301. formAgencyFeeData.data = {
  302. id: row.id,
  303. agencyFee: row.agencyFee,
  304. };
  305. openAgencyFee.value = true;
  306. };
  307. const submitAgencyFeeForm = () => {
  308. proxy.post("/contract/edit", formAgencyFeeData.data).then(() => {
  309. ElMessage({
  310. message: "保存成功",
  311. type: "success",
  312. });
  313. openAgencyFee.value = false;
  314. getList();
  315. });
  316. };
  317. const openRemark = ref(false);
  318. const remark = ref(null);
  319. const formRemarkData = reactive({
  320. data: {},
  321. });
  322. const formRemarkConfig = computed(() => {
  323. return [
  324. {
  325. type: "slot",
  326. slotName: "remark",
  327. },
  328. ];
  329. });
  330. const changeRemark = (row) => {
  331. formRemarkData.data = {
  332. id: row.id,
  333. remark: row.remark,
  334. };
  335. openRemark.value = true;
  336. };
  337. const submitRemarkForm = () => {
  338. proxy.post("/contract/edit", formRemarkData.data).then(() => {
  339. ElMessage({
  340. message: "保存成功",
  341. type: "success",
  342. });
  343. openRemark.value = false;
  344. getList();
  345. });
  346. };
  347. const formSearchConfig = computed(() => {
  348. return [
  349. {
  350. type: "input",
  351. label: "业务员",
  352. prop: "userName",
  353. itemWidth: 100,
  354. },
  355. {
  356. type: "input",
  357. label: "合同编号",
  358. prop: "contractCode",
  359. itemWidth: 100,
  360. },
  361. {
  362. type: "input",
  363. label: "客户名称",
  364. prop: "customerName",
  365. itemWidth: 100,
  366. },
  367. {
  368. type: "date",
  369. itemType: "datetime",
  370. label: "合同时间",
  371. prop: "beginTime",
  372. placeholder: "合同开始时间",
  373. itemWidth: 50,
  374. clearable: true,
  375. },
  376. {
  377. type: "date",
  378. itemType: "datetime",
  379. label: " ",
  380. prop: "endTime",
  381. placeholder: "合同结束时间",
  382. itemWidth: 50,
  383. clearable: true,
  384. },
  385. ];
  386. });
  387. const moreSearchDialog = ref(false);
  388. const clickMoreSearch = () => {
  389. moreSearchDialog.value = true;
  390. };
  391. const moreSearchQuery = () => {
  392. moreSearchDialog.value = false;
  393. getList();
  394. };
  395. const moreSearchReset = () => {
  396. sourceList.value.pagination = {
  397. total: 0,
  398. pageNum: sourceList.value.pagination.pageNum,
  399. pageSize: sourceList.value.pagination.pageSize,
  400. keyword: "",
  401. userId: "",
  402. userName: "",
  403. contractCode: "",
  404. customerName: "",
  405. beginTime: "",
  406. endTime: "",
  407. };
  408. moreSearchQuery();
  409. };
  410. </script>
  411. <style lang="scss" scoped>
  412. .tenant {
  413. padding: 20px;
  414. }
  415. ::v-deep(.el-input-number .el-input__inner) {
  416. text-align: left;
  417. }
  418. .active {
  419. background: #a6dd82;
  420. color: #fff;
  421. border-radius: 4px;
  422. }
  423. </style>