ProjectList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline">
  6. <a-row :gutter="24">
  7. <a-col :md="6" :sm="8">
  8. <a-form-item label="项目名称">
  9. <a-input placeholder="请输入项目名称" v-model="queryParam.projectName"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="广告主名称">
  14. <!-- <a-input placeholder="请输入广告主名称" v-model="queryParam.advertiserName"></a-input> -->
  15. <a-select
  16. optionFilterProp="children"
  17. showSearch
  18. :filterOption="filterOption"
  19. v-model="queryParam.advertiserId"
  20. placeholder="请选择广告主名称"
  21. >
  22. <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">
  23. {{ item.name }}
  24. </a-select-option>
  25. </a-select>
  26. </a-form-item>
  27. </a-col>
  28. <template>
  29. <a-col :md="6" :sm="8">
  30. <a-form-item label="运营负责人">
  31. <!-- <a-input placeholder="请输入负责人" v-model="queryParam.responsible"></a-input> -->
  32. <a-select
  33. placeholder="请选择运营负责人"
  34. showSearch
  35. optionFilterProp="children"
  36. style="width: 100%"
  37. :filterOption="filterOption"
  38. v-model="queryParam.responsibleId"
  39. @search="search"
  40. @focus="getAllUserList"
  41. >
  42. <a-select-option
  43. v-for="appModel in options"
  44. :key="appModel.userId + new Date().getTime()"
  45. :value="appModel.userId"
  46. >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
  47. >
  48. </a-select>
  49. </a-form-item>
  50. </a-col>
  51. </template>
  52. <template>
  53. <a-col :md="6" :sm="8">
  54. <a-form-item label="设计负责人">
  55. <!-- <a-input placeholder="请输入负责人" v-model="queryParam.responsible"></a-input> -->
  56. <a-select
  57. placeholder="请选择设计负责人"
  58. showSearch
  59. optionFilterProp="children"
  60. style="width: 100%"
  61. :filterOption="filterOption"
  62. v-model="queryParam.designResponsibleId"
  63. @search="search"
  64. @focus="getAllUserList"
  65. >
  66. <a-select-option
  67. v-for="appModel in options"
  68. :key="appModel.userId + new Date().getTime()"
  69. :value="appModel.userId"
  70. >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
  71. >
  72. </a-select>
  73. </a-form-item>
  74. </a-col>
  75. <a-col :md="6" :sm="6">
  76. <a-form-item label="行业">
  77. <j-tree-select
  78. v-model="queryParam.industryId"
  79. ref="treeSelect"
  80. placeholder="请选择行业"
  81. dict="sys_category,name,id"
  82. pidField="pid"
  83. pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
  84. ></j-tree-select>
  85. </a-form-item>
  86. </a-col>
  87. </template>
  88. <a-col :md="6" :sm="8">
  89. <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
  90. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  91. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  92. <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
  93. {{ toggleSearchStatus ? '收起' : '展开' }}
  94. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  95. </a>-->
  96. </span>
  97. </a-col>
  98. </a-row>
  99. </a-form>
  100. </div>
  101. <!-- 操作按钮区域 -->
  102. <!-- <div class="table-operator">
  103. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  104. </div>-->
  105. <!-- table区域-begin -->
  106. <!-- 供应商 -->
  107. <div>
  108. <a-table
  109. ref="table"
  110. size="middle"
  111. bordered
  112. rowKey="id"
  113. :columns="columns"
  114. :dataSource="dataSource"
  115. :pagination="ipagination"
  116. :loading="loading"
  117. @change="handleTableChange"
  118. >
  119. <span slot="maxBid" slot-scope="text">{{ text / 1000 }}</span>
  120. <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span>
  121. <span slot="ocpxActionType" slot-scope="text">
  122. <div v-if="text">
  123. <span v-for="(item, index) of JSON.parse(text)" :key="index"
  124. >{{ item | ocpxActionType }}{{ index == JSON.parse(text).length - 1 ? '' : ',' }}</span
  125. >
  126. </div>
  127. <div v-else>-</div>
  128. <!-- {{ text | ocpxActionType }} -->
  129. </span>
  130. <span slot="bidType" slot-scope="text">
  131. <div v-if="text">
  132. <span v-for="(item, index) of JSON.parse(text)" :key="index"
  133. >{{ item | bidType }}{{ index == JSON.parse(text).length - 1 ? '' : ',' }}</span
  134. >
  135. </div>
  136. <div v-else>-</div>
  137. </span>
  138. <span slot="mediaId" slot-scope="text">
  139. {{ text == '1' || text == '3' ? '头条' : '快手' }}
  140. </span>
  141. <span slot="action" slot-scope="text, record">
  142. <a @click="handleEdit(record)">编辑</a>
  143. <a-divider type="vertical" />
  144. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  145. <a>删除</a>
  146. </a-popconfirm>
  147. </span>
  148. </a-table>
  149. </div>
  150. <!-- table区域-end -->
  151. <!-- 表单区域 -->
  152. <project-modal ref="modalForm" @ok="modalFormOk"></project-modal>
  153. </a-card>
  154. </template>
  155. <script>
  156. import ProjectModal from './modules/projectListModal'
  157. import JTreeSelect from '@/components/jeecg/JTreeSelect'
  158. import { httpAction, getAction } from '@/api/manage'
  159. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  160. export default {
  161. name: 'ProjectList',
  162. mixins: [JeecgListMixin],
  163. components: {
  164. ProjectModal,
  165. JTreeSelect,
  166. },
  167. data() {
  168. return {
  169. description: '项目管理页面',
  170. // 表头
  171. columns: [
  172. {
  173. title: '项目名称',
  174. align: 'center',
  175. dataIndex: 'projectName',
  176. },
  177. {
  178. title: '广告主名称',
  179. align: 'center',
  180. dataIndex: 'advertiserId_dictText',
  181. },
  182. {
  183. title: '最高出价',
  184. align: 'center',
  185. dataIndex: 'maxBid',
  186. scopedSlots: {
  187. customRender: 'maxBid',
  188. },
  189. },
  190. {
  191. title: '最高转化出价',
  192. align: 'center',
  193. dataIndex: 'maxDeepCpaBid',
  194. scopedSlots: {
  195. customRender: 'maxDeepCpaBid',
  196. },
  197. },
  198. {
  199. title: '优化目标',
  200. align: 'center',
  201. dataIndex: 'bidType',
  202. scopedSlots: {
  203. customRender: 'bidType',
  204. },
  205. },
  206. {
  207. title: '转化目标',
  208. align: 'center',
  209. dataIndex: 'ocpxActionType',
  210. scopedSlots: {
  211. customRender: 'ocpxActionType',
  212. },
  213. },
  214. {
  215. title: '供应商',
  216. align: 'center',
  217. dataIndex: 'supplierCode_dictText',
  218. },
  219. {
  220. title: '销售',
  221. align: 'center',
  222. dataIndex: 'saleId_dictText',
  223. },
  224. {
  225. title: '运营负责人',
  226. align: 'center',
  227. dataIndex: 'responsibleId_dictText',
  228. },
  229. {
  230. title: '设计负责人',
  231. align: 'center',
  232. dataIndex: 'designResponsibleId_dictText',
  233. },
  234. {
  235. title: '媒体',
  236. align: 'center',
  237. dataIndex: 'mediaId',
  238. scopedSlots: {
  239. customRender: 'mediaId',
  240. },
  241. },
  242. {
  243. title: '操作',
  244. dataIndex: 'action',
  245. align: 'center',
  246. scopedSlots: {
  247. customRender: 'action',
  248. },
  249. },
  250. ],
  251. url: {
  252. list: '/ctop/project/list',
  253. delete: '/ctop/project/delete',
  254. deleteBatch: '/ctop/project/deleteBatch',
  255. exportXlsUrl: 'ctop/project/exportXls',
  256. importExcelUrl: 'ctop/project/importExcel',
  257. },
  258. list: [],
  259. options: [],
  260. }
  261. },
  262. filters: {
  263. bidType(sta) {
  264. var data = {
  265. null: '-',
  266. 1: 'CPM',
  267. 2: 'CPC',
  268. 6: 'OCPC',
  269. 10: 'OCPM',
  270. }
  271. return data[sta]
  272. },
  273. ocpxActionType(sta) {
  274. var data = {
  275. null: '-',
  276. 0: '封面点击',
  277. 2: '行为数',
  278. 10: '曝光',
  279. 11: '点击',
  280. 31: '下载完成',
  281. 53: '提交线索',
  282. 180: '激活',
  283. 190: '付费',
  284. 191: '首日ROI',
  285. 348: '有效线索',
  286. 383: '授信',
  287. 384: '完件',
  288. 394: '订单提交',
  289. }
  290. return data[sta]
  291. },
  292. },
  293. computed: {
  294. importExcelUrl: function () {
  295. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  296. },
  297. },
  298. methods: {
  299. getList() {
  300. var params = {}
  301. // params.userId = this.userInfo().id
  302. params.pageSize = 1000
  303. params.pageNo = 1
  304. getAction('/ctop/advertiser/list', params)
  305. .then((res) => {
  306. if (res.success) {
  307. this.list = res.result.records
  308. } else {
  309. this.$message.warning(res.message)
  310. }
  311. })
  312. .finally(() => {})
  313. },
  314. filterOption(input, option) {
  315. return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  316. },
  317. getAllUserList(value) {
  318. this.options = []
  319. getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: value }).then((res) => {
  320. if (res.success) {
  321. this.options = res.result.list
  322. }
  323. })
  324. },
  325. search(value) {
  326. this.options = []
  327. if (value != '') {
  328. // this.options = this.list.filter(item => {
  329. // var data = item.realName + ' ' + item.roleName
  330. // return data.toLowerCase().indexOf(value.toLowerCase()) > -1
  331. // })
  332. // this.options = [...this.options]
  333. this.getAllUserList(value)
  334. } else {
  335. this.getAllUserList()
  336. }
  337. },
  338. },
  339. mounted() {
  340. this.getAllUserList()
  341. this.getList()
  342. // getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: '' }).then((res) => {
  343. // if (res.success) {
  344. // this.options = res.result.list
  345. // }
  346. // })
  347. },
  348. }
  349. </script>
  350. <style scoped>
  351. @import '~@assets/less/common.less';
  352. </style>