index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div class="page">
  3. <template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
  4. :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
  5. :operation="operation" :exportList="exportList">
  6. <div slot="moreSearch">
  7. <el-radio-group v-model="flag" size="mini" @change="changeType">
  8. <el-radio-button label="">全部</el-radio-button>
  9. <el-radio-button label="PAY_NOT_TAKE">已支付</el-radio-button>
  10. <el-radio-button label="SUBMIT">未支付</el-radio-button>
  11. <el-radio-button label="PAY_TAKE">已提货</el-radio-button>
  12. </el-radio-group>
  13. <br><br>
  14. </div>
  15. </template-page>
  16. <div class="detail" v-if="formDialog">
  17. <attachmentSalesOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售订单' + formDialogTitles[formDialogType]"></attachmentSalesOrderDetail>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import TemplatePage from '@/components/template/template-page-1.vue'
  23. import attachmentSalesOrderDetail from '../components/attachmentSalesOrderDetail.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 { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
  29. export default {
  30. components: { TemplatePage, ImageUpload, attachmentSalesOrderDetail },
  31. mixins: [import_mixin],
  32. data() {
  33. return {
  34. // 事件组合
  35. optionsEvensGroup: [
  36. [
  37. [
  38. {
  39. name: '新建',
  40. click: this.addData
  41. }
  42. ]
  43. ]
  44. ],
  45. // 表格属性
  46. tableAttributes: {
  47. // 启用勾选列
  48. selectColumn: true
  49. },
  50. // 表格事件
  51. tableEvents: {
  52. 'selection-change': this.selectionChange
  53. },
  54. // 勾选选中行
  55. recordSelected: [],
  56. /** 表单变量 */
  57. formDialogType: 0,
  58. formDialogTitles: ["新增","编辑", "详情"],
  59. formDialog: false,
  60. id: '',
  61. flag: ''
  62. }
  63. },
  64. computed: {
  65. // 更多参数
  66. moreParameters() {
  67. return []
  68. },
  69. formItems() {}
  70. },
  71. methods: {
  72. // 切换状态
  73. changeType(val) {
  74. this.$refs.pageRef.refreshList()
  75. },
  76. backList() {
  77. this.formDialog = false;
  78. this.$refs.pageRef.refreshList()
  79. },
  80. // 列表请求函数
  81. getList(p) {
  82. try {
  83. var pam = JSON.parse(JSON.stringify(p))
  84. pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' },{'param': 'a.flag', "compare": "=", "value": this.flag})
  85. return listPageV2(pam)
  86. } catch (error) {
  87. console.log(error)
  88. }
  89. },
  90. // 列表导出函数
  91. exportList: pageExport,
  92. // 表格列解析渲染数据更改
  93. columnParsing(item, defaultData) {
  94. if (item.jname === 'idCardImg') {
  95.         defaultData.render = (h, { row, index, column }) => {
  96.           return (
  97.             <div style="padding:0 6px;cursor: pointer;">
  98.               {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
  99.             </div>
  100.           )
  101.         }
  102.       }
  103. return defaultData
  104. },
  105. // 监听勾选变化
  106. selectionChange(data) {
  107. this.recordSelected = data
  108. },
  109. // 表格操作列
  110. operation(h, { row, index, column }) {
  111. return (
  112. <div class='operation-btns'>
  113. <el-button type="text" onClick={() => {
  114. this.id = row.salesId
  115. this.formDialogType = 1
  116. this.openForm()
  117. }}>编辑</el-button>
  118. </div>
  119. )
  120. },
  121. addData() {
  122. this.formDialogType = 0
  123. this.openForm()
  124. },
  125. openForm() {
  126. this.formDialog = true;
  127. },
  128. // 下载导入模版
  129. handleDownload() {
  130. // downloadFiles('charging/standard/download');
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .page{
  137. height: 100%;
  138. }
  139. .tab{
  140. padding: 20px 20px 0 20px;
  141. }
  142. </style>