ItdmGongdanDetailList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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-select
  10. v-model="queryParam.weituoClient"
  11. label-in-value
  12. :options="weituoClientOptions"
  13. @change="getWeituoClientOptions"
  14. ></a-select>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18. <a-form-item label="委托编号">
  19. <a-select
  20. v-model="queryParam.weituoId"
  21. key-in-value
  22. :options="weituoNoOptions"
  23. ></a-select>
  24. </a-form-item>
  25. </a-col>
  26. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
  27. <!-- <a-form-item label="工单id">-->
  28. <!-- <a-input placeholder="请输入工单id" v-model="queryParam.woId"></a-input>-->
  29. <!-- </a-form-item>-->
  30. <!-- </a-col>-->
  31. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
  32. <!-- <a-form-item label="实绩设备id">-->
  33. <!-- <j-search-select-tag placeholder="请选择实绩设备id" v-model="queryParam.shijiShebeiId" dict="itdm_device,device_name,id"/>-->
  34. <!-- </a-form-item>-->
  35. <!-- </a-col>-->
  36. <template v-if="toggleSearchStatus">
  37. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
  38. <!-- <a-form-item label="实绩试验类型">-->
  39. <!-- <a-input placeholder="请输入实绩试验类型" v-model="queryParam.shijiShiiyanType"></a-input>-->
  40. <!-- </a-form-item>-->
  41. <!-- </a-col>-->
  42. <a-col :xl="10" :lg="11" :md="12" :sm="24">
  43. <a-form-item label="任务日期">
  44. <j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.workDate_begin"></j-date>
  45. <span class="query-group-split-cust"></span>
  46. <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.workDate_end"></j-date>
  47. </a-form-item>
  48. </a-col>
  49. <a-col :xl="10" :lg="11" :md="12" :sm="24">
  50. <a-form-item label="实绩任务日期">
  51. <j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.shijiWorkDate_begin"></j-date>
  52. <span class="query-group-split-cust"></span>
  53. <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.shijiWorkDate_end"></j-date>
  54. </a-form-item>
  55. </a-col>
  56. </template>
  57. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  58. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  59. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  60. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  61. <a @click="handleToggleSearch" style="margin-left: 8px">
  62. {{ toggleSearchStatus ? '收起' : '展开' }}
  63. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  64. </a>
  65. </span>
  66. </a-col>
  67. </a-row>
  68. </a-form>
  69. </div>
  70. <!-- 查询区域-END -->
  71. <!-- 操作按钮区域 -->
  72. <div class="table-operator">
  73. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
  74. <a-button type="primary" icon="download" @click="handleExportXls('工单detail')">导出</a-button>
  75. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  76. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  77. <!-- </a-upload>-->
  78. <!-- 高级查询区域 -->
  79. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  80. <!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
  81. <!-- <a-menu slot="overlay">-->
  82. <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
  83. <!-- </a-menu>-->
  84. <!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
  85. <!-- </a-dropdown>-->
  86. </div>
  87. <!-- table区域-begin -->
  88. <div>
  89. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  90. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  91. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  92. </div>
  93. <a-table
  94. ref="table"
  95. size="middle"
  96. :scroll="{x:true}"
  97. bordered
  98. rowKey="id"
  99. :columns="columns"
  100. :dataSource="dataSource"
  101. :pagination="ipagination"
  102. :loading="loading"
  103. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  104. class="j-table-force-nowrap"
  105. @change="handleTableChange">
  106. <template slot="htmlSlot" slot-scope="text">
  107. <div v-html="text"></div>
  108. </template>
  109. <template slot="imgSlot" slot-scope="text,record">
  110. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  111. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  112. </template>
  113. <template slot="fileSlot" slot-scope="text">
  114. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  115. <a-button
  116. v-else
  117. :ghost="true"
  118. type="primary"
  119. icon="download"
  120. size="small"
  121. @click="downloadFile(text)">
  122. 下载
  123. </a-button>
  124. </template>
  125. <!-- <span slot="action" slot-scope="text, record">-->
  126. <!-- <a @click="handleEdit(record)">编辑</a>-->
  127. <!-- <a-divider type="vertical" />-->
  128. <!-- <a-dropdown>-->
  129. <!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
  130. <!-- <a-menu slot="overlay">-->
  131. <!-- <a-menu-item>-->
  132. <!-- <a @click="handleDetail(record)">详情</a>-->
  133. <!-- </a-menu-item>-->
  134. <!-- <a-menu-item>-->
  135. <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
  136. <!-- <a>删除</a>-->
  137. <!-- </a-popconfirm>-->
  138. <!-- </a-menu-item>-->
  139. <!-- </a-menu>-->
  140. <!-- </a-dropdown>-->
  141. <!-- </span>-->
  142. </a-table>
  143. </div>
  144. <itdm-gongdan-detail-modal ref="modalForm" @ok="modalFormOk"></itdm-gongdan-detail-modal>
  145. </a-card>
  146. </template>
  147. <script>
  148. import '@/assets/less/TableExpand.less'
  149. import { mixinDevice } from '@/utils/mixin'
  150. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  151. import ItdmGongdanDetailModal from './modules/ItdmGongdanDetailModal'
  152. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  153. import { getWeituoClientList } from '@/api/api'
  154. import { getWeituoInfoListByClient } from '@/api/api'
  155. export default {
  156. name: 'ItdmGongdanDetailList',
  157. mixins:[JeecgListMixin, mixinDevice],
  158. components: {
  159. ItdmGongdanDetailModal,
  160. },
  161. data () {
  162. return {
  163. weituoClientQuery: {
  164. weituoClient: '',
  165. },
  166. weituoClientOptions : [],
  167. weituoNoQuery: {
  168. weituoNo: '',
  169. },
  170. weituoIdQuery: {
  171. weituoId: '',
  172. },
  173. weituoNoOptions:[],
  174. isorter: { // 排序参数
  175. column: 'woId,workDate', // 排序字段
  176. order: 'asc,asc' // 正序asc or 倒叙desc
  177. },
  178. description: '工单detail管理页面',
  179. // 表头
  180. columns: [
  181. {
  182. title: '#',
  183. dataIndex: '',
  184. key:'rowIndex',
  185. width:60,
  186. align:"center",
  187. customRender:function (t,r,index) {
  188. return parseInt(index)+1;
  189. }
  190. },
  191. {
  192. title:'委托单位',
  193. align:"center",
  194. dataIndex: 'weituoClient'
  195. },
  196. {
  197. title:'委托编号',
  198. align:"center",
  199. dataIndex: 'weituoNo'
  200. },
  201. {
  202. title:'检测项目',
  203. align:"center",
  204. dataIndex: 'testItemsId_dictText'
  205. },
  206. {
  207. title:'报告编号',
  208. align:"center",
  209. dataIndex: 'jihuaShiyanId_dictText'
  210. },
  211. {
  212. title:'委托样品',
  213. align:"center",
  214. dataIndex: 'weituoYangpinId_dictText'
  215. },
  216. {
  217. title:'设备',
  218. align:"center",
  219. dataIndex: 'shebeiId_dictText'
  220. },
  221. {
  222. title:'试验类型',
  223. align:"center",
  224. dataIndex: 'shiiyanType_dictText'
  225. },
  226. {
  227. title:'试验员',
  228. align:"center",
  229. dataIndex: 'worker'
  230. },
  231. {
  232. title:'委托样品数量',
  233. align:"center",
  234. dataIndex: 'yangpinCount'
  235. },
  236. {
  237. title:'任务日期',
  238. align:"center",
  239. dataIndex: 'workDate',
  240. customRender:function (text) {
  241. return !text?"":(text.length>10?text.substr(0,10):text)
  242. }
  243. },
  244. {
  245. title:'试验开始时间',
  246. align:"center",
  247. dataIndex: 'startTime'
  248. },
  249. {
  250. title:'试验结束时间',
  251. align:"center",
  252. dataIndex: 'endTime'
  253. },
  254. {
  255. title:'传感器',
  256. align:"center",
  257. dataIndex: 'chuanganqi_dictText'
  258. // dataIndex: 'chuanganqi'
  259. },
  260. {
  261. title:'实绩设备',
  262. align:"center",
  263. dataIndex: 'shijiShebeiId_dictText'
  264. },
  265. {
  266. title:'实绩试验类型',
  267. align:"center",
  268. dataIndex: 'shijiShiiyanType_dictText'
  269. },
  270. {
  271. title:'实绩任务日期',
  272. align:"center",
  273. dataIndex: 'shijiWorkDate',
  274. customRender:function (text) {
  275. return !text?"":(text.length>10?text.substr(0,10):text)
  276. }
  277. },
  278. {
  279. title:'实绩试验开始时间',
  280. align:"center",
  281. dataIndex: 'shijiStartTime'
  282. },
  283. {
  284. title:'实绩试验结束时间',
  285. align:"center",
  286. dataIndex: 'shijiEndTime'
  287. },
  288. {
  289. title:'工单id',
  290. align:"center",
  291. dataIndex: 'woId'
  292. },
  293. {
  294. title:'创建时间',
  295. align:"center",
  296. dataIndex: 'createTime'
  297. },
  298. // {
  299. // title:'备注',F
  300. // align:"center",
  301. // dataIndex: 'remark'
  302. // },
  303. // {
  304. // title: '操作',
  305. // dataIndex: 'action',
  306. // align:"center",
  307. // fixed:"right",
  308. // width:147,
  309. // scopedSlots: { customRender: 'action' }
  310. // }
  311. ],
  312. url: {
  313. list: "/itdmGongdanDetail/itdmGongdanDetail/list",
  314. delete: "/itdmGongdanDetail/itdmGongdanDetail/delete",
  315. deleteBatch: "/itdmGongdanDetail/itdmGongdanDetail/deleteBatch",
  316. exportXlsUrl: "/itdmGongdanDetail/itdmGongdanDetail/exportXls",
  317. importExcelUrl: "itdmGongdanDetail/itdmGongdanDetail/importExcel",
  318. },
  319. dictOptions:{},
  320. superFieldList:[],
  321. }
  322. },
  323. created() {
  324. this.getSuperFieldList();
  325. this.getClientList();
  326. },
  327. computed: {
  328. importExcelUrl: function(){
  329. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  330. },
  331. },
  332. methods: {
  333. // 获得委托单位下拉列表,此方法要在created里,初始化时调用
  334. getClientList(){
  335. getWeituoClientList().then((res) =>{
  336. console.log(res)
  337. this.weituoClientOptions = res.result.map( res => {
  338. return{
  339. value: res,
  340. label: res
  341. }
  342. })
  343. })
  344. },
  345. // 监听触发方法
  346. getWeituoClientOptions(value){
  347. console.log(value);
  348. this.weituoClientQuery.weituoClient = value.key;
  349. console.log('this.weituoClientQuery',this.weituoClientQuery);
  350. console.log('this.weituoClientQuery.weituoClient',this.weituoClientQuery.weituoClient);
  351. getWeituoInfoListByClient(this.weituoClientQuery).then((res) =>{
  352. console.log("this.weituoNoOptions",this.weituoNoOptions),
  353. this.weituoNoOptions = res.result.map( res => {
  354. return{
  355. value: res.id, //传的值
  356. label: res.weituoNo, //展示
  357. }
  358. })
  359. })
  360. },
  361. initDictConfig(){
  362. },
  363. getSuperFieldList(){
  364. let fieldList=[];
  365. fieldList.push({type:'int',value:'shijiShiiyanType_dictText',text:'实绩试验类型',dictCode:'shiyan_type'})
  366. fieldList.push({type:'string',value:'woId',text:'工单id',dictCode:''})
  367. fieldList.push({type:'sel_search',value:'shijiShebeiId',text:'实绩设备id',dictTable:"itdm_device", dictText:'device_name', dictCode:'id'})
  368. fieldList.push({type:'date',value:'workDate',text:'任务日期'})
  369. fieldList.push({type:'string',value:'startTime',text:'试验开始时间',dictCode:''})
  370. fieldList.push({type:'string',value:'endTime',text:'试验结束时间',dictCode:''})
  371. fieldList.push({type:'date',value:'shijiWorkDate',text:'实绩任务日期'})
  372. fieldList.push({type:'string',value:'shijiStartTime',text:'实绩试验开始时间',dictCode:''})
  373. fieldList.push({type:'string',value:'shijiEndTime',text:'实绩试验结束时间',dictCode:''})
  374. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  375. fieldList.push({type:'string',value:'chuanganqi',text:'传感器',dictCode:''})
  376. this.superFieldList = fieldList
  377. }
  378. }
  379. }
  380. </script>
  381. <style scoped>
  382. @import '~@assets/less/common.less';
  383. </style>