ItdmGongdanDetailList.vue 14 KB

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