project-tech.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <!-- 工种管理 -->
  2. <template>
  3. <div class="work-type">
  4. <template v-if="!assignVisible && !noticeChangeVisible && !submitVisible">
  5. <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
  6. <el-form-item label="任务号">
  7. <el-input v-model="dataForm.orderCode" placeholder="" clearable/>
  8. </el-form-item>
  9. <el-form-item>
  10. <el-button @click="queryData()">查询</el-button>
  11. <el-button @click="noticeSettingHandle(null, false)">通知设置</el-button>
  12. </el-form-item>
  13. </el-form>
  14. <el-table
  15. :data="dataList"
  16. border
  17. v-loading="dataListLoading"
  18. style="width: 100%;">
  19. <el-table-column
  20. label="序号"
  21. type="index"
  22. width="100"
  23. align="center">
  24. </el-table-column>
  25. <el-table-column
  26. prop="projectName"
  27. header-align="center"
  28. align="center"
  29. min-width="140"
  30. :show-tooltip-when-overflow="true"
  31. label="项目名称">
  32. </el-table-column>
  33. <el-table-column
  34. prop="orderCode"
  35. header-align="center"
  36. align="center"
  37. min-width="160"
  38. :show-tooltip-when-overflow="true"
  39. label="任务号">
  40. </el-table-column>
  41. <el-table-column
  42. prop="customerName"
  43. header-align="center"
  44. align="center"
  45. min-width="160"
  46. :show-tooltip-when-overflow="true"
  47. label="客户名称">
  48. </el-table-column>
  49. <el-table-column
  50. prop="deliveryDate"
  51. header-align="center"
  52. align="center"
  53. min-width="160"
  54. :show-tooltip-when-overflow="true"
  55. label="合同交期">
  56. </el-table-column>
  57. <el-table-column
  58. prop="createTime"
  59. header-align="center"
  60. align="center"
  61. min-width="160"
  62. :show-tooltip-when-overflow="true"
  63. label="创建时间">
  64. </el-table-column>
  65. <el-table-column
  66. prop="responsibilityPerson"
  67. header-align="center"
  68. align="center"
  69. min-width="160"
  70. :show-tooltip-when-overflow="true"
  71. label="责任人">
  72. </el-table-column>
  73. <el-table-column
  74. prop="state"
  75. header-align="center"
  76. align="center"
  77. min-width="160"
  78. :show-tooltip-when-overflow="true"
  79. :formatter="formatState"
  80. label="状态">
  81. </el-table-column>
  82. <el-table-column
  83. fixed="right"
  84. header-align="center"
  85. align="center"
  86. width="220"
  87. label="操作">
  88. <template slot-scope="scope">
  89. <el-button type="text" size="small" @click="submitHandle(scope.row, true)">查看</el-button>
  90. <el-button type="text" size="small" @click="assignHandle(scope.row)">分派</el-button>
  91. <el-button type="text" size="small" @click="submitHandle(scope.row, false)">处理</el-button>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. <el-pagination
  96. @size-change="sizeChangeHandle"
  97. @current-change="currentChangeHandle"
  98. :current-page="pageIndex"
  99. :page-sizes="[10, 20, 50, 100]"
  100. :page-size="pageSize"
  101. :total="totalPage"
  102. layout="total, sizes, prev, pager, next, jumper">
  103. </el-pagination>
  104. </template>
  105. <!-- 弹窗 -->
  106. <assign v-if="assignVisible" ref="assign" @onChose="onChose"/>
  107. <notice-change v-if="noticeChangeVisible" ref="noticeChange" @onChose="onChose"/>
  108. <submit-plan v-if="submitVisible" ref="submit" @onChose="onChose"/>
  109. </div>
  110. </template>
  111. <script>
  112. import Assign from '@/views/modules/tech/project-tech-assign'
  113. import NoticeChange from '@/views/modules/tech/project-tech-notice-change-setting'
  114. import SubmitPlan from '@/views/modules/tech/project-tech-submit'
  115. export default {
  116. name: 'plan',
  117. components: {
  118. Assign, NoticeChange, SubmitPlan
  119. },
  120. data () {
  121. return {
  122. assignVisible: false,
  123. noticeChangeVisible: false,
  124. submitVisible: false,
  125. dataForm: {},
  126. dataList: [],
  127. pageIndex: 1,
  128. pageSize: 10,
  129. totalPage: 0,
  130. dataListLoading: false,
  131. dataListSelections: [],
  132. optionsLevel: [],
  133. importLoading: false,
  134. importData: {},
  135. fileList: [],
  136. stateOption: [
  137. {label: '待处理', value: '1'},
  138. {label: '已处理', value: '2'}
  139. ]
  140. }
  141. },
  142. created () {
  143. this.getDataList()
  144. },
  145. methods: {
  146. onChose () {
  147. this.detailVisible = false
  148. this.assignVisible = false
  149. this.noticeChangeVisible = false
  150. this.submitVisible = false
  151. },
  152. // 查询
  153. queryData () {
  154. this.pageIndex = 1
  155. this.getDataList()
  156. },
  157. // 获取数据列表
  158. getDataList () {
  159. this.dataListLoading = true
  160. this.addOrUpdateVisible = false
  161. this.$http({
  162. url: this.$http.adornUrl(`/biz-service/projTechnology/list`),
  163. method: 'get',
  164. params: this.$http.adornParams({
  165. 'current': this.pageIndex,
  166. 'size': this.pageSize,
  167. 'orderCode': this.dataForm.orderCode
  168. })
  169. }).then(({data}) => {
  170. this.dataListLoading = false
  171. if (data && data.code === '200') {
  172. this.dataList = data.data.records
  173. this.totalPage = Number(data.data.total)
  174. } else {
  175. this.dataList = []
  176. this.totalPage = 0
  177. }
  178. })
  179. },
  180. // 每页数
  181. sizeChangeHandle (val) {
  182. this.pageSize = val
  183. this.pageIndex = 1
  184. this.getDataList()
  185. },
  186. // 当前页
  187. currentChangeHandle (val) {
  188. this.pageIndex = val
  189. this.getDataList()
  190. },
  191. // 多选
  192. selectionChangeHandle (val) {
  193. this.dataListSelections = val
  194. },
  195. assignHandle (item) {
  196. this.assignVisible = true
  197. this.$nextTick(() => {
  198. this.$refs.assign.init(item)
  199. })
  200. },
  201. submitHandle (item, readonly) {
  202. this.submitVisible = true
  203. this.$nextTick(() => {
  204. this.$refs.submit.init(item, readonly)
  205. })
  206. },
  207. formatState (row) {
  208. if (!row.state) return ''
  209. return this.getStateStr(row.state)
  210. },
  211. getStateStr (state) {
  212. let option = this.stateOption.find(t => t.value === state)
  213. if (option != null) {
  214. return option.label
  215. }
  216. return ''
  217. },
  218. noticeSettingHandle () {
  219. this.noticeChangeVisible = true
  220. this.$nextTick(() => {
  221. this.$refs.noticeChange.init()
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style scoped>
  228. </style>