You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

738 lines
33 KiB

3 weeks ago
  1. 
  2. @{
  3. ViewBag.Title = "";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. }
  6. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  7. <!--引入 element-ui 的样式,-->
  8. <link rel="stylesheet" href="~/Content/element-ui/lib/theme-chalk/index.css">
  9. <script src="~/Content/vue/dist/vue.js"></script>
  10. <script src="~/Content/element-ui/lib/index.js"></script>
  11. <script src="~/Content/axios.min.js"></script>
  12. <style>
  13. </style>
  14. <form id="form1">
  15. <div id="app">
  16. <template>
  17. <el-form ref="form" :model="form" label-width="100px">
  18. <el-divider>搜索区域</el-divider>
  19. <el-row :gutter="24">
  20. <!--<el-col :span="6">
  21. <el-form-item label="物料编码" prop="itemCode">
  22. <el-input v-model="itemCode" size="mini"></el-input>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="6">
  26. <button id="btn_search" type="button" class="btn btn-primary" v-on:click="query()"><i class="fa fa-search"></i>查询物料</button>-->
  27. @*<a id="NF-Add" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="addLine()"><i class="fa fa-pencil-square-o"></i>新增检验项目</a>*@
  28. <!--</el-col>-->
  29. <el-col :span="6">
  30. <el-form-item label="物料编码" prop="itemCode">
  31. <el-autocomplete v-model="itemCode"
  32. :fetch-suggestions="querySearch"
  33. placeholder="请输入物料编码"
  34. size="mini"
  35. v-on:select="handleSelect"
  36. clearable
  37. :loading="loading"></el-autocomplete>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="6">
  41. <button id="btn_search" type="button" class="btn btn-primary" v-on:click="query()">
  42. <i class="fa fa-search"></i>查询物料
  43. </button>
  44. </el-col>
  45. <el-col :span="6">
  46. <el-form-item label="类型" prop="EATTRIBUTE1">
  47. <el-select v-model="EATTRIBUTE1" placeholder="请选择" size="mini">
  48. <el-option v-for="item in checkAttrList"
  49. :key="item.value"
  50. :label="item.label"
  51. :value="item.value">
  52. </el-option>
  53. </el-select>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="6">
  57. <el-form-item label="检验项目组" prop="GroupCode">
  58. <el-select v-model="GroupCode" placeholder="请选择" size="mini" v-on:change="queryGroupList()">
  59. <el-option v-for="item in checkGroupCode"
  60. :key="item.Code"
  61. :label="item.Name"
  62. :value="item.Code">
  63. </el-option>
  64. </el-select>
  65. </el-form-item>
  66. </el-col>
  67. </el-row>
  68. <el-divider>选择区域</el-divider>
  69. <el-row :gutter="24">
  70. <el-col :span="24">
  71. <el-table ref="dataSource4Left" highlight-current-row
  72. :data="dataSource4Left"
  73. style="width: 100%"
  74. stripe border
  75. size="mini"
  76. height="200"
  77. v-on:current-change="handleCurrentChange">
  78. <el-table-column type="index" width="50"></el-table-column>
  79. <el-table-column prop="InvCode" label="料品编码" width="140">
  80. </el-table-column>
  81. <el-table-column prop="InvName" label="料品名称" width="140">
  82. </el-table-column>
  83. </el-table>
  84. </el-col>
  85. </el-row>
  86. <el-row :gutter="24">
  87. <el-col :span="24">
  88. <a id="NF-Add" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="addLine()"><i class="fa fa-pencil-square-o"></i>新增</a>
  89. </el-col>
  90. <el-col :span="24">
  91. <el-table ref="singleTable" highlight-current-row
  92. :data="dataSource4Detail"
  93. style="width: 100%"
  94. stripe border
  95. size="mini"
  96. height="500">
  97. @*v-on:current-change="handleCurrentChange"*@
  98. <el-table-column prop="EATTRIBUTE6" label="检验类型" width="140">
  99. <template slot-scope="scope">
  100. <el-select v-model="scope.row.EATTRIBUTE6" placeholder="请选择" size="mini">
  101. <el-option v-for="item in dataSourceType"
  102. :key="item.Code"
  103. :label="item.Name"
  104. :value="item.Code">
  105. </el-option>
  106. </el-select>
  107. </template>
  108. </el-table-column>
  109. @*<el-table-column type="index" width="50"></el-table-column>*@
  110. <el-table-column prop="ListCode" label="检验项目代码" width="140">
  111. <template slot-scope="scope">
  112. <el-select v-model="scope.row.ListCode" placeholder="请选择" size="mini"
  113. v-on:change="(val) => ListCodeChange(val, scope.$index)">
  114. <el-option v-for="item in dataSourceListCode"
  115. :key="item.Code"
  116. :label="item.Name"
  117. :value="item.Code">
  118. </el-option>
  119. </el-select>
  120. </template>
  121. </el-table-column>
  122. <el-table-column prop="ListName" label="检验项目名称" width="140">
  123. <template slot-scope="scope">
  124. <el-input v-model="scope.row.ListName" controls-position="right" size="small" disabled="disabled"></el-input>
  125. </template>
  126. </el-table-column>
  127. <el-table-column prop="SetValueMin" label="标准下限" width="140">
  128. <template slot-scope="scope">
  129. <el-input-number v-model="scope.row.SetValueMin" controls-position="right" :min="0" size="small"></el-input-number>
  130. </template>
  131. </el-table-column>
  132. <el-table-column prop="SetValueMax" label="标准上限" width="140">
  133. <template slot-scope="scope">
  134. <el-input-number v-model="scope.row.SetValueMax" controls-position="right" :min="0" size="small"></el-input-number>
  135. </template>
  136. </el-table-column>
  137. <el-table-column prop="Unit" label="单位" width="140">
  138. <template slot-scope="scope">
  139. <el-select v-model="scope.row.Unit" placeholder="请选择" size="mini">
  140. <el-option v-for="item in dataSourceUom"
  141. :key="item.Name"
  142. :label="item.Name"
  143. :value="item.Name">
  144. </el-option>
  145. </el-select>
  146. </template>
  147. </el-table-column>
  148. <el-table-column prop="EATTRIBUTE7" label="检验仪器" width="140">
  149. <template slot-scope="scope">
  150. <el-select v-model="scope.row.EATTRIBUTE7" placeholder="请选择" size="mini">
  151. <el-option v-for="item in dataSourceDevice"
  152. :key="item.Name"
  153. :label="item.Name"
  154. :value="item.Name">
  155. </el-option>
  156. </el-select>
  157. </template>
  158. </el-table-column>
  159. <el-table-column prop="EATTRIBUTE1" label="检验标准" width="140">
  160. <template slot-scope="scope">
  161. <el-input v-model="scope.row.EATTRIBUTE1" controls-position="right" size="small"></el-input>
  162. </template>
  163. </el-table-column>
  164. @*<el-table-column prop="EATTRIBUTE2" label="抽样水准" width="140">
  165. <template slot-scope="scope">
  166. <el-input v-model="scope.row.EATTRIBUTE2" controls-position="right" size="small"></el-input>
  167. </template>
  168. </el-table-column>
  169. <el-table-column prop="EATTRIBUTE3" label="允收标准" width="140">
  170. <template slot-scope="scope">
  171. <el-input v-model="scope.row.EATTRIBUTE3" controls-position="right" size="small"></el-input>
  172. </template>
  173. </el-table-column>*@
  174. <el-table-column prop="EATTRIBUTE4" label="检验实际值是否必填" width="150">
  175. <template slot-scope="scope">
  176. <el-switch v-model="scope.row.EATTRIBUTE4" active-color="#13ce66" inactive-color="#ff4949">
  177. </el-switch>
  178. </template>
  179. </el-table-column>
  180. <el-table-column prop="EATTRIBUTE5" label="AQL代码" width="140">
  181. <template slot-scope="scope">
  182. <el-select v-model="scope.row.EATTRIBUTE5" placeholder="请选择" size="mini">
  183. <el-option v-for="item in dataSourceAql"
  184. :key="item.Code"
  185. :label="item.Name"
  186. :value="item.Code">
  187. </el-option>
  188. </el-select>
  189. </template>
  190. </el-table-column>
  191. <el-table-column prop="Enable" label="启用" width="150">
  192. <template slot-scope="scope">
  193. <el-switch v-model="scope.row.Enable" active-color="#13ce66" inactive-color="#ff4949">
  194. </el-switch>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="操作">
  198. <template slot-scope="scope">
  199. <a id="NF-Delete" authorize="yes" class="btn btn-primary" v-on:click="handleDelete(scope.$index, scope.row)"><i class="fa fa-trash-o"></i>删除</a>
  200. </template>
  201. </el-table-column>
  202. </el-table>
  203. </el-col>
  204. </el-row>
  205. </el-form>
  206. </template>
  207. </div>
  208. </form>
  209. <script type="text/javascript">
  210. //const { Console } = require("node:console");
  211. var vm = new Vue({
  212. el: '#app',
  213. data: {
  214. id:'',
  215. userCode: "",
  216. ssList: [],
  217. dataSourceType: [],
  218. dataSourceAql: [],
  219. dataSourceListCode: [],
  220. dataSourceUom: [],
  221. dataSourceDevice: [],
  222. form: {},
  223. detail: {
  224. key: 0,
  225. ListCode: '',
  226. ListNAme: '',
  227. SetValueMin: 0,
  228. SetValueMax: 0,
  229. SampleQuantity: 0,
  230. Unit: '',
  231. Enable: true,
  232. EATTRIBUTE1: '',
  233. EATTRIBUTE2: '',
  234. EATTRIBUTE3: '',
  235. EATTRIBUTE4: '',
  236. EATTRIBUTE5: '',
  237. EATTRIBUTE6: '',
  238. },
  239. dataSource4Detail: [],//检验项目数据源
  240. rules: {
  241. RulesCode: [{ required: true, message: '请输入', trigger: 'blur' },],
  242. RulesName: [{ required: true, message: '请输入', trigger: 'blur' },],
  243. },
  244. disabled4RulesCode: false,
  245. disabled4SetValue: false,
  246. itemCode: '',
  247. loading: false,
  248. GroupCode: '',
  249. GroupCodeName: '', // 新增:存储检验项目组名称
  250. dataSource4Left: [],//物料数据源
  251. checkAttrList: [],//
  252. checkGroupCode: [],//
  253. item2CheckGroup: {
  254. EATTRIBUTE1: '',
  255. GroupCode:'',
  256. ItemList: [],
  257. CheckItemList:[],
  258. },
  259. selectItem4Item: null,
  260. EATTRIBUTE1:''//检验属性
  261. },
  262. //挂在DOM 触发
  263. mounted() {
  264. let reactiveObject = {
  265. GroupCode: '',
  266. EATTRIBUTE1: '',
  267. Type: '',
  268. Enable: true,
  269. DetailList: [],
  270. };
  271. this.form = reactiveObject;
  272. // this.loadGrid();
  273. // this.show();
  274. this.id = '@ViewData["ids"]';
  275. this.initControl();
  276. this.getAllCheckAttr();
  277. this.getAllCheckGroup();
  278. this.getType();
  279. this.getListCode();
  280. this.getUom();
  281. this.getDevice();
  282. // console.log(this.id);
  283. },
  284. beforeDestroy() {
  285. // this.autoScrol1(true);
  286. },
  287. methods: {
  288. //change4EATTRIBUTE1(val) {
  289. // // console.log(val);
  290. // let currentSelect = this.checkAttrList.filter(x => x.value == val)[0];
  291. // // console.log(currentSelect);
  292. // if (currentSelect)
  293. // this.disabled4SetValue = currentSelect.Ext1=="尺寸" ? false : true;
  294. // else {
  295. // this.disabled4SetValue = true;
  296. // }
  297. //},
  298. getAllCheckAttr() {
  299. axios
  300. .get('/DHAY/IQCQuality/GetSelectItemList?keyValue=InspectionGroupType')
  301. .then(function (res) {
  302. //debugger;
  303. if (res.data) {
  304. res.data.forEach(function (el, i) {
  305. Vue.set(vm.checkAttrList, i, el)
  306. });
  307. }
  308. })
  309. .catch(function (error) { // 请求失败处理
  310. alert(error);
  311. });
  312. },
  313. getAllCheckGroup() {
  314. axios
  315. .get('/DHAY/IQCQuality/GetSelectCheckGroup')
  316. .then(function (res) {
  317. //debugger;
  318. if (res.data) {
  319. res.data.forEach(function (el, i) {
  320. Vue.set(vm.checkGroupCode, i, el)
  321. });
  322. }
  323. })
  324. .catch(function (error) { // 请求失败处理
  325. alert(error);
  326. });
  327. },
  328. getListCode() {
  329. axios
  330. .get('/WMS/BasicSettings/GetInspectListCode')
  331. .then(function (res) {
  332. if (res.data) {
  333. res.data.forEach(function (el, i) {
  334. Vue.set(vm.dataSourceListCode, i, el)
  335. });
  336. }
  337. })
  338. .catch(function (error) { // 请求失败处理
  339. alert(error);
  340. });
  341. },
  342. getUom() {
  343. axios
  344. .get('/WMS/BasicSettings/GetUom')
  345. .then(function (res) {
  346. if (res.data) {
  347. res.data.forEach(function (el, i) {
  348. Vue.set(vm.dataSourceUom, i, el)
  349. });
  350. }
  351. })
  352. .catch(function (error) { // 请求失败处理
  353. alert(error);
  354. });
  355. },
  356. getDevice() {
  357. axios
  358. .get('/WMS/BasicSettings/GetDevice')
  359. .then(function (res) {
  360. if (res.data) {
  361. res.data.forEach(function (el, i) {
  362. Vue.set(vm.dataSourceDevice, i, el)
  363. });
  364. }
  365. })
  366. .catch(function (error) { // 请求失败处理
  367. alert(error);
  368. });
  369. },
  370. ListCodeChange(val, index) {
  371. // 如果未选择值则清空名称
  372. if (!val) {
  373. this.dataSource4Detail[index].ListName = '';
  374. return;
  375. }
  376. axios
  377. .get('/WMS/BasicSettings/GetListName?ListCode=' + val)
  378. .then(function (res) {
  379. if (res.data && res.data[0].ListName) {
  380. // 填充当前行的检验项目名称
  381. vm.dataSource4Detail[index].ListName = res.data[0].ListName;
  382. } else {
  383. // 未找到对应名称时清空
  384. vm.dataSource4Detail[index].ListName = '';
  385. }
  386. })
  387. .catch(function (error) {
  388. alert('获取检验项目名称失败:' + error);
  389. });
  390. },
  391. addLine() {
  392. //debugger;
  393. // console.log('new line');
  394. let key = 1;
  395. let maxObj = this.dataSource4Detail.sort((a, b) => b.key - a.key)[0];
  396. if (maxObj != null) {
  397. key = maxObj.key + 1;
  398. }
  399. let obj = {
  400. key: key,
  401. ListCode: '',
  402. ListNAme: '',
  403. SetValueMin: 0,
  404. SetValueMax: 0,
  405. SampleQuantity: 0,
  406. Unit: '',
  407. Enable: true,
  408. EATTRIBUTE1: '',
  409. EATTRIBUTE2: '',
  410. EATTRIBUTE3: '',
  411. EATTRIBUTE4: true,
  412. EATTRIBUTE5: '',
  413. EATTRIBUTE6: '',
  414. };
  415. this.dataSource4Detail.push(obj);
  416. },
  417. //删除行
  418. handleDelete(index, row) {
  419. // console.log(index, row);
  420. this.dataSource4Detail = this.dataSource4Detail.filter(x => x.key != row.key);
  421. },
  422. initControl: function () {
  423. let that = this;
  424. let orgName = '';
  425. this.disabled4RulesCode = this.id ? true : false;
  426. let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
  427. // console.log(userName);
  428. this.getData();
  429. this.getAql();
  430. //this.getAllItem();
  431. //this.getAllAql();
  432. },
  433. getAllItem() {
  434. axios
  435. .get('/DHAY/IQCQuality/GetAllItemList?code=' + this.itemCode.trim())
  436. .then(function (res) {
  437. //debugger;
  438. if (res.data) {
  439. res.data.forEach(function (el, i) {
  440. Vue.set(vm.dataSource4Left, i, el)
  441. });
  442. }
  443. })
  444. .catch(function (error) { // 请求失败处理
  445. alert(error);
  446. });
  447. },
  448. querySearch(queryString, cb) {
  449. if (!queryString) {
  450. cb([]);
  451. return;
  452. }
  453. this.loading = true;
  454. // 调用接口获取数据
  455. axios
  456. .get('/DHAY/IQCQuality/GetItemCodeSearch?ItemCode=' + this.itemCode.trim())
  457. .then(response => {
  458. this.loading = false;
  459. const results = response.data.map(item => ({
  460. value: item.InvCode,
  461. label: `${item.InvCode} - ${item.InvName}`,
  462. ...item
  463. }));
  464. cb(results);
  465. }).catch(error => {
  466. this.loading = false;
  467. console.error('获取物料数据失败', error);
  468. cb([]);
  469. });
  470. },
  471. // 处理选择事件
  472. handleSelect(item) {
  473. this.itemCode = item.value;
  474. // 可以在这里自动触发查询
  475. this.query();
  476. },
  477. getAllCheckGroupList(GroupCode) {
  478. vm.dataSource4Detail = [];
  479. axios
  480. .get('/DHAY/IQCQuality/Getallcheckgrouplist?code=' + GroupCode)
  481. .then(function (res) {
  482. if (res.data && Array.isArray(res.data)) { // 确保是数组
  483. res.data.forEach(function (el, i) {
  484. // 1. 处理EATTRIBUTE4的布尔值转换
  485. if (el.EATTRIBUTE4 === "true") {
  486. el.EATTRIBUTE4 = true;
  487. } else if (el.EATTRIBUTE4 === "false") {
  488. el.EATTRIBUTE4 = false;
  489. }
  490. // 2. 为每行添加唯一key(使用索引+i确保唯一,也可根据后端唯一ID生成)
  491. el.key = i + 1; // 关键:生成唯一key
  492. // 3. 赋值到数据源
  493. Vue.set(vm.dataSource4Detail, i, el);
  494. });
  495. }
  496. })
  497. .catch(function (error) {
  498. alert(error);
  499. });
  500. },
  501. getType() {
  502. axios
  503. .get('/WMS/BasicSettings/GetICSType?Type=EATTRIBUTE6&TableCode=ICSInspectionList')
  504. .then(function (res) {
  505. if (res.data) {
  506. res.data.forEach(function (el, i) {
  507. Vue.set(vm.dataSourceType, i, el)
  508. });
  509. }
  510. })
  511. .catch(function (error) { // 请求失败处理
  512. alert(error);
  513. });
  514. },
  515. getAql() {
  516. axios
  517. .get('/DHAY/IQCQuality/GetICSAql')
  518. .then(function (res) {
  519. if (res.data && Array.isArray(res.data)) {
  520. res.data.forEach(function (el, i) {
  521. Vue.set(vm.dataSourceAql, i, el);
  522. });
  523. }
  524. //if (res.data) {
  525. // debugger;
  526. // for (var i in res.data) {
  527. // Vue.set(vm.dataSourceAql, i, res.data[i])
  528. // }
  529. // //res.data.forEach(function (el, i) {
  530. // // Vue.set(vm.dataSourceAql, i, el)
  531. // //});
  532. //}
  533. })
  534. .catch(function (error) { // 请求失败处理
  535. alert(error);
  536. });
  537. },
  538. getData() {
  539. if (!this.id) return;
  540. axios
  541. .get('/DHAY/IQCQuality/GetAql?keyValue=' + this.id)
  542. .then(function (res) {
  543. debugger;
  544. if (res.data) {
  545. for (var i in res.data) {
  546. Vue.set(vm.form, i, res.data[i]);
  547. }
  548. res.data.DetailList.forEach(function (el, i) {
  549. debugger;
  550. if (el.EATTRIBUTE4 == "true") {
  551. el.EATTRIBUTE4 = true;
  552. }
  553. Vue.set(vm.dataSource4Detail, i, el)
  554. });
  555. }
  556. })
  557. .catch(function (error) { // 请求失败处理
  558. alert(error);
  559. });
  560. },
  561. query() {
  562. //debugger;
  563. this.itemCode = this.itemCode.trim();
  564. this.GroupCode = this.GroupCode.trim();
  565. if (this.itemCode) {
  566. // this.dataSource4Left = this.dataSource4Left.filter(x => x.InvCode.includes(this.itemCode));
  567. this.getAllItem();
  568. }
  569. //if (this.groupCode) {
  570. // // this.dataSource4Right = this.dataSource4Right.filter(x => x.RulesCode.includes(this.groupCode));
  571. // this.getAllCheckGroup();
  572. //}
  573. },
  574. queryGroupList() {
  575. debugger;
  576. var GroupCode = this.GroupCode.trim();
  577. // this.groupCode = this.groupCode.trim();
  578. if (this.GroupCode) {
  579. // 【新增:根据 GroupCode 匹配对应的 Name】
  580. const selectedGroup = this.checkGroupCode.find(item => item.Code === GroupCode);
  581. if (selectedGroup) {
  582. this.GroupCodeName = selectedGroup.Name; // 保存选中的检验项目组名称
  583. } else {
  584. this.GroupCodeName = ''; // 未找到时清空
  585. }
  586. this.getAllCheckGroupList(GroupCode);
  587. }
  588. //if (this.groupCode) {
  589. // // this.dataSource4Right = this.dataSource4Right.filter(x => x.RulesCode.includes(this.groupCode));
  590. // this.getAllCheckGroup();
  591. //}
  592. },
  593. handleCurrentChange(val) {
  594. this.selectItem4Item = val;
  595. },
  596. submitCheck() {
  597. //console.log(this.multipleSelection);
  598. //console.log(this.currentRow4Right);
  599. debugger;
  600. if (this.dataSource4Left.length === 1) {
  601. this.selectItem4Item = this.dataSource4Left[0]; // 自动选中唯一行
  602. }
  603. if (this.dataSource4Detail.length == 0) {
  604. $.modalMsg("必须存在检验项目行", "warning");
  605. return false;
  606. }
  607. if (!this.selectItem4Item) {
  608. $.modalMsg("请选择物料行");
  609. return false;
  610. }
  611. if (!this.EATTRIBUTE1) {
  612. $.modalMsg("请选择检验属性");
  613. return false;
  614. }
  615. if (!this.GroupCode) {
  616. $.modalMsg("请选择检验项目组");
  617. return false;
  618. }
  619. for (var i = 0; i < this.dataSource4Detail.length; i++) {
  620. let item = this.dataSource4Detail[i];
  621. if (item.EATTRIBUTE6 == '') {
  622. $.modalMsg("第" + (i + 1) + "行检验类型不能为空!", "warning");
  623. return false;
  624. }
  625. if (item.ListCode == '') {
  626. $.modalMsg("第" + (i + 1) + "行检验项目代码不能为空!", "warning");
  627. return false;
  628. }
  629. if (item.EATTRIBUTE6 == "Size") {
  630. if (item.SetValueMax === '' || item.SetValueMin === '') {
  631. $.modalMsg("当属性为定量时,最大值最小值单位必填,行号 " + (i + 1), "warning");
  632. return false;
  633. }
  634. // 2. 额外校验:必须是有效数字(避免输入字母、符号等)
  635. const minNum = Number(item.SetValueMin);
  636. const maxNum = Number(item.SetValueMax);
  637. if (isNaN(minNum) || isNaN(maxNum)) {
  638. $.modalMsg("当属性为定量时,最大值最小值必须为有效数字,行号 " + (i + 1), "warning");
  639. return false;
  640. }
  641. if (item.SetValueMin != 0 || item.SetValueMax != 0) {
  642. if (item.SetValueMin >= item.SetValueMax) {
  643. $.modalMsg("下限必须小于上限,行号 " + (i + 1), "warning");
  644. return false;
  645. }
  646. }
  647. if (item.Unit == '' || item.EATTRIBUTE7 == '') {
  648. $.modalMsg("当属性为定量时,单位与检验仪器必填,行号 " + (i + 1), "warning");
  649. return false;
  650. }
  651. if (item.SetValueMin >= item.SetValueMax) {
  652. $.modalMsg("下限必须小于上限,行号 " + (i + 1), "warning");
  653. return false;
  654. }
  655. }
  656. else {
  657. item.SetValueMax = null;
  658. item.SetValueMin = null;
  659. }
  660. item.InvCode = this.selectItem4Item.InvCode;
  661. item.InvName = this.selectItem4Item.InvName;
  662. item.CheckAttr = this.EATTRIBUTE1;
  663. }
  664. //this.item2CheckGroup.ItemList = [this.selectItem4Item];
  665. // 【新增:将检验项目组名称传入提交参数】
  666. this.item2CheckGroup.GroupCodeName = this.GroupCodeName; // 关键:添加名称字段
  667. this.item2CheckGroup.CheckItemList = this.dataSource4Detail;
  668. this.item2CheckGroup.GroupCode = this.GroupCode;
  669. //if (this.item2CheckGroup.ItemList.length != 1 || this.item2CheckGroup.CheckItemList.length == 0) {
  670. // $.modalMsg("必须选择物料行,检验类型行", "warning");
  671. // return false;
  672. //}
  673. this.$refs['form'].validate((valid) => {
  674. debugger;
  675. if (valid) {
  676. //alert('submit!');
  677. $.submitForm({
  678. url: "/DHAY/IQCQuality/SaveItem2CheckItem",
  679. param: { keyValue: JSON.stringify(this.item2CheckGroup) },
  680. success: function () {
  681. $.currentWindow().$("#gridList").trigger("reloadGrid");
  682. }
  683. })
  684. } else {
  685. console.log('error submit!!');
  686. return false;
  687. }
  688. });
  689. // console.log(result);
  690. },
  691. },
  692. });
  693. function submitForm() {
  694. //debugger;
  695. vm.submitCheck();
  696. }
  697. </script>