list.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
  7. <template slot="left">
  8. <el-input
  9. v-model="listQuery.itemName"
  10. placeholder="项目名称"
  11. clearable
  12. style="margin-left: 20px;width: 320px;float: left;"
  13. >
  14. </el-input>
  15. <el-button
  16. class="filter-item"
  17. style="margin-left: 10px;float: left;"
  18. type="primary"
  19. @click="searchList"
  20. round
  21. >搜索
  22. </el-button>
  23. <el-button
  24. class="filter-item"
  25. style="float: left;"
  26. round
  27. type="warning"
  28. @click="resetSearch()"
  29. >重置
  30. </el-button>
  31. </template>
  32. <parentTable
  33. v-loading="listLoading"
  34. :data="pageData.records"
  35. slot="table"
  36. style="width: 100%;"
  37. >
  38. <el-table-column label="事业部流水号" align="center" width="160">
  39. <template slot-scope="{row}">
  40. <span>{{ row.businessNo }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="项目编号" align="center" width="160">
  44. <template slot-scope="{row}">
  45. <span>{{ row.oaNo }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="项目名称" align="center" width="160">
  49. <template slot-scope="{row}">
  50. <span>{{ row.name }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="客户经理" align="center" width="160">
  54. <template slot-scope="{row}">
  55. <span>{{ row.clientManager }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="委托单位" align="center" width="160">
  59. <template slot-scope="{row}">
  60. <span>{{ row.clientUnit}}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="合同签订时间" align="center" width="160">
  64. <template slot-scope="{row}">
  65. <span>{{ row.signDate}}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="合同金额(元)" align="center" width="160">
  69. <template slot-scope="{row}">
  70. <span>{{ row.amount}}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="已收款金额(元)" align="center" width="160">
  74. <template slot-scope="{row}">
  75. <span style="color: green">{{ row.payedAmount}}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="未收款金额(元)" align="center" width="160">
  79. <template slot-scope="{row}">
  80. <span style="color: red">{{ row.notPayedAmount}}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="操作" align="center" width="250">
  84. <template slot-scope="{row}">
  85. <PermissionButton
  86. menu-code="_views_market_payment_list"
  87. class-name="filter-item"
  88. type="primary"
  89. :page-jump="true"
  90. :page-query="{id: row.id}"
  91. round
  92. size="mini"
  93. />
  94. <PermissionButton
  95. menu-code="_views_market_payment_add"
  96. class-name="filter-item"
  97. type="success"
  98. round
  99. size="mini"
  100. @click="handleAdd(row.id,row.name)"
  101. />
  102. </template>
  103. </el-table-column>
  104. </parentTable>
  105. </y-page-list-layout>
  106. <el-dialog
  107. width="600px"
  108. title="新增回款"
  109. :visible.sync="dialogFormVisible"
  110. :close-on-click-modal="false"
  111. custom-class="paymentDialog"
  112. >
  113. <el-form
  114. ref="dataForm"
  115. v-loading="dialogLoading"
  116. :model="temp"
  117. label-position="right"
  118. label-width="110px"
  119. style="width: 400px; margin-left:50px;"
  120. >
  121. <el-form-item label="项目名称:" prop="itemName">
  122. <el-input v-model="temp.itemName" class="filter-item" readonly disabled/>
  123. </el-form-item>
  124. <el-form-item label="回款名称:" prop="name" :rules="{required: true, message: '请填写回款名称', trigger: 'blur'}">
  125. <el-input v-model="temp.name" class="filter-item"/>
  126. </el-form-item>
  127. <el-form-item label="回款金额:" prop="amount" :rules="{required: true, message: '请填写回款金额', trigger: 'blur'}">
  128. <el-input v-model.number="temp.amount" class="filter-item" type="number">
  129. <i slot="suffix" style="font-size:normal;margin-right: 10px;line-height: 30px">元</i>
  130. </el-input>
  131. </el-form-item>
  132. <el-form-item
  133. label="回款日期:"
  134. prop="paymentDate"
  135. :rules="{required: true, message: '请选择日期', trigger: 'blur'}"
  136. class="filter-item"
  137. >
  138. <el-date-picker
  139. v-model="temp.paymentDate"
  140. type="date"
  141. value-format="yyyy-MM-dd"
  142. style="width: 100%"
  143. placeholder="选择日期"
  144. class="filter-item"
  145. />
  146. </el-form-item>
  147. <el-form-item label="">
  148. <el-button @click="dialogFormVisible = false">
  149. 取消
  150. </el-button>
  151. <el-button type="primary" @click="save()">
  152. 保存
  153. </el-button>
  154. </el-form-item>
  155. </el-form>
  156. </el-dialog>
  157. </div>
  158. </template>
  159. <script>
  160. import YPageListLayout from '@/components/YPageListLayout'
  161. import Breadcrumb from '@/components/Breadcrumb'
  162. import PermissionButton from '@/components/PermissionButton/PermissionButton'
  163. export default {
  164. name: 'ViewsMarketPaymentList',
  165. components: {
  166. Breadcrumb,
  167. YPageListLayout,
  168. PermissionButton,
  169. },
  170. filters: {
  171. statusFilter(status) {
  172. const statusMap = {
  173. published: 'success',
  174. draft: 'info',
  175. deleted: 'danger',
  176. }
  177. return statusMap[status]
  178. },
  179. },
  180. data() {
  181. return {
  182. isDisable:false,
  183. tableKey: 0,
  184. pageData: { records: [] },
  185. total: 20,
  186. listLoading: true,
  187. dialogLoading:false,
  188. dialogFormVisible:false,
  189. listQuery: {
  190. page: 1,
  191. size: 10,
  192. // name: '',
  193. // staffNo: '',
  194. descs: 'id',
  195. itemName:null
  196. },
  197. listQueryKey: 'keyword',
  198. importLoading: false,
  199. temp:{
  200. name:'',
  201. amount:'',
  202. itemName:'',
  203. itemId:''
  204. }
  205. }
  206. },
  207. created() {
  208. const that = this;
  209. that.getList()
  210. },
  211. methods: {
  212. save(){
  213. if (this.temp.itemId){
  214. this.$refs.dataForm.validate(valid => {
  215. if (valid) {
  216. this.$api.payment.add(Object.assign({}, this.temp, {
  217. })).then(res => {
  218. if (res.code === 200) {
  219. this.$notify({
  220. title: '成功',
  221. message: '新增成功',
  222. type: 'success',
  223. duration: 2000
  224. });
  225. this.getList();
  226. this.temp.itemId = null;
  227. this.temp.name = null;
  228. this.temp.amount = null;
  229. this.temp.paymentDate = null;
  230. this.dialogFormVisible = false
  231. }
  232. }).catch(() => {
  233. this.dialogFormVisible = false
  234. })
  235. }
  236. })
  237. }
  238. },
  239. handleAdd(itemId, itemName) {
  240. const that = this;
  241. that.temp.itemId = itemId;
  242. that.temp.itemName = itemName;
  243. that.dialogFormVisible = true;
  244. this.$nextTick(() => {
  245. this.$refs['dataForm'].clearValidate()
  246. })
  247. },
  248. resetSearch() {
  249. this.listQuery = {
  250. current: 1,
  251. size: 10,
  252. descs: 'id',
  253. me: false
  254. }
  255. this.getList()
  256. },
  257. searchList() {
  258. // 重置分页
  259. this.listQuery.page = 1
  260. this.listQuery.size = 20
  261. this.getList()
  262. },
  263. getList() {
  264. const that = this
  265. this.listLoading = true
  266. const key = {}
  267. this.$api.payment.itemPayment(Object.assign({}, that.listQuery, key)).then((res) => {
  268. that.pageData = res.data
  269. setTimeout(() => {
  270. that.listLoading = false
  271. }, 200)
  272. })
  273. .catch(() => {
  274. that.listLoading = false
  275. })
  276. },
  277. },
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .right {
  282. flex: 1;
  283. .title {
  284. font-size: 16px;
  285. font-weight: 500;
  286. color: rgba(51, 51, 51, 1);
  287. line-height: 35px;
  288. margin-bottom: 8px;
  289. }
  290. .menu-2-box {
  291. display: flex;
  292. flex-wrap: wrap;
  293. width: 100%;
  294. }
  295. .menu-2-item {
  296. display: flex;
  297. align-items: center;
  298. color: #656565;
  299. font-size: 12px;
  300. width: 230px;
  301. height: 101px;
  302. background: rgb(255, 185, 129);
  303. border-radius: 3px;
  304. padding-left: 20px;
  305. margin-right: 10px;
  306. margin-bottom: 10px;
  307. cursor: pointer;
  308. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  309. .text {
  310. margin-left: 16px;
  311. }
  312. }
  313. }
  314. /deep/.paymentDialog{
  315. border-radius: 20px;
  316. }
  317. </style>