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.

227 lines
7.6 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" :rules="rules" label-width="130px">
  18. @*<el-divider>主表信息</el-divider>*@
  19. <br />
  20. <br />
  21. <el-row :gutter="24">
  22. <el-col :span="24">
  23. <el-form-item label="判定结果" prop="FinalResult">
  24. <el-radio-group v-model="form.FinalResult" v-on:change="change4FinalResult">
  25. <el-radio-button label="合格"></el-radio-button>
  26. <el-radio-button label="NG"></el-radio-button>
  27. </el-radio-group>
  28. </el-form-item>
  29. </el-col>
  30. </el-row>
  31. <el-row :gutter="24">
  32. <el-col :span="16">
  33. <el-form-item label="备注" prop="Remark">
  34. <el-input v-model="form.Remark" size="mini" ></el-input>
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. </el-form>
  39. </template>
  40. </div>
  41. </form>
  42. <script type="text/javascript">
  43. //const { Console } = require("node:console");
  44. var vm = new Vue({
  45. el: '#app',
  46. data: {
  47. id:'',
  48. userCode: "",
  49. ssList: [],
  50. form: {},
  51. dataSource4Test: [],
  52. currentRow4Test:null,
  53. rules: {
  54. },
  55. disabled4RulesCode: false,
  56. disabled4SpecialNo:false,
  57. disabled4GoodQty:false,
  58. disabled4NgQty: false,
  59. fileName:'',
  60. },
  61. //挂在DOM 触发
  62. mounted() {
  63. //let reactiveObject = {
  64. //};
  65. //this.form = reactiveObject;
  66. // this.loadGrid();
  67. // this.show();
  68. this.id = '@ViewData["ids"]';
  69. this.judgeRole='@ViewData["judgeRole"]';
  70. this.initControl();
  71. this.loadEvent();
  72. // console.log(this.id);
  73. },
  74. beforeDestroy() {
  75. // this.autoScrol1(true);
  76. },
  77. methods: {
  78. loadEvent() {
  79. let that = this;
  80. debugger;
  81. },
  82. initControl: function () {
  83. let that = this;
  84. let orgName = '';
  85. this.disabled4RulesCode = this.id ? true : false;
  86. let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
  87. // console.log(userName);
  88. //this.getAllBRGCode();
  89. //this.getAllBCGCode();
  90. this.getData();
  91. },
  92. change4FinalResult(val) {
  93. if (!val) {
  94. return;
  95. }
  96. },
  97. getData() {
  98. if (!this.id) return;
  99. let _this = this;
  100. axios
  101. .get('/BBWMS/IQCQuality/GetMaterialReJudgeMain?keyValue=' + _this.id)
  102. .then(function (res) {
  103. // debugger;
  104. if (res.data) {
  105. for (var i in res.data) {
  106. Vue.set(vm.form, i, res.data[i]);
  107. }
  108. _this.form.FinalResult = '合格';
  109. //_this.form.JudgeRole = _this.judgeRole;
  110. //if (!_this.form.FinalResult) {
  111. // _this.form.FinalResult = 'NG';
  112. // _this.change4FinalResult(_this.form.FinalResult);
  113. //}
  114. }
  115. })
  116. .then(function () {
  117. axios
  118. .get("/BBWMS/IQCQuality/GetMaterialInStorageCheckDetailList2?code=" + _this.form.AsnCode + "&lotno=" + _this.form.InvBatcgNo + "&invCode=" + _this.form.InvCode)
  119. .then(function (res) {
  120. debugger;
  121. if (res.data) {
  122. res.data.forEach(function (el, i) {
  123. Vue.set(vm.dataSource4Test, i, el)
  124. });
  125. }
  126. })
  127. })
  128. .catch(function (error) { // 请求失败处理
  129. alert(error);
  130. });
  131. },
  132. submitCheck() {
  133. debugger;
  134. if (!this.form.Result) {
  135. $.modalMsg("必须存在检验结果", "warning");
  136. return false;
  137. }
  138. if (!this.form.FinalResult) {
  139. $.modalMsg("必须存在终判结果", "warning");
  140. return false;
  141. }
  142. if (this.form.FinalResult == "NG") {
  143. for (var i = 0; i < this.dataSource4Test.length; i++) {
  144. let item = this.dataSource4Test[i];
  145. item.NgQty = item.Quantity;
  146. item.GoodQty = 0;
  147. item.InQty = 0;
  148. //if (!item.GoodQty && !item.NgQty) {
  149. // $.modalMsg("必须填写合格不合格数量", "warning");
  150. // return false;
  151. //}
  152. }
  153. }
  154. else if (this.form.FinalResult == "合格") {
  155. for (var i = 0; i < this.dataSource4Test.length; i++) {
  156. let item = this.dataSource4Test[i];
  157. item.NgQty =0;
  158. item.GoodQty = item.Quantity;
  159. item.InQty = 0;
  160. }
  161. }
  162. else {
  163. }
  164. //this.form.CCList = this.dataSource4CC;
  165. //this.form.WGList = this.dataSource4WG;
  166. this.form.FinalItemLotList = this.dataSource4Test;
  167. this.$refs['form'].validate((valid) => {
  168. if (valid) {
  169. //alert('submit!');
  170. $.submitForm({
  171. url: "/BBWMS/IQCQuality/SaveMaterialCheckFinalJudgeResult",
  172. param: { keyValue: JSON.stringify(this.form) },
  173. success: function () {
  174. $.currentWindow().$("#gridList").trigger("reloadGrid");
  175. }
  176. })
  177. } else {
  178. console.log('error submit!!');
  179. return false;
  180. }
  181. });
  182. // console.log(result);
  183. },
  184. },
  185. });
  186. function submitForm() {
  187. //debugger;
  188. vm.submitCheck();
  189. }
  190. function UpLoadClick() {
  191. //var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
  192. //if (ids.length != 1) {
  193. // $.modalAlertNew("WMS00050");
  194. // return;
  195. //}
  196. $("#FileUp2").click();
  197. }
  198. </script>