project-tech-submit.vue 8.5 KB

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