project-tech-submit.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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="isTechnology"
  136. header-align="center"
  137. align="center"
  138. min-width="140"
  139. :show-tooltip-when-overflow="true"
  140. label="是否编制工艺">
  141. <template slot-scope="scope">
  142. {{scope.row.isTechnology == 2 ? '否' : '是' }}
  143. </template>
  144. </el-table-column>
  145. <el-table-column
  146. prop="techId"
  147. header-align="center"
  148. align="center"
  149. min-width="140"
  150. :show-tooltip-when-overflow="true"
  151. label="是否有工艺">
  152. <template slot-scope="scope">
  153. {{scope.row.techId == null || scope.row.techId == 0 ? '否' : '是' }}
  154. </template>
  155. </el-table-column>
  156. <el-table-column
  157. prop="notes"
  158. header-align="center"
  159. align="center"
  160. min-width="140"
  161. :show-tooltip-when-overflow="true"
  162. label="备注">
  163. </el-table-column>
  164. <el-table-column
  165. v-if="!disabled"
  166. fixed="right"
  167. prop="disposal"
  168. header-align="center"
  169. align="center"
  170. width="120"
  171. :show-tooltip-when-overflow="true"
  172. label="操作">
  173. <template slot-scope="scope">
  174. <el-button type="text" v-if="scope.row.techId == null || scope.row.techId == 0">新建工艺</el-button>
  175. <el-button type="text" v-else>修改工艺</el-button>
  176. </template>
  177. </el-table-column>
  178. </el-table>
  179. </el-form>
  180. <span slot="footer" class="dialog-footer">
  181. <el-button @click="onChose">取消</el-button>
  182. </span>
  183. <attach-detail-dialog ref="attachDetail"/>
  184. </div>
  185. </template>
  186. <script>
  187. import AttachDetailDialog from '../common/attach-detail-dialog'
  188. export default {
  189. name: 'plan-submit',
  190. components: { AttachDetailDialog },
  191. computed: {},
  192. data () {
  193. return {
  194. disabled: false,
  195. id: 0,
  196. dataForm: {
  197. proProductList: []
  198. },
  199. dataRule: {
  200. planCnt: [{required: true, message: '请输入', trigger: 'blur'}],
  201. disposal: [{required: true, message: '请选择', trigger: 'change'}],
  202. isTechnology: [{required: true, message: '请选择', trigger: 'change'}]
  203. },
  204. dataList: [],
  205. dataListLoading: false
  206. }
  207. },
  208. created () {},
  209. beforeDestroy () {},
  210. methods: {
  211. onChose () {
  212. this.$emit('onChose')
  213. },
  214. async init (item, readonly) {
  215. let id = item.technologyId
  216. if (readonly) {
  217. this.disabled = true
  218. }
  219. this.$http({
  220. url: this.$http.adornUrl(`/biz-service/projTechnology/info/${id}`),
  221. method: 'get'
  222. }).then(({data}) => {
  223. if (data && data.code === '200') {
  224. this.dataForm = data.data
  225. } else {
  226. this.$message.error(data.msg)
  227. }
  228. })
  229. },
  230. validateField (type) {
  231. this.$refs.dataForm.validateField(type)
  232. },
  233. attachDetail (attachList) {
  234. this.$nextTick(() => {
  235. this.$refs.attachDetail.init(attachList)
  236. })
  237. },
  238. // 表单提交
  239. dataFormSubmit () {
  240. this.$refs['dataForm'].validate((valid) => {
  241. if (valid) {
  242. let data = {
  243. orderCode: this.dataForm.orderCode,
  244. proProductList: this.dataForm.proProductList
  245. }
  246. console.log('data', data)
  247. this.$http({
  248. url: this.$http.adornUrl(`/biz-service/projProduction/submitPlan`),
  249. method: 'post',
  250. data: this.$http.adornData(data)
  251. }).then(({ data }) => {
  252. if (data && data.code === '200') {
  253. this.$message({
  254. message: '操作成功',
  255. type: 'success',
  256. duration: 1500,
  257. onClose: () => {
  258. this.onChose()
  259. this.$emit('refreshDataList')
  260. }
  261. })
  262. } else {
  263. this.$message.error(data.msg)
  264. }
  265. })
  266. }
  267. })
  268. }
  269. }
  270. }
  271. </script>
  272. <style>
  273. .my-row {
  274. margin-bottom: 20px;
  275. }
  276. .radio-group-wrap {
  277. display: flex;
  278. align-items: flex-start;
  279. flex-direction: column;
  280. gap: 10px 0px; /* 行列间距控制 */
  281. }
  282. </style>