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.

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