plan-submit.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <div>
  3. <div class="my-title">分派</div>
  4. <el-form
  5. :model="dataForm"
  6. :rules="dataRule"
  7. ref="dataForm"
  8. label-width="auto"
  9. >
  10. <el-row class="my-row">
  11. <el-col :span="6">
  12. <el-form-item label="项目名称:" prop="projectName">
  13. <span>{{dataForm.projectName}}</span>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="6">
  17. <el-form-item label="任务号:" prop="orderCode">
  18. <span>{{dataForm.orderCode}}</span>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="6">
  22. <el-form-item label="技术协议:" prop="attachFile1">
  23. <span @click="attachDetail(dataForm.attachFile1)">{{dataForm.attachFile1 == null ? '' : dataForm.attachFile1[0].fileName}}</span>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="6">
  27. <el-form-item label="资料:" prop="attachFile2">
  28. <span @click="attachDetail(dataForm.attachFile1)">{{dataForm.attachFile2 == null ? '' : dataForm.attachFile2[0].fileName}}</span>
  29. </el-form-item>
  30. </el-col>
  31. </el-row>
  32. <el-table
  33. :data="dataForm.proProductList"
  34. border
  35. v-loading="dataListLoading"
  36. style="width: 100%;">
  37. <el-table-column
  38. label="序号"
  39. type="index"
  40. width="100"
  41. align="center">
  42. </el-table-column>
  43. <el-table-column
  44. prop="productName"
  45. header-align="center"
  46. align="center"
  47. min-width="140"
  48. :show-tooltip-when-overflow="true"
  49. label="名称">
  50. </el-table-column>
  51. <el-table-column
  52. prop="mapNumber"
  53. header-align="center"
  54. align="center"
  55. min-width="140"
  56. :show-tooltip-when-overflow="true"
  57. label="图号">
  58. </el-table-column>
  59. <el-table-column
  60. prop="versionNumber"
  61. header-align="center"
  62. align="center"
  63. min-width="140"
  64. :show-tooltip-when-overflow="true"
  65. label="版本号">
  66. </el-table-column>
  67. <el-table-column
  68. prop="attachList2"
  69. header-align="center"
  70. align="center"
  71. min-width="140"
  72. :show-tooltip-when-overflow="true"
  73. label="简图">
  74. <template slot-scope="scope">
  75. <el-button :disabled="!scope.row.attachList2 || scope.row.attachList2.length === 0" type="text" size="small" @click="attachDetail(scope.row.attachList2)">查看</el-button>
  76. </template>
  77. </el-table-column>
  78. <el-table-column
  79. prop="unit"
  80. header-align="center"
  81. align="center"
  82. min-width="140"
  83. :show-tooltip-when-overflow="true"
  84. label="单位">
  85. </el-table-column>
  86. <el-table-column
  87. prop="cnt"
  88. header-align="center"
  89. align="center"
  90. min-width="140"
  91. :show-tooltip-when-overflow="true"
  92. label="单套数量">
  93. </el-table-column>
  94. <el-table-column
  95. prop="productSpec"
  96. header-align="center"
  97. align="center"
  98. min-width="140"
  99. :show-tooltip-when-overflow="true"
  100. label="材料规格">
  101. </el-table-column>
  102. <el-table-column
  103. prop="size"
  104. header-align="center"
  105. align="center"
  106. min-width="140"
  107. :show-tooltip-when-overflow="true"
  108. label="净尺寸">
  109. </el-table-column>
  110. <el-table-column
  111. prop="projectName"
  112. header-align="center"
  113. align="center"
  114. min-width="140"
  115. :show-tooltip-when-overflow="true"
  116. label="表处理">
  117. </el-table-column>
  118. <el-table-column
  119. prop="heatTreatment"
  120. header-align="center"
  121. align="center"
  122. min-width="140"
  123. :show-tooltip-when-overflow="true"
  124. label="热处理">
  125. </el-table-column>
  126. <el-table-column
  127. prop="projectName"
  128. header-align="center"
  129. align="center"
  130. min-width="140"
  131. :show-tooltip-when-overflow="true"
  132. label="关重性">
  133. </el-table-column>
  134. <el-table-column
  135. prop="notes"
  136. header-align="center"
  137. align="center"
  138. min-width="140"
  139. :show-tooltip-when-overflow="true"
  140. label="备注">
  141. </el-table-column>
  142. <el-table-column
  143. prop="materialCnt"
  144. header-align="center"
  145. align="center"
  146. min-width="140"
  147. :show-tooltip-when-overflow="true"
  148. label="库存数">
  149. </el-table-column>
  150. <el-table-column
  151. prop="planCnt"
  152. header-align="center"
  153. align="center"
  154. min-width="140"
  155. :show-tooltip-when-overflow="true"
  156. label="订单计划数量">
  157. </el-table-column>
  158. <el-table-column
  159. fixed="right"
  160. prop="projectName"
  161. header-align="center"
  162. align="center"
  163. width="120"
  164. :show-tooltip-when-overflow="true"
  165. label="处置">
  166. <template slot-scope="scope">
  167. <div class="radio-wrapper">
  168. <el-radio-group v-model="scope.row.disposal" class="radio-group-wrap">
  169. <el-radio :label="2" style="margin-left:0">采购件</el-radio>
  170. <el-radio :label="3" style="margin-left:0">委外件</el-radio>
  171. <el-radio :label="1" style="margin-left:0">自制件</el-radio>
  172. </el-radio-group>
  173. </div>
  174. </template>
  175. </el-table-column>
  176. <el-table-column
  177. fixed="right"
  178. prop="projectName"
  179. header-align="center"
  180. align="center"
  181. width="120"
  182. :show-tooltip-when-overflow="true"
  183. label="工艺">
  184. <template slot-scope="scope">
  185. <el-radio-group v-model="scope.row.isTechnology" class="radio-group-wrap">
  186. <el-radio :label="1" style="margin-left:0">需要</el-radio>
  187. <el-radio :label="2" style="margin-left:0">不需要</el-radio>
  188. </el-radio-group>
  189. </template>
  190. </el-table-column>
  191. </el-table>
  192. </el-form>
  193. <span slot="footer" class="dialog-footer">
  194. <el-button @click="onChose">取消</el-button>
  195. <el-button
  196. type="primary"
  197. @click="dataFormSubmit()"
  198. v-reClick
  199. >确定</el-button
  200. >
  201. </span>
  202. <attach-detail-dialog ref="attachDetail"/>
  203. </div>
  204. </template>
  205. <script>
  206. import UserComponent from '../common/user-component'
  207. import AttachDetailDialog from '../common/attach-detail-dialog'
  208. export default {
  209. name: 'plan-assign',
  210. components: { UserComponent, AttachDetailDialog },
  211. computed: {},
  212. data () {
  213. return {
  214. readonly: false,
  215. id: 0,
  216. dataForm: {
  217. proProductList:[]
  218. },
  219. dataRule: {},
  220. dataList: [],
  221. dataListLoading: false
  222. }
  223. },
  224. created () {},
  225. beforeDestroy () {},
  226. methods: {
  227. onChose () {
  228. this.$emit('onChose')
  229. },
  230. async init (item, readonly) {
  231. let id = item.productionManagementId;
  232. if(readonly){
  233. this.readonly = true
  234. }
  235. this.$http({
  236. url: this.$http.adornUrl(`/biz-service/projProduction/info/${id}`),
  237. method: 'get'
  238. }).then(({data}) => {
  239. if(data && data.code === '200'){
  240. this.dataForm = data.data;
  241. } else {
  242. this.$message.error(data.msg)
  243. }
  244. })
  245. this.dataList = [{disposal:'', isTechnology:''}]
  246. this.visible = true
  247. },
  248. validateField (type) {
  249. this.$refs.dataForm.validateField(type)
  250. },
  251. attachDetail (attachList) {
  252. this.$nextTick(() => {
  253. this.$refs.attachDetail.init(attachList)
  254. })
  255. },
  256. // 表单提交
  257. dataFormSubmit () {
  258. this.$refs['dataForm'].validate((valid) => {
  259. if (valid) {
  260. this.$http({
  261. url: this.$http.adornUrl(`/biz-service/projProduction/assign`),
  262. method: 'post',
  263. data: this.$http.adornData({
  264. productionManagementId: this.dataForm.productionManagementId,
  265. responsibilityPerson: this.dataForm.responsibilityPerson
  266. })
  267. }).then(({ data }) => {
  268. if (data && data.code === '200') {
  269. this.$message({
  270. message: '操作成功',
  271. type: 'success',
  272. duration: 1500,
  273. onClose: () => {
  274. this.onChose()
  275. this.$emit('refreshDataList')
  276. }
  277. })
  278. } else {
  279. this.$message.error(data.msg)
  280. }
  281. })
  282. }
  283. })
  284. },
  285. selectChange (val) {
  286. this.dataForm.responsibilityPerson = val
  287. }
  288. }
  289. }
  290. </script>
  291. <style>
  292. .my-row {
  293. margin-bottom: 20px;
  294. }
  295. .radio-group-wrap {
  296. display: flex;
  297. align-items: flex-start;
  298. flex-direction: column;
  299. gap: 10px 0px; /* 行列间距控制 */
  300. }
  301. </style>