ItdmGongdanDetailList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  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:'id',
  194. // align:"center",
  195. // dataIndex: 'id'
  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: 'shebeiId_dictText'
  226. },
  227. {
  228. title:'试验类型',
  229. align:"center",
  230. dataIndex: 'shiiyanType_dictText'
  231. },
  232. {
  233. title:'试验员',
  234. align:"center",
  235. dataIndex: 'worker'
  236. },
  237. {
  238. title:'委托样品数量',
  239. align:"center",
  240. dataIndex: 'yangpinCount'
  241. },
  242. {
  243. title:'任务日期',
  244. align:"center",
  245. dataIndex: 'workDate',
  246. customRender:function (text) {
  247. return !text?"":(text.length>10?text.substr(0,10):text)
  248. }
  249. },
  250. {
  251. title:'试验开始时间',
  252. align:"center",
  253. dataIndex: 'startTime'
  254. },
  255. {
  256. title:'试验结束时间',
  257. align:"center",
  258. dataIndex: 'endTime'
  259. },
  260. {
  261. title:'传感器',
  262. align:"center",
  263. dataIndex: 'chuanganqi_dictText'
  264. // dataIndex: 'chuanganqi'
  265. },
  266. // {
  267. // title:'实绩设备',
  268. // align:"center",
  269. // dataIndex: 'shijiShebeiId_dictText'
  270. // },
  271. // {
  272. // title:'实绩试验类型',
  273. // align:"center",
  274. // dataIndex: 'shijiShiiyanType_dictText'
  275. // },
  276. // {
  277. // title:'实绩任务日期',
  278. // align:"center",
  279. // dataIndex: 'shijiWorkDate',
  280. // customRender:function (text) {
  281. // return !text?"":(text.length>10?text.substr(0,10):text)
  282. // }
  283. // },
  284. // {
  285. // title:'实绩试验开始时间',
  286. // align:"center",
  287. // dataIndex: 'shijiStartTime'
  288. // },
  289. // {
  290. // title:'实绩试验结束时间',
  291. // align:"center",
  292. // dataIndex: 'shijiEndTime'
  293. // },
  294. // {
  295. // title:'工单id',
  296. // align:"center",
  297. // dataIndex: 'woId'
  298. // },
  299. // {
  300. // title:'创建时间',
  301. // align:"center",
  302. // dataIndex: 'createTime'
  303. // },
  304. // {
  305. // title:'备注',F
  306. // align:"center",
  307. // dataIndex: 'remark'
  308. // },
  309. // {
  310. // title: '操作',
  311. // dataIndex: 'action',
  312. // align:"center",
  313. // fixed:"right",
  314. // width:147,
  315. // scopedSlots: { customRender: 'action' }
  316. // }
  317. ],
  318. url: {
  319. list: "/itdmGongdanDetail/itdmGongdanDetail/list",
  320. delete: "/itdmGongdanDetail/itdmGongdanDetail/delete",
  321. deleteBatch: "/itdmGongdanDetail/itdmGongdanDetail/deleteBatch",
  322. exportXlsUrl: "/itdmGongdanDetail/itdmGongdanDetail/exportXls",
  323. importExcelUrl: "itdmGongdanDetail/itdmGongdanDetail/importExcel",
  324. },
  325. dictOptions:{},
  326. superFieldList:[],
  327. }
  328. },
  329. created() {
  330. this.getSuperFieldList();
  331. this.getClientList();
  332. },
  333. computed: {
  334. importExcelUrl: function(){
  335. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  336. },
  337. },
  338. methods: {
  339. // 获得委托单位下拉列表,此方法要在created里,初始化时调用
  340. getClientList(){
  341. getWeituoClientList().then((res) =>{
  342. console.log(res)
  343. this.weituoClientOptions = res.result.map( res => {
  344. return{
  345. value: res,
  346. label: res
  347. }
  348. })
  349. })
  350. },
  351. // 监听触发方法
  352. getWeituoClientOptions(value){
  353. console.log(value);
  354. this.weituoClientQuery.weituoClient = value.key;
  355. console.log('this.weituoClientQuery',this.weituoClientQuery);
  356. console.log('this.weituoClientQuery.weituoClient',this.weituoClientQuery.weituoClient);
  357. getWeituoInfoListByClient(this.weituoClientQuery).then((res) =>{
  358. console.log("this.weituoNoOptions",this.weituoNoOptions),
  359. this.weituoNoOptions = res.result.map( res => {
  360. return{
  361. value: res.id, //传的值
  362. label: res.weituoNo, //展示
  363. }
  364. })
  365. })
  366. },
  367. initDictConfig(){
  368. },
  369. getSuperFieldList(){
  370. let fieldList=[];
  371. fieldList.push({type:'int',value:'shijiShiiyanType_dictText',text:'实绩试验类型',dictCode:'shiyan_type'})
  372. fieldList.push({type:'string',value:'woId',text:'工单id',dictCode:''})
  373. fieldList.push({type:'sel_search',value:'shijiShebeiId',text:'实绩设备id',dictTable:"itdm_device", dictText:'device_name', dictCode:'id'})
  374. fieldList.push({type:'date',value:'workDate',text:'任务日期'})
  375. fieldList.push({type:'string',value:'startTime',text:'试验开始时间',dictCode:''})
  376. fieldList.push({type:'string',value:'endTime',text:'试验结束时间',dictCode:''})
  377. fieldList.push({type:'date',value:'shijiWorkDate',text:'实绩任务日期'})
  378. fieldList.push({type:'string',value:'shijiStartTime',text:'实绩试验开始时间',dictCode:''})
  379. fieldList.push({type:'string',value:'shijiEndTime',text:'实绩试验结束时间',dictCode:''})
  380. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  381. fieldList.push({type:'string',value:'chuanganqi',text:'传感器',dictCode:''})
  382. this.superFieldList = fieldList
  383. }
  384. }
  385. }
  386. </script>
  387. <style scoped>
  388. @import '~@assets/less/common.less';
  389. </style>