first.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <!-- 首件鉴定 -->
  2. <template>
  3. <div>
  4. <template v-if="!updateVisible && !detailVisible">
  5. <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
  6. <el-form-item label="物料名称">
  7. <el-input
  8. v-model="dataForm.productName"
  9. placeholder="请输入物料名称"
  10. clearable
  11. />
  12. </el-form-item>
  13. <el-form-item label="生产批次号">
  14. <el-input
  15. v-model="dataForm.batchNumber"
  16. placeholder="请输入批次号"
  17. clearable
  18. />
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button @click="search()">查询</el-button>
  22. </el-form-item>
  23. </el-form>
  24. <el-table
  25. :data="dataList"
  26. border
  27. v-loading="dataListLoading"
  28. style="width: 100%"
  29. >
  30. <el-table-column
  31. label="序号"
  32. type="index"
  33. width="50"
  34. align="center"
  35. ></el-table-column>
  36. <el-table-column
  37. prop="authenticateCode"
  38. header-align="center"
  39. align="center"
  40. :show-tooltip-when-overflow="true"
  41. label="首件鉴定编码"
  42. >
  43. </el-table-column>
  44. <el-table-column
  45. prop="orderCode"
  46. header-align="center"
  47. align="center"
  48. :show-tooltip-when-overflow="true"
  49. label="任务单编码"
  50. >
  51. </el-table-column>
  52. <el-table-column
  53. prop="productName"
  54. header-align="center"
  55. align="center"
  56. :show-tooltip-when-overflow="true"
  57. label="物料名称"
  58. >
  59. </el-table-column>
  60. <el-table-column
  61. prop="productNumber"
  62. header-align="center"
  63. align="center"
  64. :show-tooltip-when-overflow="true"
  65. label="物料编号"
  66. >
  67. </el-table-column>
  68. <el-table-column
  69. prop="batchNumber"
  70. header-align="center"
  71. align="center"
  72. :show-tooltip-when-overflow="true"
  73. label="批次号"
  74. >
  75. </el-table-column>
  76. <el-table-column
  77. prop=""
  78. header-align="center"
  79. align="center"
  80. :show-tooltip-when-overflow="true"
  81. label="系统生产记录"
  82. >
  83. </el-table-column>
  84. <el-table-column
  85. prop="attachList1"
  86. header-align="center"
  87. align="center"
  88. :show-tooltip-when-overflow="true"
  89. label="首件生产流程记录表"
  90. >
  91. <template slot-scope="scope">
  92. <el-button
  93. :disabled="
  94. !scope.row.attachList1 || scope.row.attachList1.length === 0
  95. "
  96. type="text"
  97. size="small"
  98. @click="attachDetails(scope.row.attachList1)"
  99. >查看</el-button
  100. >
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. prop="attachList2"
  105. header-align="center"
  106. align="center"
  107. :show-tooltip-when-overflow="true"
  108. label="首件生产过程原始记录"
  109. >
  110. <template slot-scope="scope">
  111. <el-button
  112. :disabled="
  113. !scope.row.attachList2 || scope.row.attachList2.length === 0
  114. "
  115. type="text"
  116. size="small"
  117. @click="attachDetails(scope.row.attachList2)"
  118. >查看</el-button
  119. >
  120. </template>
  121. </el-table-column>
  122. <el-table-column
  123. prop="attachList3"
  124. header-align="center"
  125. align="center"
  126. :show-tooltip-when-overflow="true"
  127. label="首件鉴定检验报告"
  128. >
  129. <template slot-scope="scope">
  130. <el-button
  131. :disabled="
  132. !scope.row.attachList3 || scope.row.attachList3.length === 0
  133. "
  134. type="text"
  135. size="small"
  136. @click="attachDetails(scope.row.attachList3)"
  137. >查看</el-button
  138. >
  139. </template>
  140. </el-table-column>
  141. <el-table-column
  142. prop="attachList4"
  143. header-align="center"
  144. align="center"
  145. :show-tooltip-when-overflow="true"
  146. label="首件鉴定审查报告"
  147. >
  148. <template slot-scope="scope">
  149. <el-button
  150. :disabled="
  151. !scope.row.attachList4 || scope.row.attachList4.length === 0
  152. "
  153. type="text"
  154. size="small"
  155. @click="attachDetails(scope.row.attachList4)"
  156. >查看</el-button
  157. >
  158. </template>
  159. </el-table-column>
  160. <el-table-column
  161. prop="attachList5"
  162. header-align="center"
  163. align="center"
  164. :show-tooltip-when-overflow="true"
  165. label="首件鉴定评审结论"
  166. >
  167. <template slot-scope="scope">
  168. <el-button
  169. :disabled="
  170. !scope.row.attachList5 || scope.row.attachList5.length === 0
  171. "
  172. type="text"
  173. size="small"
  174. @click="attachDetails(scope.row.attachList5)"
  175. >查看</el-button
  176. >
  177. </template>
  178. </el-table-column>
  179. <el-table-column
  180. prop="approveStateStr"
  181. header-align="center"
  182. align="center"
  183. :show-tooltip-when-overflow="true"
  184. label="评审状态"
  185. >
  186. </el-table-column>
  187. <el-table-column
  188. prop="approver"
  189. header-align="center"
  190. align="center"
  191. :show-tooltip-when-overflow="true"
  192. label="当前评审人"
  193. >
  194. </el-table-column>
  195. <el-table-column
  196. fixed="right"
  197. header-align="center"
  198. align="center"
  199. width="150"
  200. label="操作"
  201. >
  202. <template slot-scope="scope">
  203. <el-button type="text" size="small" @click="detailHandle(scope.row.authenticateId)">详情</el-button>
  204. <el-button
  205. v-if="isAuth('first:authenticate:update')"
  206. type="text"
  207. size="small"
  208. @click="updateHandle(scope.row)"
  209. >上传</el-button
  210. >
  211. <el-button
  212. v-if="isAuth('first:authenticate:update')"
  213. type="text"
  214. size="small"
  215. @click="deleteHandle(scope.row.authenticateId)"
  216. >删除</el-button
  217. >
  218. </template>
  219. </el-table-column>
  220. </el-table>
  221. <el-pagination
  222. @size-change="sizeChangeHandle"
  223. @current-change="currentChangeHandle"
  224. :current-page="pageIndex"
  225. :page-sizes="[10, 20, 50, 100]"
  226. :page-size="pageSize"
  227. :total="totalPage"
  228. layout="total, sizes, prev, pager, next, jumper"
  229. >
  230. </el-pagination>
  231. </template>
  232. <quality-first-update ref="update" v-if="updateVisible" @onChose="onChose" />
  233. <attach-detail-dialog ref="attachDetail" v-if="attachVisible" @onChose="onChose" />
  234. <first-detail ref="detail" v-if="detailVisible" @onChose="onChose" />
  235. </div>
  236. </template>
  237. <script>
  238. import {getList, delFirst} from '@/api/quality'
  239. import QualityFirstUpdate from './first-update'
  240. import AttachDetailDialog from '../common/attach-detail-dialog'
  241. import {approveStateOption} from '@/utils/enums'
  242. import FirstDetail from '@/views/modules/quality/first-detail'
  243. export default {
  244. name: 'quality-first',
  245. components: {FirstDetail, QualityFirstUpdate, AttachDetailDialog},
  246. data () {
  247. return {
  248. updateVisible: false,
  249. attachVisible: false,
  250. detailVisible: false,
  251. approveStateOption: approveStateOption,
  252. dataForm: {},
  253. dataList: [],
  254. pageIndex: 1,
  255. pageSize: 10,
  256. totalPage: 0,
  257. dataListLoading: false
  258. }
  259. },
  260. mounted () {},
  261. created () {
  262. this.search()
  263. },
  264. methods: {
  265. onChose () {
  266. this.updateVisible = false
  267. this.detailVisible = false
  268. },
  269. search () {
  270. this.pageIndex = 1
  271. this.getDataList()
  272. },
  273. // 每页数
  274. sizeChangeHandle (val) {
  275. this.pageSize = val
  276. this.pageIndex = 1
  277. this.getDataList()
  278. },
  279. // 当前页
  280. currentChangeHandle (val) {
  281. this.pageIndex = val
  282. this.getDataList()
  283. },
  284. getDataList () {
  285. this.dataListLoading = true
  286. let param = {
  287. current: this.pageIndex,
  288. size: this.pageSize,
  289. batchNumber: this.dataForm.batchNumber,
  290. productName: this.dataForm.productName
  291. }
  292. getList(param).then(({ data }) => {
  293. if (data && data.code === '200') {
  294. this.dataList = data.data.records
  295. this.totalPage = Number(data.data.total)
  296. this.dataList.forEach(item => {
  297. let option = this.approveStateOption.find(t => t.value === item.approveState)
  298. if (option != null) {
  299. item.approveStateStr = option.label
  300. }
  301. })
  302. } else {
  303. this.dataList = []
  304. this.totalPage = 0
  305. }
  306. this.dataListLoading = false
  307. })
  308. },
  309. attachDetails (attachList) {
  310. this.attachVisible = true
  311. this.$nextTick(() => {
  312. this.$refs.attachDetail.init(attachList)
  313. })
  314. },
  315. updateHandle (item) {
  316. this.updateVisible = true
  317. this.$nextTick(() => {
  318. this.$refs.update.init(item)
  319. })
  320. },
  321. detailHandle (id) {
  322. this.detailVisible = true
  323. this.$nextTick(() => {
  324. this.$refs.detail.init(id)
  325. })
  326. },
  327. deleteHandle (id) {
  328. this.$confirm('是否确认要删除?', '提示', {
  329. confirmButtonText: '确定',
  330. cancelButtonText: '取消',
  331. type: 'warning'
  332. }).then(() => {
  333. delFirst({authenticateIds: [id]}).then(({data}) => {
  334. if (data && data.code === '200') {
  335. this.$message({
  336. type: 'success',
  337. message: '删除成功!',
  338. duration: 1500,
  339. onClose: () => {
  340. this.search()
  341. }
  342. })
  343. } else {
  344. this.$message({
  345. type: 'error',
  346. message: data.msg
  347. })
  348. }
  349. })
  350. }).catch(() => {
  351. this.$message({
  352. type: 'info',
  353. message: '已取消删除'
  354. })
  355. })
  356. }
  357. }
  358. }
  359. </script>
  360. <style lang="scss" scoped>
  361. </style>