SubmissionEquipmentFormFK.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div class="center">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="getSJSBOptions2">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="设备">
  9. <j-search-select-tag placeholder="请选择设备" v-model="queryParam.equipmentid" dict="tpm_equipment,equipmentname,id"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="检定结果">
  14. <j-dict-select-tag placeholder="请选择检定结果" v-model="queryParam.submissionResult" dictCode="device_verification_result"/>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18. <a-form-item label="送检状态">
  19. <j-dict-select-tag placeholder="请选择送检状态" v-model="queryParam.submissionStatus" dictCode="submission_status"/>
  20. </a-form-item>
  21. </a-col>
  22. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  23. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  24. <a-button type="primary" @click="getSJSBOptions2" icon="search">查询</a-button>
  25. <a-button type="primary" @click="getSJSBOptions3" icon="reload" style="margin-left: 8px">重置</a-button>
  26. </span>
  27. </a-col>
  28. </a-row>
  29. </a-form>
  30. </div>
  31. <!-- 查询区域-END -->
  32. <!-- <a-button @click="handleFK">提交反馈</a-button>-->
  33. <a-form-model
  34. :model="formModel"
  35. :rules="formRules"
  36. ref="form">
  37. <a-form-item>
  38. <a-table
  39. size="small"
  40. :scroll="{x:true}"
  41. bordered
  42. rowKey="id"
  43. :columns="columns"
  44. :dataSource="formModel.sjsbdataPoint"
  45. :pagination="false"
  46. class="j-table-force-nowrap">
  47. <template slot="remark" slot-scope="text, record,index">
  48. <a-form-model-item :prop="'sjsbdataPoint.'+index+'.remark'" :rules="formRules.remark" style="margin-bottom: 0px;">
  49. <a-input v-model="record.remark" placeholder="请输入备注"></a-input>
  50. </a-form-model-item>
  51. </template>
  52. <template slot="teamConfirm" slot-scope="text, record,index">
  53. <a-form-model-item :prop="'sjsbdataPoint.'+index+'.teamConfirm'" :rules="formRules.teamConfirm" style="margin-bottom: 0px;">
  54. <a-input v-model="record.teamConfirm" placeholder="请输入班组确认"></a-input>
  55. </a-form-model-item>
  56. </template>
  57. <template slot="submissionReturnDate" slot-scope="text, record,index">
  58. <a-form-model-item :prop="'sjsbdataPoint.'+index+'.submissionReturnDate'" :rules="formRules.submissionReturnDate" style="margin-bottom: 0px;">
  59. <a-date-picker placeholder="请选择送回日期" v-model="record.submissionReturnDate" :show-time="true" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
  60. </a-form-model-item>
  61. </template>
  62. <template slot="submissionDate" slot-scope="text, record,index">
  63. <a-form-model-item :prop="'sjsbdataPoint.'+index+'.submissionDate'" :rules="formRules.submissionDate" style="margin-bottom: 0px;">
  64. <a-date-picker placeholder="请选择检定日期" v-model="record.submissionDate" :show-time="true" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
  65. </a-form-model-item>
  66. </template>
  67. <template slot="submissionStatus" slot-scope="text, record,index">
  68. <a-form-model-item :prop="'sjsbdataPoint.'+index+'.submissionStatus'" :rules="formRules.submissionStatus" style="margin-bottom: 0px;">
  69. <j-dict-select-tag placeholder="请选择送检状态" v-model="record.submissionStatus" dictCode="submission_status"/>
  70. </a-form-model-item>
  71. </template>
  72. <template slot="submissionResult" slot-scope="text, record,index">
  73. <a-form-model-item :prop="'sjsbdataPoint.'+index+'.submissionResult'" :rules="formRules.submissionResult" style="margin-bottom: 0px;">
  74. <j-dict-select-tag placeholder="请选择检定结果" v-model="record.submissionResult" dictCode="device_verification_result"/>
  75. </a-form-model-item>
  76. </template>
  77. </a-table>
  78. </a-form-item>
  79. </a-form-model>
  80. </div>
  81. </template>
  82. <script>
  83. import '@/assets/less/TableExpand.less'
  84. import { mixinDevice } from '@/utils/mixin'
  85. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  86. import SubmissionEquipmentModalFK from "@views/module_cmms/submission/modulesFK/SubmissionEquipmentModalFK";
  87. import {getAction, httpAction} from "@api/manage";
  88. export default {
  89. name: 'SubmissionEquipmentformFK',
  90. mixins:[JeecgListMixin, mixinDevice],
  91. components: {
  92. SubmissionEquipmentModalFK
  93. },
  94. data () {
  95. return {
  96. //送检工单id
  97. csId: '',
  98. //送检工单设备查询参数
  99. queryParam: {},
  100. // // 送检设备及相关数据
  101. // sjsbdataPoint: [],
  102. formModel: {
  103. // 送检设备及相关数据
  104. sjsbdataPoint: [],
  105. },
  106. formRules:{},
  107. description: '送检工单设备表管理页面',
  108. // 表头
  109. columns: [
  110. {
  111. title: '序号',
  112. dataIndex: '',
  113. key:'rowIndex',
  114. width:60,
  115. align:"center",
  116. customRender:function (t,r,index) {
  117. return parseInt(index)+1;
  118. }
  119. },
  120. // {
  121. // title:'送检工单id',
  122. // align:"center",
  123. // dataIndex: 'cmmsSubmissionId'
  124. // },
  125. {
  126. title:'设备',
  127. align:"center",
  128. dataIndex: 'equipmentid_dictText'
  129. },
  130. {
  131. title:'检定日期',
  132. align:"center",
  133. dataIndex: 'submissionDate',
  134. scopedSlots: { customRender: 'submissionDate' }
  135. },
  136. {
  137. title:'检定结果',
  138. align:"center",
  139. width:90,
  140. dataIndex: 'submissionResult_dictText',
  141. scopedSlots: { customRender: 'submissionResult' }
  142. },
  143. {
  144. title:'班组确认',
  145. align:"center",
  146. dataIndex: 'teamConfirm',
  147. scopedSlots: { customRender: 'teamConfirm' }
  148. },
  149. {
  150. title:'备注',
  151. align:"center",
  152. dataIndex: 'remark',
  153. scopedSlots: { customRender: 'remark' }
  154. },
  155. {
  156. title:'送检状态',
  157. align:"center",
  158. width:100,
  159. dataIndex: 'submissionStatus_dictText',
  160. scopedSlots: { customRender: 'submissionStatus' }
  161. },
  162. {
  163. title:'送回日期',
  164. align:"center",
  165. dataIndex: 'submissionReturnDate',
  166. scopedSlots: { customRender: 'submissionReturnDate' }
  167. },
  168. {
  169. title:'有效日期',
  170. align:"center",
  171. dataIndex: 'submissionEffectiveDate'
  172. },
  173. // {
  174. // title: '操作',
  175. // dataIndex: 'action',
  176. // align:"center",
  177. // fixed:"right",
  178. // width:147,
  179. // scopedSlots: { customRender: 'fk' }
  180. // }
  181. ],
  182. url: {
  183. list: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/list",
  184. fk: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/fk",
  185. },
  186. }
  187. },
  188. methods: {
  189. handleFK(){
  190. },
  191. getSJSBOptions(cmmsSubmissionId) {
  192. this.csId = cmmsSubmissionId
  193. getAction(this.url.list, {cmmsSubmissionId:cmmsSubmissionId}).then((res) => {
  194. this.formModel.sjsbdataPoint = res.result.records
  195. })
  196. },
  197. getSJSBOptions2() {
  198. this.queryParam.cmmsSubmissionId = this.csId
  199. getAction(this.url.list, this.queryParam).then((res) => {
  200. this.formModel.sjsbdataPoint = res.result.records
  201. })
  202. },
  203. getSJSBOptions3() {
  204. this.queryParam = {}
  205. this.queryParam.cmmsSubmissionId = this.csId
  206. getAction(this.url.list, this.queryParam).then((res) => {
  207. this.formModel.sjsbdataPoint = res.result.records
  208. })
  209. },
  210. submitForm () {
  211. const that = this;
  212. // 触发表单验证
  213. this.$refs.form.validate(valid => {
  214. if (valid) {
  215. that.confirmLoading = true;
  216. let httpurl = '';
  217. let method = '';
  218. httpurl+=this.url.fk;
  219. method = 'put';
  220. // if(!this.model.id){
  221. // httpurl+=this.url.add;
  222. // method = 'post';
  223. // }else{
  224. // httpurl+=this.url.edit;
  225. // method = 'put';
  226. // }
  227. console.log("this.formModel.sjsbdataPoint",this.formModel.sjsbdataPoint)
  228. httpAction(httpurl,this.formModel.sjsbdataPoint,method).then((res)=>{
  229. if(res.success){
  230. that.$message.success(res.message);
  231. that.$emit('ok');
  232. }else{
  233. that.$message.warning(res.message);
  234. }
  235. }).finally(() => {
  236. that.confirmLoading = false;
  237. })
  238. }
  239. })
  240. },
  241. }
  242. }
  243. </script>
  244. <style scoped>
  245. @import '~@assets/less/common.less';
  246. </style>