inspectionProjectReport.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="检验项目" @clickLeft="back">
  4. </uni-nav-bar>
  5. <view class="wrapper">
  6. <view class="herder_item">
  7. <view class="herder_text"></view>
  8. <view class="herder_view" style="font-size: 32rpx;">
  9. 检验信息
  10. </view>
  11. </view>
  12. <text class="marginTop20 tag">
  13. {{form.inspectionName}}
  14. </text>
  15. <view class="marginTop20 workValue">
  16. {{workData.productName}}/{{workData.code}}/{{workData.productCode}}
  17. </view>
  18. <view class="herder_item marginTop20">
  19. <view class="herder_text"></view>
  20. <view class="herder_view">
  21. 执行标准
  22. </view>
  23. </view>
  24. <u--input suffixIcon="arrow-right" style="background-color:#fff ;" :disabledColor="'#ffffff'"
  25. :disabled="true" class="marginTop20" placeholder=" " border="surround"
  26. :value="getDictValue('质检标准类型', form.qualityStandardType+'')"></u--input>
  27. <view class="herder_item marginTop20">
  28. <view class="herder_text"></view>
  29. <view class="herder_view">
  30. 工艺参数
  31. </view>
  32. </view>
  33. <view class="marginTop20 defValue">
  34. {{form.defaultValue}}
  35. </view>
  36. <view class="herder_item marginTop20">
  37. <view class="herder_text"></view>
  38. <view class="herder_view">
  39. 质检内容
  40. </view>
  41. </view>
  42. <u-input @input="handleInput(form, form.qualityResultContent)" class="marginTop20" placeholder="请输入内容"
  43. border="surround" v-model="form.qualityResultContent">
  44. <template slot="suffix" v-if="form.unitName">{{form.unitName}}</template>
  45. </u-input>
  46. <view class="herder_item marginTop20">
  47. <view class="herder_text"></view>
  48. <view class="herder_view">
  49. 样品数
  50. </view>
  51. </view>
  52. <u-input type="number" class="marginTop20" placeholder="请输入内容" border="surround"
  53. v-model="form.sampleQuantity">
  54. <template slot="suffix" v-if="form.measureUnit">{{form.measureUnit}}</template>
  55. </u-input>
  56. <view class="herder_item marginTop20">
  57. <view class="herder_text"></view>
  58. <view class="herder_view">
  59. 合格数
  60. </view>
  61. </view>
  62. <u-input type="number" class="marginTop20" placeholder="请输入内容" border="surround"
  63. v-model="form.qualifiedQuantity">
  64. <template slot="suffix" v-if="form.measureUnit">{{form.measureUnit}}</template>
  65. </u-input>
  66. <view class="herder_item marginTop20">
  67. <view class="herder_text"></view>
  68. <view class="herder_view">
  69. 不合格数
  70. </view>
  71. </view>
  72. <u-input type="number" class="marginTop20" placeholder="请输入内容" border="surround"
  73. v-model="form.noQualifiedQuantity">
  74. <template slot="suffix" v-if="form.measureUnit">{{form.measureUnit}}</template>
  75. </u-input>
  76. <view class="herder_item marginTop20">
  77. <view class="herder_text"></view>
  78. <view class="herder_view">
  79. 损耗数(合格品)
  80. </view>
  81. </view>
  82. <u-input type="number" class="marginTop20" placeholder="请输入内容" border="surround" v-model="form.lossNumber">
  83. <template slot="suffix" v-if="form.measureUnit">{{form.measureUnit}}</template>
  84. </u-input>
  85. <view class="herder_item marginTop20">
  86. <view class="herder_text"></view>
  87. <view class="herder_view">
  88. 损耗数(不合格品)
  89. </view>
  90. </view>
  91. <u-input type="number" class="marginTop20" placeholder="请输入内容" border="surround"
  92. v-model="form.lossNumberUnqualified">
  93. <template slot="suffix" v-if="form.measureUnit">{{form.measureUnit}}</template>
  94. </u-input>
  95. <view class="herder_item marginTop20">
  96. <view class="herder_text"></view>
  97. <view class="herder_view">
  98. 留样数(合格品)
  99. </view>
  100. </view>
  101. <u-input type="number" class="marginTop20" placeholder="请输入内容" border="surround"
  102. v-model="form.retainedSampleQuantity">
  103. <template slot="suffix" v-if="form.measureUnit">{{form.measureUnit}}</template>
  104. </u-input>
  105. <view class="herder_item marginTop20">
  106. <view class="herder_text"></view>
  107. <view class="herder_view">
  108. 留样数(不合格品)
  109. </view>
  110. </view>
  111. <u-input type="number" class="marginTop20" placeholder="请输入内容" border="surround"
  112. v-model="form.retainedSampleUnqualified">
  113. <template slot="suffix" v-if="form.measureUnit">{{form.measureUnit}}</template>
  114. </u-input>
  115. <view class="herder_item marginTop20">
  116. <view class="herder_text"></view>
  117. <view class="herder_view">
  118. 质检结果
  119. </view>
  120. </view>
  121. <uni-data-picker class="marginTop20" v-model="form.qualityResults" placeholder="请选择"
  122. :localdata="acceptUnpackList">
  123. </uni-data-picker>
  124. </view>
  125. <view class="footerButton">
  126. <u-button type="default" text="返回" @click="back"></u-button>
  127. <u-button type="primary" @click="save" text="保存"></u-button>
  128. </view>
  129. <view style="width:100%;height: 100rpx;"></view>
  130. </view>
  131. </template>
  132. <script>
  133. import dictMixns from '@/mixins/dictMixins'
  134. import {
  135. getById,
  136. update
  137. } from '@/api/inspectionWork/index.js'
  138. import {
  139. handleInput
  140. } from './unit.js';
  141. export default {
  142. components: {},
  143. mixins: [dictMixns],
  144. data() {
  145. return {
  146. handleInput,
  147. show: false,
  148. form: {
  149. },
  150. acceptUnpackList: [{
  151. text: "合格",
  152. value: 1
  153. },
  154. {
  155. text: "不合格",
  156. value: 2
  157. }, {
  158. text: "让步接收",
  159. value: 3
  160. },
  161. ],
  162. workData: {}
  163. }
  164. },
  165. computed: {
  166. },
  167. onLoad(data) {
  168. this.requestDict('质检计划类型');
  169. this.requestDict('取样类型');
  170. this.requestDict('质检标准类型');
  171. if (data) {
  172. getById(data.workId).then(res => {
  173. this.workData = res
  174. this.form = res.templateList.find(item => item.id == data.projectId)
  175. this.form.measureUnit = res.qualitySampleList[0]?.measureUnit
  176. })
  177. }
  178. },
  179. onShow() {
  180. },
  181. methods: {
  182. update() {
  183. let params = JSON.parse(JSON.stringify(this.workData))
  184. let index= params.templateList.findIndex(item=>item.id==this.form.id)
  185. params.templateList[index]=this.form
  186. update(params)
  187. .then((msg) => {
  188. })
  189. .catch((e) => {
  190. });
  191. },
  192. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. .mainBox {
  197. background-color: #f3f8fb;
  198. height: 100vh;
  199. font-size: 27rpx;
  200. overflow-y: auto;
  201. }
  202. .wrapper {
  203. width: 720rpx;
  204. background: #fff;
  205. margin: 20rpx auto 0;
  206. border-radius: 30rpx;
  207. padding: 26rpx;
  208. }
  209. .footerButton {
  210. width: 100%;
  211. height: 84rpx;
  212. display: flex;
  213. position: fixed;
  214. bottom: 0;
  215. z-index: 10;
  216. background-color: #fff;
  217. /deep/.u-button {
  218. height: 100%;
  219. }
  220. >view {
  221. flex: 1;
  222. }
  223. }
  224. .workValue {
  225. word-break: break-all;
  226. font-weight: bold;
  227. }
  228. .tag {
  229. // font-size: 24rpx;
  230. color: #fff;
  231. padding: 12rpx;
  232. border-radius: 10rpx;
  233. background: #979797;
  234. display: inline-block;
  235. }
  236. /deep/.input-value {
  237. font-size: 28rpx !important;
  238. }
  239. .defValue {
  240. color: #c1353c;
  241. text-indent: 2ch;
  242. }
  243. .marginTop20 {
  244. margin-top: 30rpx;
  245. }
  246. .herder_item {
  247. display: flex;
  248. font-weight: bold;
  249. // font-size: 26rpx;
  250. .herder_text {
  251. min-width: 10rpx;
  252. height: 32rpx;
  253. border-radius: 10rpx;
  254. background: #00c0a1;
  255. margin-right: 12rpx;
  256. margin-top: 5rpx;
  257. }
  258. }
  259. </style>