QualityInfo.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <div class="other">
  3. <el-form label-width="130px" ref="form" :model="form" :rules="rules">
  4. <div class="divider">
  5. <div class="title">
  6. <div class="ele-bg-primary"></div>
  7. <span>质量配置</span>
  8. </div>
  9. <div class="ele-bg-primary ele-width"></div>
  10. </div>
  11. <el-row :gutter="24">
  12. <el-col :span="8" v-for="(item, index) in form" :key="index">
  13. <el-form-item
  14. :label="
  15. item.dataType == 1
  16. ? '是否采购来料检验'
  17. : item.dataType == 2
  18. ? '是否委外来料检验'
  19. : '是否受托来料检验'
  20. "
  21. prop="isComeCheck"
  22. >
  23. <el-radio v-model="item.isComeCheck" :label="1">是</el-radio>
  24. <el-radio v-model="item.isComeCheck" :label="0">否</el-radio>
  25. </el-form-item>
  26. </el-col>
  27. <!-- <el-col :span="6" v-if="form.isComeCheck == 1">
  28. <el-form-item label="检验标准" prop="inspectionStandards"> -->
  29. <!-- 计量 计重 -->
  30. <!-- <el-select
  31. style="width: 100%"
  32. v-model="form.inspectionStandards"
  33. placeholder="请选择"
  34. >
  35. <el-option
  36. v-for="item in inspectionStandardsList"
  37. :label="item.label"
  38. :value="item.value"
  39. :key="item.value"
  40. >
  41. </el-option>
  42. </el-select>
  43. </el-form-item>
  44. </el-col> -->
  45. <!-- <el-col :span="6" v-if="form.isComeCheck == 1">
  46. <el-form-item label="物料级别" prop="levelItem">
  47. <el-select
  48. style="width: 100%"
  49. v-model="form.levelItem"
  50. placeholder="请选择"
  51. disabled
  52. >
  53. <el-option
  54. v-for="item in levelOptions"
  55. :label="item.label"
  56. :value="item.value"
  57. :key="item.value"
  58. >
  59. </el-option>
  60. </el-select>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="6" v-if="form.isComeCheck == 1">
  64. <el-form-item label="检验方式" prop="checkFormula">
  65. <DictSelection
  66. dictName="检验方案"
  67. clearable
  68. v-model="form.checkFormula"
  69. >
  70. </DictSelection>
  71. </el-form-item>
  72. </el-col>
  73. <el-col
  74. :span="6"
  75. v-if="form.isComeCheck == 1 && form.checkFormula == 2"
  76. >
  77. <el-form-item label="取样数量" prop="sampleProportion">
  78. <el-input
  79. type="number"
  80. :min="0.0"
  81. v-model="form.sampleProportion"
  82. placeholder="请输入"
  83. style="width: calc(100% - 85px)"
  84. clearable
  85. >
  86. </el-input>
  87. <DictSelection
  88. style="width: 85px"
  89. dictName="计量单位"
  90. placeholder=" "
  91. v-model="form.sampleProportionUnit"
  92. ></DictSelection>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :span="8" v-if="form.isComeCheck == 1">
  96. <el-form-item label="质检方案" prop="qualityTemplateIds">
  97. <el-select
  98. style="width: 100%"
  99. v-model="form.qualityTemplateIds"
  100. filterable
  101. multiple
  102. :multiple-limit="1"
  103. >
  104. <el-option
  105. @click.native="qualityTemplateIdsChange(item)"
  106. v-for="item in qualityTemplateList"
  107. :key="item.id"
  108. :value="item.id"
  109. :label="item.qualitySchemeTemplateName"
  110. ></el-option>
  111. </el-select>
  112. </el-form-item>
  113. </el-col> -->
  114. </el-row>
  115. </el-form>
  116. </div>
  117. </template>
  118. <script>
  119. import { getQualityTemplate } from '@/api/material/list.js';
  120. import { getByCode } from '@/api/system/dictionary-data';
  121. export default {
  122. props: {
  123. form: {
  124. type: Object,
  125. default: {}
  126. }
  127. },
  128. components: {},
  129. data() {
  130. return {
  131. qualityTemplateList: [],
  132. levelOptions: [
  133. {
  134. label: '特级',
  135. value: '特级'
  136. },
  137. {
  138. label: '一级',
  139. value: '一级'
  140. },
  141. {
  142. label: '二级',
  143. value: '二级'
  144. },
  145. {
  146. label: '三级',
  147. value: '三级'
  148. }
  149. ],
  150. inspectionStandardsList: [],
  151. rules: {
  152. checkFormula: [
  153. {
  154. required: true,
  155. message: '请选择检验方式',
  156. trigger: 'change'
  157. }
  158. ],
  159. qualityTemplateIds: [
  160. {
  161. required: true,
  162. message: '请选择质检方案',
  163. trigger: 'change'
  164. }
  165. ]
  166. }
  167. };
  168. },
  169. watch: {},
  170. created() {
  171. this.getQualityTemplateList();
  172. this.getDictListIqoCode('iqo_code');
  173. },
  174. methods: {
  175. // async getDictList(code) {
  176. // // debugger;
  177. // let { data: res } = await getByCode(code);
  178. // this.levelOptions = res.map((item) => {
  179. // let values = Object.keys(item);
  180. // return {
  181. // value: Number(values[0]),
  182. // label: item[values[0]]
  183. // };
  184. // });
  185. // },
  186. qualityTemplateIdsChange(data) {
  187. this.form.sampleProportion = data.sampleProportion;
  188. this.form.sampleProportionUnit = data.sampleProportionUnit;
  189. },
  190. levelChange(val) {
  191. this.form.levelItem = val;
  192. },
  193. async getDictListIqoCode(code) {
  194. let { data: res } = await getByCode(code);
  195. this.inspectionStandardsList = res.map((item) => {
  196. let values = Object.keys(item);
  197. return {
  198. value: Number(values[0]),
  199. label: item[values[0]]
  200. };
  201. });
  202. },
  203. getQualityTemplateList() {
  204. getQualityTemplate({
  205. type: this.form.dataType == 1 ? 1 : this.form.dataType == 2 ? 6 : 5,
  206. status: 1,
  207. size: 999
  208. }).then((res) => {
  209. console.log(res, 'res');
  210. this.qualityTemplateList = res.list;
  211. });
  212. }
  213. }
  214. };
  215. </script>
  216. <style lang="scss" scoped>
  217. .other {
  218. background: #fff;
  219. padding: 1px 17px;
  220. }
  221. .divider {
  222. margin: 0px 0 20px;
  223. .title {
  224. display: flex;
  225. align-items: center;
  226. margin-bottom: 10px;
  227. div {
  228. width: 8px;
  229. height: 20px;
  230. margin-right: 10px;
  231. }
  232. span {
  233. font-size: 20px;
  234. }
  235. }
  236. .ele-width {
  237. width: 100%;
  238. height: 2px;
  239. }
  240. }
  241. .form-line {
  242. display: flex;
  243. align-items: center;
  244. justify-content: space-between;
  245. .line-select {
  246. margin-left: 15px;
  247. }
  248. }
  249. </style>