KyBgDetailList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <a-card :bordered="false" class="u-dialog-card">
  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(taskno+'工时明细')">导出</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. class="j-table-force-nowrap"
  44. @change="handleTableChange">
  45. <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
  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. fixed: 'left'
  115. },
  116. // {
  117. // title:'key',
  118. // align:"center",
  119. // dataIndex: 'key'
  120. // },
  121. {
  122. title:'报工任务号',
  123. align:"center",
  124. dataIndex: 'taskno',
  125. width: 120,
  126. fixed: 'left'
  127. },
  128. {
  129. title:'任务名称',
  130. align:"center",
  131. dataIndex: 'taskname',
  132. width: 120,
  133. fixed: 'left'
  134. },
  135. {
  136. title:'工作内容',
  137. align:"center",
  138. dataIndex: 'workcontent'
  139. },
  140. {
  141. title:'备注',
  142. align:"center",
  143. dataIndex: 'memo'
  144. },
  145. {
  146. title:'审核人',
  147. align:"center",
  148. // dataIndex: 'shr'
  149. dataIndex: 'shusername'
  150. },
  151. {
  152. title:'审批人',
  153. align:"center",
  154. dataIndex: 'spr'
  155. },
  156. {
  157. title:'型号',
  158. align:"center",
  159. dataIndex: 'xhname'
  160. },
  161. {
  162. title:'研制阶段',
  163. align:"center",
  164. dataIndex: 'yzjdname'
  165. },
  166. {
  167. title:'研制数量',
  168. align:"center",
  169. dataIndex: 'yzsl'
  170. },
  171. {
  172. title:'用户名称',
  173. align:"center",
  174. // dataIndex: 'tcdw'
  175. dataIndex: 'yhname'
  176. },
  177. // {
  178. // title:'用户简称',
  179. // align:"center",
  180. // dataIndex: 'brief'
  181. // },
  182. {
  183. title:'计划开始时间',
  184. align:"center",
  185. dataIndex: 'jhkssj',
  186. customRender:function (text) {
  187. return !text?"":(text.length>10?text.substr(0,10):text)
  188. }
  189. },
  190. {
  191. title:'计划完成时间', // (进度要求)
  192. align:"center",
  193. dataIndex: 'jhwcsj',
  194. customRender:function (text) {
  195. return !text?"":(text.length>10?text.substr(0,10):text)
  196. }
  197. },
  198. {
  199. title:'状态',
  200. align:"center",
  201. dataIndex: 'status'
  202. },
  203. {
  204. title:'工作日期',
  205. align:"center",
  206. dataIndex: 'worktime',
  207. customRender:function (text) {
  208. return !text?"":(text.length>10?text.substr(0,10):text)
  209. }
  210. },
  211. {
  212. title:'填写时间',
  213. align:"center",
  214. // dataIndex: 'createtime',
  215. dataIndex: 'txtime',
  216. customRender:function (text) {
  217. return !text?"":(text.length>10?text.substr(0,10):text)
  218. }
  219. },
  220. {
  221. title:'填报人',
  222. align:"center",
  223. dataIndex: 'username'
  224. },
  225. {
  226. title:'填报部门',
  227. align:"center",
  228. dataIndex: 'userdept'
  229. },
  230. {
  231. title:'当日用时(h)',
  232. align:"center",
  233. dataIndex: 'workhour',
  234. width: 120,
  235. fixed: 'right'
  236. },
  237. ],
  238. url: {
  239. // list: "/kyBgInfo/kyBgInfo/getGSDeatilList", // 采集的科研报工
  240. list: "/kyBgInfoNew/kyBgInfoNew/getGSDeatilList", // 导入的科研报工
  241. // delete: "/kyBgInfo/kyBgInfo/delete",
  242. // deleteBatch: "/kyBgInfo/kyBgInfo/deleteBatch",
  243. // exportXlsUrl: "/kyBgInfo/kyBgInfo/exportGSDetail", // 采集的科研报工
  244. exportXlsUrl: "/kyBgInfoNew/kyBgInfoNew/exportGSDetail", // 导入的科研报工
  245. // importExcelUrl: "kyBgInfo/kyBgInfo/importExcel",
  246. },
  247. dictOptions:{},
  248. superFieldList:[],
  249. queryParam: {
  250. taskno: this.taskno
  251. }
  252. }
  253. },
  254. created() {
  255. this.getSuperFieldList();
  256. this.loadData()
  257. },
  258. computed: {
  259. // importExcelUrl: function(){
  260. // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  261. // },
  262. },
  263. methods: {
  264. loadData() {
  265. this.loading = true;
  266. getAction(this.url.list, {taskno: this.taskno}).then((res) => {
  267. this.dataSource = res
  268. }).finally(() => {
  269. this.loading = false
  270. })
  271. },
  272. initDictConfig(){
  273. },
  274. getSuperFieldList(){
  275. let fieldList=[];
  276. fieldList.push({type:'int',value:'key',text:'key'})
  277. fieldList.push({type:'string',value:'taskno',text:'报工任务号'})
  278. fieldList.push({type:'string',value:'taskname',text:'任务名称'})
  279. fieldList.push({type:'string',value:'workcontent',text:'工作内容'})
  280. fieldList.push({type:'number',value:'workhour',text:'当日用时(h)'})
  281. fieldList.push({type:'string',value:'xhname',text:'型号'})
  282. fieldList.push({type:'int',value:'yzsl',text:'研制数量'})
  283. fieldList.push({type:'string',value:'yzjdname',text:'研制阶段'})
  284. fieldList.push({type:'string',value:'tcdw',text:'用户名称'})
  285. fieldList.push({type:'string',value:'brief',text:'用户简称'})
  286. fieldList.push({type:'string',value:'status',text:'状态'})
  287. fieldList.push({type:'date',value:'jhkssj',text:'计划开始时间'})
  288. fieldList.push({type:'date',value:'jhwcsj',text:'计划完成时间(进度要求)'})
  289. fieldList.push({type:'date',value:'worktime',text:'工作日期'})
  290. fieldList.push({type:'date',value:'createtime',text:'填写时间'})
  291. fieldList.push({type:'string',value:'username',text:'填报人'})
  292. fieldList.push({type:'string',value:'userdept',text:'填报部门'})
  293. fieldList.push({type:'string',value:'shr',text:'审核人'})
  294. fieldList.push({type:'string',value:'spr',text:'审批人'})
  295. fieldList.push({type:'string',value:'memo',text:'备注'})
  296. this.superFieldList = fieldList
  297. }
  298. }
  299. }
  300. </script>
  301. <style scoped>
  302. @import '~@assets/less/common.less';
  303. </style>
  304. <style lang="less" scoped>
  305. .u-dialog-card{
  306. /deep/.ant-card-body{
  307. padding: 0 !important;
  308. }
  309. }
  310. </style>