itdmXqPingshen.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <div class="u-OA-jixiao">
  3. <div class="head">第二部分 试验需求评审</div>
  4. <table class="main-table">
  5. <tr>
  6. <td class="title" style="width: 100px;">技术线</td>
  7. <td class="content" style="width: 440px;">
  8. <div>
  9. <el-checkbox-group v-model="tableData.checkList" :disabled='disabled1'>
  10. <div class="jishuxian">
  11. <el-checkbox label="气候环境"></el-checkbox>
  12. <el-checkbox label="力学环境"></el-checkbox>
  13. <el-checkbox label="综合环境"></el-checkbox>
  14. <el-checkbox label="可靠性试验"></el-checkbox>
  15. <el-checkbox label="仿真计算"></el-checkbox>
  16. <el-checkbox label="模态试验"></el-checkbox>
  17. <el-checkbox label="外场测试"></el-checkbox>
  18. <el-checkbox label="课题研究"></el-checkbox>
  19. <el-checkbox label="淋雨试验"></el-checkbox>
  20. <el-checkbox label="沙尘试验"></el-checkbox>
  21. <el-checkbox label="静强度"></el-checkbox>
  22. <el-checkbox label="其他"></el-checkbox>
  23. </div>
  24. </el-checkbox-group>
  25. </div>
  26. </td>
  27. <td class="title white" style="width: 100px;">产品线</td>
  28. <td class="content" style="width: 440px;">
  29. <el-checkbox-group v-model="tableData.checkList2" :disabled='disabled1'>
  30. <div class="jishuxian" style="justify-content: center;">
  31. <el-checkbox label="检测试验"></el-checkbox>
  32. <el-checkbox label="研制试验"></el-checkbox>
  33. </div>
  34. </el-checkbox-group>
  35. </td>
  36. </tr>
  37. <tr>
  38. <td class="title" style="width: 100px;">试验分级</td>
  39. <td class="content" style="width: 440px;">
  40. <div style="display: flex;justify-content: center;color: red;align-items:center;">重要性系数:
  41. <input v-model="tableData.factor" :disabled='disabled1'/>
  42. </div>
  43. </td>
  44. <td class="title white" style="width: 100px">重要性标准</td>
  45. <td class="content" style="width: 450px">
  46. <div class="jishuxian" style="justify-content: center;">气候试验:0.40  力学试验:0.70  重要/非标试验:1.00</div>
  47. <!-- <div class="jishuxian" style="justify-content: center;">重要试验:1.00  非标试验:1.00</div> -->
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="title" style="width: 100px;">试验等级</td>
  52. <td class="content" style="width: 360px;">
  53. <div style="display: flex; align-items: flex-end;">
  54. <table>
  55. <tr>
  56. <td>序号</td>
  57. <td>试验类型</td>
  58. <td>实验内容</td>
  59. <td>设备选择</td>
  60. <td style="width: 60px">操作</td>
  61. </tr>
  62. <tr v-for="(item, index) in tableData.testDengji" :key="index">
  63. <td>{{ index + 1 }}</td>
  64. <td><input style="max-width: 100px; text-align: center" v-model="item.type" :disabled='disabled1'/></td>
  65. <td><input style="max-width: 100px; text-align: center" v-model="item.neirong" :disabled='disabled1'/></td>
  66. <td><input style="max-width: 100px; text-align: center" v-model="item.device" :disabled='disabled1'/></td>
  67. <!-- <td><div class="delBtn" @click="delRow(index)" v-show="tableData.testDengji.length >= 2">删除</div></td> -->
  68. <td><el-button class="delBtn" @click="delRow(index)" v-show="tableData.testDengji.length >= 2" :disabled='disabled1'>删除</el-button></td>
  69. </tr>
  70. </table>
  71. <!-- <div class="addRow" style="margin-right:1.1%" @click="addRow">添加</div> -->
  72. <el-button class="addRow" style="margin-right:1.1%" @click="addRow" :disabled='disabled1'>添加</el-button>
  73. </div>
  74. </td>
  75. <td class="title white" style="width: 100px;">备注</td>
  76. <td class="content" style="width: 450px;">
  77. <input v-model="tableData.shuruLeixing" style="text-align: center" :disabled='disabled1'/>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td class="title" style="width: 100px;">三外需求</td>
  82. <td class="content" style="width: 360px;" colspan="3">
  83. <div style="display: flex; align-items: flex-end;">
  84. <table>
  85. <tr>
  86. <td>序号</td>
  87. <td>类型</td>
  88. <td>项目</td>
  89. <td>单位</td>
  90. <td>预算</td>
  91. <td style="width: 60px">操作</td>
  92. </tr>
  93. <tr v-for="(item, index) in tableData.demandSanwai" :key="index">
  94. <td>{{ index + 1 }}</td>
  95. <td><input style="max-width: 100px; text-align: center" v-model="item.leixing" :disabled='disabled1'/></td>
  96. <td><input style="max-width: 100px; text-align: center" v-model="item.xiangmu" :disabled='disabled1'/></td>
  97. <td><input style="max-width: 100px; text-align: center" v-model="item.danwei" :disabled='disabled1'/></td>
  98. <td><input style="max-width: 100px; text-align: center" v-model="item.yusuan" :disabled='disabled1'/></td>
  99. <!-- <td><div class="delBtn" @click="delRow2(index)" v-show="tableData.demandSanwai.length >= 2">删除</div></td> -->
  100. <td><el-button class="delBtn" @click="delRow2(index)" v-show="tableData.demandSanwai.length >= 2" :disabled='disabled1'>删除</el-button></td>
  101. </tr>
  102. <tr>
  103. <td style="font-weight: bold;">合计</td>
  104. <td></td>
  105. <td></td>
  106. <td></td>
  107. <td style="font-weight: bold;">{{ totalCleanPrice }}</td>
  108. </tr>
  109. </table>
  110. <!-- <div class="addRow" @click="addRow2">添加</div> -->
  111. <el-button class="addRow" @click="addRow2" :disabled='disabled1'>添加</el-button>
  112. <div class="btn" style="margin-right:1.1%" @click="addSubTable1">保存</div>
  113. </div>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td class="title" style="width: 100px;">评审结论</td>
  118. <td class="content" style="width: 360px;">
  119. <el-radio-group v-model="tableData22.radio" :disabled='disabled2'>
  120. <el-radio :label="1">可以满足</el-radio>
  121. <el-radio :label="2">部分满足</el-radio>
  122. <el-radio :label="3">不能满足</el-radio>
  123. </el-radio-group>
  124. </td>
  125. <td class="title white" style="width: 100px;">主审人</td>
  126. <td class="content" style="width: 450px;">
  127. <div style="height:50px;width: 450px;text-align: center;line-height: 50px;">{{ fqUserName }}  时间: {{ shenheTime }}</div>
  128. <!-- {{ fqUserName }}  时间 {{ shenheTime }} -->
  129. <!-- <input v-model="tableData.shuruLeixing" style="text-align: center" /> -->
  130. </td>
  131. </tr>
  132. <tr>
  133. <td class="title" style="width: 100px;" colspan="2">项目流转</td>
  134. <td class="title white" style="width: 100px;">工程技术部部长</td>
  135. <td class="content" style="width: 450px;display:flex;border:0px;align-items:center;" >
  136. <div style="height:50px;width: 450px;text-align: center;line-height: 50px;">{{ fqUserName }}  时间: {{ shenheTime }}</div>
  137. <div class="btn" style="position: absolute;right: 3%;" @click="addSubTable2">保存</div>
  138. <!-- <input v-model="tableData.shuruLeixing" style="text-align: center" /> -->
  139. </td>
  140. </tr>
  141. </table>
  142. </div>
  143. </template>
  144. <script>
  145. import { runFlowPathSaveData } from '@/api/api'
  146. export default {
  147. name: 'itdmXqPingshen',
  148. props: {
  149. // json
  150. tableData2: {
  151. type: Array,
  152. default: false,
  153. required: false,
  154. }
  155. },
  156. data() {
  157. return {
  158. tableData: {
  159. // 试验等级
  160. testDengji: [
  161. {
  162. total: 0,
  163. },
  164. ],
  165. // 三外需求
  166. demandSanwai: [
  167. {
  168. total: 0,
  169. },
  170. ],
  171. // 技术线
  172. // checkList: ['气候环境','力学环境'],
  173. checkList: [],
  174. // 产品线
  175. checkList2: [],
  176. // 重要性系数
  177. factor: '',
  178. },
  179. tableData22: {
  180. // 评审结论
  181. radio: '',
  182. },
  183. disabled1: true,
  184. disabled2: true,
  185. fqUserName: '',
  186. shenheTime: ''
  187. }
  188. },
  189. created(){
  190. console.log(22222,this.tableData2)
  191. // if (this.tableData2[0].dangqian == true && this.tableData2[0].isUpdate == true) {
  192. // this.disabled1 = false
  193. // }
  194. // if (this.tableData2[1].dangqian == true && this.tableData2[1].isUpdate == true) {
  195. // this.disabled2 = false
  196. // }
  197. },
  198. watch: {
  199. tableData2: {
  200. handler(newV, oldV){
  201. if(newV && newV[0]){
  202. if (newV[0].saveData != null) {
  203. this.tableData = JSON.parse(newV[0].saveData)
  204. }
  205. if (newV[1].saveData != null) {
  206. this.tableData22 = JSON.parse(newV[1].saveData)
  207. this.fqUserName = newV[1].fqUserName
  208. this.shenheTime = newV[1].shenheTime
  209. }
  210. if (newV[0].dangqian == true && newV[0].isUpdate == true) {
  211. this.disabled1 = false
  212. }
  213. if (newV[1].dangqian == true && newV[1].isUpdate == true) {
  214. this.disabled2 = false
  215. }
  216. }
  217. },
  218. deep: true,
  219. immediate: true
  220. }
  221. },
  222. computed: {
  223. totalCleanPrice() {
  224. let total = 0
  225. this.tableData.demandSanwai.forEach((item) => {
  226. if (!isNaN(item.yusuan)) {
  227. total += Number(item.yusuan)
  228. }
  229. })
  230. return total.toFixed(2)
  231. },
  232. },
  233. methods: {
  234. addRow() {
  235. this.tableData.testDengji.push({})
  236. },
  237. addRow2() {
  238. this.tableData.demandSanwai.push({})
  239. },
  240. delRow(index) {
  241. this.tableData.testDengji.splice(index, 1)
  242. },
  243. delRow2(index) {
  244. this.tableData.demandSanwai.splice(index, 1)
  245. },
  246. addSubTable1() {
  247. if (this.tableData2[0].dangqian == true && this.tableData2[0].isUpdate == true) {
  248. console.log(this.tableData,this.tableData2[0].id)
  249. const a = {
  250. runFlowPathStep: this.tableData2[0].id,
  251. saveData: JSON.stringify(this.tableData)
  252. }
  253. console.log(a)
  254. runFlowPathSaveData(a).then((res) => {
  255. console.log(res)
  256. if (res.success) {
  257. this.$message.success(res.message)
  258. }
  259. })
  260. } else {
  261. this.$message.error("无保存权限或当前节点不在进行中")
  262. }
  263. // console.log(this.tableData.cleanPrice)
  264. // console.log(this.tableData,this.tableData2[0].id)
  265. // const a = {
  266. // runFlowPathStep: this.tableData2[0].id,
  267. // saveData: JSON.stringify(this.tableData)
  268. // }
  269. // console.log(a)
  270. // runFlowPathSaveData(a).then((res) => {
  271. // console.log(res)
  272. // this.$message.success(res.message)
  273. // })
  274. },
  275. addSubTable2() {
  276. if (this.tableData2[1].dangqian == true && this.tableData2[1].isUpdate == true) {
  277. console.log(this.tableData22,this.tableData2[1].id)
  278. const a = {
  279. runFlowPathStep: this.tableData2[1].id,
  280. saveData: JSON.stringify(this.tableData22)
  281. }
  282. console.log(a)
  283. runFlowPathSaveData(a).then((res) => {
  284. console.log(res)
  285. if (res.success) {
  286. this.$message.success(res.message)
  287. }
  288. })
  289. } else {
  290. this.$message.error("无保存权限或当前节点不在进行中")
  291. }
  292. },
  293. }
  294. }
  295. </script>
  296. <style scoped>
  297. @import '~@assets/less/common.less';
  298. table * {
  299. box-sizing: border-box;
  300. font-size: 14px;
  301. }
  302. table {
  303. border: 1px solid rgb(30, 53, 65);
  304. width: 100%;
  305. table-layout:fixed;
  306. }
  307. td {
  308. text-align: center;
  309. border: 1px solid rgb(30, 53, 65);
  310. }
  311. tr {
  312. height: 50px;
  313. }
  314. .main-table {
  315. background-color: #EBF1DD;
  316. }
  317. .title {
  318. background-color: #fff;
  319. }
  320. .addRow {
  321. padding: 6px 10px;
  322. text-align: center;
  323. font-size: 12px;
  324. margin-left: 20px;
  325. /* width: 60px;
  326. height: 24px;
  327. background-color: #fff;
  328. border-radius: 4px;
  329. text-align: center;
  330. line-height: 24px;
  331. font-size: 12px;
  332. margin-left: 20px;
  333. cursor: pointer; */
  334. }
  335. .btn {
  336. /* display: inline-block; */
  337. width: 60px;
  338. height: 24px;
  339. padding: 2px 10px;
  340. font-size: 13px;
  341. border: 1px solid rgb(3, 188, 244);
  342. color: rgb(8, 187, 241);
  343. border-radius: 4px;
  344. cursor: pointer;
  345. margin-left: 20px;
  346. }
  347. .delBtn {
  348. padding: 6px 10px;
  349. text-align: center;
  350. font-size: 12px;
  351. }
  352. input {
  353. padding: 0 20px;
  354. height: 50px;
  355. outline: none;
  356. border: none;
  357. background: transparent;
  358. }
  359. .head {
  360. height: 35px;
  361. background-color: #FFFF00;
  362. text-align: center;
  363. line-height: 35px;
  364. font-weight: bold;
  365. font-size: 18px;
  366. border: 1px solid rgb(30, 53, 65);
  367. }
  368. .jishuxian{
  369. box-sizing: border-box;
  370. text-align: center;
  371. line-height: 30px;
  372. display: flex;
  373. flex-wrap:wrap;
  374. padding-left: 3%;
  375. /* justify-content: center; */
  376. }
  377. </style>