CostModelXmxqWxList.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="外协项目">
  9. <a-input placeholder="请输入外协项目" v-model="queryParam.wxProject"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="外协单位">
  14. <a-input placeholder="请输入外协单位" v-model="queryParam.wxCompany"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="计量单位">
  20. <a-input placeholder="请输入计量单位" v-model="queryParam.unit"></a-input>
  21. </a-form-item>
  22. </a-col>
  23. </template>
  24. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  25. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  26. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  27. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  28. <a @click="handleToggleSearch" style="margin-left: 8px">
  29. {{ toggleSearchStatus ? '收起' : '展开' }}
  30. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  31. </a>
  32. </span>
  33. </a-col>
  34. </a-row>
  35. </a-form>
  36. </div>
  37. <!-- 查询区域-END -->
  38. <!-- 操作按钮区域 -->
  39. <div class="table-operator">
  40. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  41. <a-button type="primary" icon="download" @click="handleExportXls('项目外协导入详情')">导出</a-button>
  42. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  43. <a-button type="primary" icon="import">导入</a-button>
  44. </a-upload>
  45. <!-- 高级查询区域 -->
  46. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  47. <a-dropdown v-if="selectedRowKeys.length > 0">
  48. <a-menu slot="overlay">
  49. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  50. </a-menu>
  51. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  52. </a-dropdown>
  53. </div>
  54. <!-- table区域-begin -->
  55. <div>
  56. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  57. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  58. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  59. </div>
  60. <a-table
  61. ref="table"
  62. size="middle"
  63. :scroll="{x:true}"
  64. bordered
  65. rowKey="id"
  66. :columns="columns"
  67. :dataSource="dataSource"
  68. :pagination="ipagination"
  69. :loading="loading"
  70. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  71. class="j-table-force-nowrap"
  72. @change="handleTableChange">
  73. <template slot="htmlSlot" slot-scope="text">
  74. <div v-html="text"></div>
  75. </template>
  76. <template slot="imgSlot" slot-scope="text,record">
  77. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  78. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  79. </template>
  80. <template slot="fileSlot" slot-scope="text">
  81. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  82. <a-button
  83. v-else
  84. :ghost="true"
  85. type="primary"
  86. icon="download"
  87. size="small"
  88. @click="downloadFile(text)">
  89. 下载
  90. </a-button>
  91. </template>
  92. <span slot="action" slot-scope="text, record">
  93. <a @click="handleEdit(record)">编辑</a>
  94. <a-divider type="vertical" />
  95. <a-dropdown>
  96. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  97. <a-menu slot="overlay">
  98. <a-menu-item>
  99. <a @click="handleDetail(record)">详情</a>
  100. </a-menu-item>
  101. <a-menu-item>
  102. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  103. <a>删除</a>
  104. </a-popconfirm>
  105. </a-menu-item>
  106. </a-menu>
  107. </a-dropdown>
  108. </span>
  109. </a-table>
  110. </div>
  111. <!-- <cost-model-xmxq-wx-modal ref="modalForm" @ok="modalFormOk"></cost-model-xmxq-wx-modal> -->
  112. </a-card>
  113. </template>
  114. <script>
  115. import '@/assets/less/TableExpand.less'
  116. import { mixinDevice } from '@/utils/mixin'
  117. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  118. // import CostModelXmxqWxModal from './modules/CostModelXmxqWxModal'
  119. export default {
  120. name: 'CostModelXmxqWxList',
  121. mixins:[JeecgListMixin, mixinDevice],
  122. components: {
  123. // CostModelXmxqWxModal
  124. },
  125. data () {
  126. return {
  127. description: '项目外协导入详情管理页面',
  128. // 表头
  129. columns: [
  130. {
  131. title: '#',
  132. dataIndex: '',
  133. key:'rowIndex',
  134. width:60,
  135. align:"center",
  136. customRender:function (t,r,index) {
  137. return parseInt(index)+1;
  138. }
  139. },
  140. {
  141. title:'项目ID',
  142. align:"center",
  143. dataIndex: 'xiangmuId'
  144. },
  145. {
  146. title:'项目名称',
  147. align:"center",
  148. dataIndex: 'xiangmuName'
  149. },
  150. {
  151. title:'外协项目',
  152. align:"center",
  153. dataIndex: 'wxProject'
  154. },
  155. {
  156. title:'外协单位',
  157. align:"center",
  158. dataIndex: 'wxCompany'
  159. },
  160. {
  161. title:'计量单位',
  162. align:"center",
  163. dataIndex: 'unit'
  164. },
  165. {
  166. title:'数量',
  167. align:"center",
  168. dataIndex: 'number'
  169. },
  170. // {
  171. // title:'价格(单价*数量)',
  172. // align:"center",
  173. // dataIndex: 'price'
  174. // },
  175. {
  176. title:'单价(最大值)',
  177. align:"center",
  178. dataIndex: 'maxDanjia'
  179. },
  180. {
  181. title:'单价(最小值)',
  182. align:"center",
  183. dataIndex: 'minDanjia'
  184. },
  185. {
  186. title:'单价(平均值)',
  187. align:"center",
  188. dataIndex: 'aveDanjia'
  189. },
  190. {
  191. title:'单价(近期值)',
  192. align:"center",
  193. dataIndex: 'recentDanjia'
  194. },
  195. {
  196. title:'价格(最大值)',
  197. align:"center",
  198. dataIndex: 'maxPrice'
  199. },
  200. {
  201. title:'价格(最小值)',
  202. align:"center",
  203. dataIndex: 'minPrice'
  204. },
  205. {
  206. title:'价格(平均值)',
  207. align:"center",
  208. dataIndex: 'avePrice'
  209. },
  210. {
  211. title:'价格(近期值)',
  212. align:"center",
  213. dataIndex: 'recentPrice'
  214. },
  215. {
  216. title:'描述',
  217. align:"center",
  218. dataIndex: 'remark'
  219. },
  220. {
  221. title: '操作',
  222. dataIndex: 'action',
  223. align:"center",
  224. fixed:"right",
  225. width:147,
  226. scopedSlots: { customRender: 'action' }
  227. }
  228. ],
  229. url: {
  230. list: "/costModelXmxqWx/costModelXmxqWx/list",
  231. delete: "/costModelXmxqWx/costModelXmxqWx/delete",
  232. deleteBatch: "/costModelXmxqWx/costModelXmxqWx/deleteBatch",
  233. exportXlsUrl: "/costModelXmxqWx/costModelXmxqWx/exportXls",
  234. importExcelUrl: "costModelXmxqWx/costModelXmxqWx/importExcel",
  235. },
  236. dictOptions:{},
  237. superFieldList:[],
  238. }
  239. },
  240. created() {
  241. this.getSuperFieldList();
  242. },
  243. computed: {
  244. importExcelUrl: function(){
  245. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  246. },
  247. },
  248. methods: {
  249. initDictConfig(){
  250. },
  251. getSuperFieldList(){
  252. let fieldList=[];
  253. fieldList.push({type:'string',value:'xiangmuId',text:'项目ID',dictCode:''})
  254. fieldList.push({type:'string',value:'xiangmuName',text:'项目名称',dictCode:''})
  255. fieldList.push({type:'string',value:'wxProject',text:'外协项目',dictCode:''})
  256. fieldList.push({type:'string',value:'wxCompany',text:'外协单位',dictCode:''})
  257. fieldList.push({type:'string',value:'danjia',text:'单价',dictCode:''})
  258. fieldList.push({type:'string',value:'unit',text:'计量单位',dictCode:''})
  259. fieldList.push({type:'string',value:'number',text:'数量',dictCode:''})
  260. fieldList.push({type:'string',value:'price',text:'价格(单价*数量)',dictCode:''})
  261. fieldList.push({type:'string',value:'remark',text:'描述',dictCode:''})
  262. this.superFieldList = fieldList
  263. }
  264. }
  265. }
  266. </script>
  267. <style scoped>
  268. @import '~@assets/less/common.less';
  269. </style>