index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div class="page">
  3. <template-page v-if="isShowTab && !formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
  4. :table-events="tableEvents" :operationColumnWidth="170" :options-evens-group="optionsEvensGroup"
  5. :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
  6. <div slot="moreSearch">
  7. <el-radio-group v-model="status" size="mini" @change="changeType">
  8. <el-radio-button label="">全部</el-radio-button>
  9. <el-radio-button label="NO">未付款</el-radio-button>
  10. <el-radio-button label="WAIT">部分付款</el-radio-button>
  11. <el-radio-button label="OK">已完成</el-radio-button>
  12. </el-radio-group>
  13. <br><br>
  14. </div>
  15. </template-page>
  16. <div class="detail" v-if="formDialog">
  17. <detail :id="id" @back="backList" :formType="formDialogType" title="工程辅材收款详情"></detail>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import TemplatePage from '@/components/template/template-page-1.vue'
  23. import detail from './detail.vue'
  24. import import_mixin from '@/components/template/import_mixin.js'
  25. import ImageUpload from '@/components/file-upload'
  26. import { downloadFiles } from '@/utils/util'
  27. import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
  28. import { listPage, pageExport } from "@/api/auxiliaryFittings/projectAuxiliaryManage";
  29. import operation_mixin from '@/components/template/operation_mixin.js'
  30. export default {
  31. components: { TemplatePage, ImageUpload, detail },
  32. mixins: [import_mixin, operation_mixin],
  33. data() {
  34. return {
  35. // 表格属性
  36. tableAttributes: {
  37. // 启用勾选列
  38. selectColumn: true
  39. },
  40. // 表格事件
  41. tableEvents: {
  42. 'selection-change': this.selectionChange
  43. },
  44. // 勾选选中行
  45. recordSelected: [],
  46. /** 表单变量 */
  47. formDialogType: 0,
  48. formDialogTitles: ["新增", "编辑", "详情"],
  49. formDialog: false,
  50. id: '',
  51. status: 'NO',
  52. isShowTab: true
  53. }
  54. },
  55. computed: {
  56. // 事件组合
  57. optionsEvensGroup() {
  58. return [
  59. // [
  60. // [
  61. // this.optionsEvensAuth("add", {
  62. // click: this.addData
  63. // }),
  64. // ]
  65. // ]
  66. ]
  67. },
  68. // 更多参数
  69. moreParameters() {
  70. return []
  71. },
  72. formItems() { }
  73. },
  74. created(){},
  75. watch: {
  76. status(){
  77. this.isShowTab = false
  78. this.$nextTick(()=>{
  79. this.isShowTab = true
  80. })
  81. }
  82. },
  83. methods: {
  84. // 切换状态
  85. changeType(val) {
  86. this.$refs?.pageRef?.refreshList()
  87. },
  88. backList() {
  89. this.id = ''
  90. this.formDialog = false;
  91. this.$refs?.pageRef?.refreshList()
  92. },
  93. // 列表请求函数
  94. getList(p, cb) {
  95. try {
  96. var pam = JSON.parse(JSON.stringify(p))
  97. pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.status', "compare": "=", "value": this.status })
  98. cb && cb(pam)
  99. return listPage(pam)
  100. } catch (error) {
  101. console.log(error)
  102. }
  103. },
  104. // 列表导出函数
  105. exportList: pageExport,
  106. // 表格列解析渲染数据更改
  107. columnParsing(item, defaultData) {
  108. return defaultData
  109. },
  110. // 监听勾选变化
  111. selectionChange(data) {
  112. this.recordSelected = data
  113. },
  114. operation() {
  115. return this.operationBtn({
  116. detail: {
  117. click: ({ row, index, column }) => {
  118. this.id = row.websitSalesManagerId
  119. this.formDialogType = 2
  120. this.openForm()
  121. }
  122. },
  123. sellOrderDetail: {
  124. click: ({ row, index, column }) => {
  125. }
  126. },
  127. returnGoodsDetail: {
  128. click: ({ row, index, column }) => {
  129. }
  130. },
  131. })
  132. },
  133. openForm() {
  134. this.formDialog = true;
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .page {
  141. height: 100%;
  142. }
  143. .tab {
  144. padding: 20px 20px 0 20px;
  145. }
  146. </style>