index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <div class="tenant">
  3. <byTable :hideTable="true" :hidePagination="true" :source="sourceList.data" :pagination="sourceList.pagination" :config="config"
  4. 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="140" fixed />
  11. <el-table-column label="统计" fixed>
  12. <el-table-column label="收入合计" prop="incomeAmount" width="140" />
  13. <el-table-column label="支出合计" prop="expenditureAmount" width="140" />
  14. <el-table-column label="毛利" prop="gross" width="140" />
  15. <el-table-column label="毛利率" width="140">
  16. <template #default="{ row }">
  17. <div>{{ row.grossRate }}%</div>
  18. </template>
  19. </el-table-column>
  20. </el-table-column>
  21. <el-table-column label="合同金额" width="140">
  22. <template #default="{ row }">
  23. <div>{{ row.amount }}</div>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="收入">
  27. <el-table-column label="到账金额" prop="sumClaimMoney" width="140" />
  28. <el-table-column label="退税金额" prop="refundableAmount" width="140" />
  29. <el-table-column label="其他收入" prop="otherIncomeAmount" width="140" />
  30. </el-table-column>
  31. <el-table-column label="采购合同金额" prop="sumPurchaseContractMoney" width="140" />
  32. <el-table-column label="支出">
  33. <el-table-column label="已付货款" prop="accountPaid" width="140" />
  34. <el-table-column label="代理费" prop="agencyFee" width="140" />
  35. <el-table-column label="拖车费" prop="trailerFee" width="140" />
  36. <el-table-column label="报关费" prop="customsFee" width="140" />
  37. <el-table-column label="港杂费" prop="portMixedFee" width="140" />
  38. <el-table-column label="验货红包" prop="inspectionRedPack" width="140" />
  39. <el-table-column label="佣金" prop="commission" width="140" />
  40. <el-table-column label="检测费" prop="checkout" width="140" />
  41. <el-table-column label="验货费" prop="inspectionCharge" width="140" />
  42. <el-table-column label="运费" prop="freight" width="140" />
  43. <el-table-column label="产地证费" prop="certificateOfOrigin" width="140" />
  44. <el-table-column label="其他" prop="other" width="140" />
  45. </el-table-column>
  46. <el-table-column label="备注" prop="remark" width="200" />
  47. <el-table-column label="操作" align="center" width="120" fixed="right">
  48. <template #default="{ row }">
  49. <div>
  50. <el-button type="primary" @click="changeAgencyFee(row)" link>代理费</el-button>
  51. <el-button type="primary" @click="changeRemark(row)" link>备注</el-button>
  52. </div>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. <el-row style="padding: 20px" justify="end" type="flex">
  57. <el-pagination background layout="total, sizes, prev, pager, next, jumper" :current-page="sourceList.pagination.pageNum"
  58. :page-size="sourceList.pagination.pageSize" :total="sourceList.pagination.total" @size-change="handleSizeChange"
  59. @current-change="handlePageChange" />
  60. </el-row>
  61. </div>
  62. <el-dialog title="代理费" v-if="openAgencyFee" v-model="openAgencyFee" width="400">
  63. <byForm :formConfig="formAgencyFeeConfig" :formOption="formOption" v-model="formAgencyFeeData.data" ref="agencyFee">
  64. <template #agencyFee>
  65. <div style="width: 100%">
  66. <el-form-item label="代理费" prop="agencyFee">
  67. <el-input-number onmousewheel="return false;" v-model="formAgencyFeeData.data.agencyFee" :precision="2" :controls="false" :min="0" />
  68. </el-form-item>
  69. </div>
  70. </template>
  71. </byForm>
  72. <template #footer>
  73. <el-button @click="openAgencyFee = false" size="large">取 消</el-button>
  74. <el-button type="primary" @click="submitAgencyFeeForm()" size="large">确 定</el-button>
  75. </template>
  76. </el-dialog>
  77. <el-dialog title="备注" v-if="openRemark" v-model="openRemark" width="400">
  78. <byForm :formConfig="formRemarkConfig" :formOption="formOption" v-model="formRemarkData.data" ref="remark">
  79. <template #remark>
  80. <div style="width: 100%">
  81. <el-form-item label="备注" prop="remark">
  82. <el-input v-model="formRemarkData.data.remark" :rows="4" type="textarea" />
  83. </el-form-item>
  84. </div>
  85. </template>
  86. </byForm>
  87. <template #footer>
  88. <el-button @click="openRemark = false" size="large">取 消</el-button>
  89. <el-button type="primary" @click="submitRemarkForm()" size="large">确 定</el-button>
  90. </template>
  91. </el-dialog>
  92. <el-dialog :title="'高级检索'" v-model="moreSearchDialog" width="500px" destroy-on-close>
  93. <byForm :formConfig="formSearchConfig" :formOption="formOption" v-model="sourceList.pagination">
  94. </byForm>
  95. <template #footer>
  96. <el-button @click="moreSearchReset" size="large">重置</el-button>
  97. <el-button @click="moreSearchQuery" type="primary" size="large">搜索</el-button>
  98. </template>
  99. </el-dialog>
  100. </div>
  101. </template>
  102. <script setup>
  103. import { computed, ref } from "vue";
  104. import byTable from "@/components/byTable/index";
  105. import byForm from "@/components/byForm/index";
  106. import useUserStore from "@/store/modules/user";
  107. import { ElMessage } from "element-plus";
  108. const { proxy } = getCurrentInstance();
  109. const accountCurrency = ref([]);
  110. const sourceList = ref({
  111. data: [],
  112. pagination: {
  113. total: 0,
  114. pageNum: 1,
  115. pageSize: 10,
  116. keyword: "",
  117. userId: "",
  118. userName: "",
  119. contractCode: "",
  120. customerName: "",
  121. beginTime: "",
  122. endTime: "",
  123. },
  124. });
  125. const loading = ref(false);
  126. const config = computed(() => {
  127. return [];
  128. });
  129. const getDict = () => {
  130. proxy
  131. .post("/dictTenantData/page", {
  132. pageNum: 1,
  133. pageSize: 999,
  134. dictCode: "account_currency",
  135. tenantId: useUserStore().user.tenantId,
  136. })
  137. .then((res) => {
  138. if (res.rows && res.rows.length > 0) {
  139. accountCurrency.value = res.rows.map((item) => {
  140. return {
  141. label: item.dictValue,
  142. value: item.dictKey,
  143. };
  144. });
  145. }
  146. });
  147. };
  148. const getList = async (req) => {
  149. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  150. loading.value = true;
  151. proxy
  152. .post("/contract/getProfitClearingPage", sourceList.value.pagination)
  153. .then((res) => {
  154. sourceList.value.data = res.rows;
  155. sourceList.value.pagination.total = res.total;
  156. setTimeout(() => {
  157. loading.value = false;
  158. }, 200);
  159. });
  160. };
  161. getDict();
  162. getList();
  163. const handleSizeChange = (val) => {
  164. sourceList.value.pagination.pageNum = 1;
  165. sourceList.value.pagination.pageSize = val;
  166. getList();
  167. };
  168. const handlePageChange = (val) => {
  169. sourceList.value.pagination.pageNum = val;
  170. getList();
  171. };
  172. const formOption = reactive({
  173. inline: true,
  174. labelWidth: 100,
  175. itemWidth: 100,
  176. rules: [],
  177. });
  178. const openAgencyFee = ref(false);
  179. const agencyFee = ref(null);
  180. const formAgencyFeeData = reactive({
  181. data: {},
  182. });
  183. const formAgencyFeeConfig = computed(() => {
  184. return [
  185. {
  186. type: "slot",
  187. slotName: "agencyFee",
  188. },
  189. ];
  190. });
  191. const changeAgencyFee = (row) => {
  192. formAgencyFeeData.data = {
  193. id: row.id,
  194. agencyFee: row.agencyFee,
  195. };
  196. openAgencyFee.value = true;
  197. };
  198. const submitAgencyFeeForm = () => {
  199. proxy.post("/contract/edit", formAgencyFeeData.data).then(() => {
  200. ElMessage({
  201. message: "保存成功",
  202. type: "success",
  203. });
  204. openAgencyFee.value = false;
  205. getList();
  206. });
  207. };
  208. const openRemark = ref(false);
  209. const remark = ref(null);
  210. const formRemarkData = reactive({
  211. data: {},
  212. });
  213. const formRemarkConfig = computed(() => {
  214. return [
  215. {
  216. type: "slot",
  217. slotName: "remark",
  218. },
  219. ];
  220. });
  221. const changeRemark = (row) => {
  222. formRemarkData.data = {
  223. id: row.id,
  224. remark: row.remark,
  225. };
  226. openRemark.value = true;
  227. };
  228. const submitRemarkForm = () => {
  229. proxy.post("/contract/edit", formRemarkData.data).then(() => {
  230. ElMessage({
  231. message: "保存成功",
  232. type: "success",
  233. });
  234. openRemark.value = false;
  235. getList();
  236. });
  237. };
  238. const formSearchConfig = computed(() => {
  239. return [
  240. {
  241. type: "input",
  242. label: "业务员",
  243. prop: "userName",
  244. itemWidth: 100,
  245. },
  246. {
  247. type: "input",
  248. label: "合同编号",
  249. prop: "contractCode",
  250. itemWidth: 100,
  251. },
  252. {
  253. type: "input",
  254. label: "客户名称",
  255. prop: "customerName",
  256. itemWidth: 100,
  257. },
  258. {
  259. type: "date",
  260. itemType: "datetime",
  261. label: "合同时间",
  262. prop: "beginTime",
  263. placeholder: "合同开始时间",
  264. itemWidth: 50,
  265. clearable: true,
  266. },
  267. {
  268. type: "date",
  269. itemType: "datetime",
  270. label: " ",
  271. prop: "endTime",
  272. placeholder: "合同结束时间",
  273. itemWidth: 50,
  274. clearable: true,
  275. },
  276. ];
  277. });
  278. const moreSearchDialog = ref(false);
  279. const clickMoreSearch = () => {
  280. moreSearchDialog.value = true;
  281. };
  282. const moreSearchQuery = () => {
  283. moreSearchDialog.value = false;
  284. getList();
  285. };
  286. const moreSearchReset = () => {
  287. sourceList.value.pagination = {
  288. total: 0,
  289. pageNum: sourceList.value.pagination.pageNum,
  290. pageSize: sourceList.value.pagination.pageSize,
  291. keyword: "",
  292. userId: "",
  293. userName: "",
  294. contractCode: "",
  295. customerName: "",
  296. beginTime: "",
  297. endTime: "",
  298. };
  299. moreSearchQuery();
  300. };
  301. </script>
  302. <style lang="scss" scoped>
  303. .tenant {
  304. padding: 20px;
  305. }
  306. ::v-deep(.el-input-number .el-input__inner) {
  307. text-align: left;
  308. }
  309. </style>