KyBgDetailList.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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-row>
  8. </a-form>
  9. </div>
  10. <!-- 查询区域-END -->
  11. <!-- 操作按钮区域 -->
  12. <!-- <div class="table-operator">
  13. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  14. <a-button type="primary" icon="download" @click="handleExportXls('科研报工')">导出</a-button>
  15. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  16. <a-button type="primary" icon="import">导入</a-button>
  17. </a-upload> -->
  18. <!-- 高级查询区域 -->
  19. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  20. <a-dropdown v-if="selectedRowKeys.length > 0">
  21. <a-menu slot="overlay">
  22. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  23. </a-menu>
  24. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  25. </a-dropdown>
  26. </div> -->
  27. <!-- table区域-begin -->
  28. <div>
  29. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  30. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  31. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  32. </div> -->
  33. <a-table
  34. ref="table"
  35. size="middle"
  36. :scroll="{x:true}"
  37. bordered
  38. rowKey="id"
  39. :columns="columns"
  40. :dataSource="dataSource"
  41. :pagination="ipagination"
  42. :loading="loading"
  43. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  44. class="j-table-force-nowrap"
  45. @change="handleTableChange">
  46. <template slot="htmlSlot" slot-scope="text">
  47. <div v-html="text"></div>
  48. </template>
  49. <template slot="imgSlot" slot-scope="text,record">
  50. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  51. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  52. </template>
  53. <template slot="fileSlot" slot-scope="text">
  54. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  55. <a-button
  56. v-else
  57. :ghost="true"
  58. type="primary"
  59. icon="download"
  60. size="small"
  61. @click="downloadFile(text)">
  62. 下载
  63. </a-button>
  64. </template>
  65. <!-- <span slot="action" slot-scope="text, record">
  66. <a @click="handleEdit(record)">编辑</a>
  67. <a-divider type="vertical" />
  68. <a-dropdown>
  69. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  70. <a-menu slot="overlay">
  71. <a-menu-item>
  72. <a @click="handleDetail(record)">详情</a>
  73. </a-menu-item>
  74. <a-menu-item>
  75. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  76. <a>删除</a>
  77. </a-popconfirm>
  78. </a-menu-item>
  79. </a-menu>
  80. </a-dropdown>
  81. </span> -->
  82. </a-table>
  83. </div>
  84. </a-card>
  85. </template>
  86. <script>
  87. import '@/assets/less/TableExpand.less'
  88. import { mixinDevice } from '@/utils/mixin'
  89. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  90. import { getAction } from '@/api/manage'
  91. export default {
  92. name: 'KyBgInfoList',
  93. mixins:[JeecgListMixin, mixinDevice],
  94. props: {
  95. taskno: {
  96. type: String,
  97. default: ''
  98. }
  99. },
  100. data () {
  101. return {
  102. description: '科研报工管理页面',
  103. // 表头
  104. columns: [
  105. {
  106. title: '序号',
  107. dataIndex: '',
  108. key:'rowIndex',
  109. width:60,
  110. align:"center",
  111. customRender:function (t,r,index) {
  112. return parseInt(index)+1;
  113. }
  114. },
  115. // {
  116. // title:'key',
  117. // align:"center",
  118. // dataIndex: 'key'
  119. // },
  120. {
  121. title:'报工任务号',
  122. align:"center",
  123. dataIndex: 'taskno'
  124. },
  125. {
  126. title:'任务名称',
  127. align:"center",
  128. dataIndex: 'taskname'
  129. },
  130. {
  131. title:'工作内容',
  132. align:"center",
  133. dataIndex: 'workcontent'
  134. },
  135. {
  136. title:'当日用时(h)',
  137. align:"center",
  138. dataIndex: 'workhour'
  139. },
  140. {
  141. title:'型号',
  142. align:"center",
  143. dataIndex: 'xhname'
  144. },
  145. {
  146. title:'研制数量',
  147. align:"center",
  148. dataIndex: 'yzsl'
  149. },
  150. {
  151. title:'研制阶段',
  152. align:"center",
  153. dataIndex: 'yzjdname'
  154. },
  155. {
  156. title:'用户名称',
  157. align:"center",
  158. dataIndex: 'tcdw'
  159. },
  160. {
  161. title:'用户简称',
  162. align:"center",
  163. dataIndex: 'brief'
  164. },
  165. {
  166. title:'状态',
  167. align:"center",
  168. dataIndex: 'status'
  169. },
  170. {
  171. title:'计划开始时间',
  172. align:"center",
  173. dataIndex: 'jhkssj',
  174. customRender:function (text) {
  175. return !text?"":(text.length>10?text.substr(0,10):text)
  176. }
  177. },
  178. {
  179. title:'计划完成时间(进度要求)',
  180. align:"center",
  181. dataIndex: 'jhwcsj',
  182. customRender:function (text) {
  183. return !text?"":(text.length>10?text.substr(0,10):text)
  184. }
  185. },
  186. {
  187. title:'工作日期',
  188. align:"center",
  189. dataIndex: 'worktime',
  190. customRender:function (text) {
  191. return !text?"":(text.length>10?text.substr(0,10):text)
  192. }
  193. },
  194. {
  195. title:'填写时间',
  196. align:"center",
  197. dataIndex: 'createtime',
  198. customRender:function (text) {
  199. return !text?"":(text.length>10?text.substr(0,10):text)
  200. }
  201. },
  202. {
  203. title:'填报人',
  204. align:"center",
  205. dataIndex: 'username'
  206. },
  207. {
  208. title:'填报部门',
  209. align:"center",
  210. dataIndex: 'userdept'
  211. },
  212. {
  213. title:'审核人',
  214. align:"center",
  215. dataIndex: 'shr'
  216. },
  217. {
  218. title:'审批人',
  219. align:"center",
  220. dataIndex: 'spr'
  221. },
  222. {
  223. title:'备注',
  224. align:"center",
  225. dataIndex: 'memo'
  226. },
  227. // {
  228. // title: '操作',
  229. // dataIndex: 'action',
  230. // align:"center",
  231. // fixed:"right",
  232. // width:147,
  233. // scopedSlots: { customRender: 'action' }
  234. // }
  235. ],
  236. url: {
  237. list: "/kyBgInfo/kyBgInfo/getGSDeatilList",
  238. // delete: "/kyBgInfo/kyBgInfo/delete",
  239. // deleteBatch: "/kyBgInfo/kyBgInfo/deleteBatch",
  240. // exportXlsUrl: "/kyBgInfo/kyBgInfo/exportXls",
  241. // importExcelUrl: "kyBgInfo/kyBgInfo/importExcel",
  242. },
  243. dictOptions:{},
  244. superFieldList:[],
  245. }
  246. },
  247. created() {
  248. this.getSuperFieldList();
  249. this.loadData()
  250. },
  251. computed: {
  252. // importExcelUrl: function(){
  253. // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  254. // },
  255. },
  256. methods: {
  257. loadData() {
  258. this.loading = true;
  259. getAction(this.url.list, {taskno: this.taskno}).then((res) => {
  260. this.dataSource = res
  261. }).finally(() => {
  262. this.loading = false
  263. })
  264. },
  265. initDictConfig(){
  266. },
  267. getSuperFieldList(){
  268. let fieldList=[];
  269. fieldList.push({type:'int',value:'key',text:'key'})
  270. fieldList.push({type:'string',value:'taskno',text:'报工任务号'})
  271. fieldList.push({type:'string',value:'taskname',text:'任务名称'})
  272. fieldList.push({type:'string',value:'workcontent',text:'工作内容'})
  273. fieldList.push({type:'number',value:'workhour',text:'当日用时(h)'})
  274. fieldList.push({type:'string',value:'xhname',text:'型号'})
  275. fieldList.push({type:'int',value:'yzsl',text:'研制数量'})
  276. fieldList.push({type:'string',value:'yzjdname',text:'研制阶段'})
  277. fieldList.push({type:'string',value:'tcdw',text:'用户名称'})
  278. fieldList.push({type:'string',value:'brief',text:'用户简称'})
  279. fieldList.push({type:'string',value:'status',text:'状态'})
  280. fieldList.push({type:'date',value:'jhkssj',text:'计划开始时间'})
  281. fieldList.push({type:'date',value:'jhwcsj',text:'计划完成时间(进度要求)'})
  282. fieldList.push({type:'date',value:'worktime',text:'工作日期'})
  283. fieldList.push({type:'date',value:'createtime',text:'填写时间'})
  284. fieldList.push({type:'string',value:'username',text:'填报人'})
  285. fieldList.push({type:'string',value:'userdept',text:'填报部门'})
  286. fieldList.push({type:'string',value:'shr',text:'审核人'})
  287. fieldList.push({type:'string',value:'spr',text:'审批人'})
  288. fieldList.push({type:'string',value:'memo',text:'备注'})
  289. this.superFieldList = fieldList
  290. }
  291. }
  292. }
  293. </script>
  294. <style scoped>
  295. @import '~@assets/less/common.less';
  296. </style>