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.

206 lines
7.4 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="80px">
  18. <el-divider></el-divider>
  19. <el-row :gutter="24">
  20. <el-col :span="24">
  21. </el-col>
  22. </el-row>
  23. <el-row :gutter="24">
  24. <el-col :span="2">
  25. &nbsp;&nbsp;
  26. </el-col>
  27. <el-col :span="20">
  28. <el-table ref="dataSource4File" highlight-current-row
  29. :data="dataSource4File"
  30. style="width: 100%"
  31. stripe border
  32. size="mini"
  33. height="200"
  34. v-on:selection-change="handleSelectionChange4File">
  35. <el-table-column type="index" width="50"></el-table-column>
  36. <el-table-column type="selection" width="55"> </el-table-column>
  37. <el-table-column prop="InvCode" label="料品编码" width="100">
  38. </el-table-column>
  39. <el-table-column prop="InvName" label="料品名称" width="100">
  40. </el-table-column>
  41. <el-table-column prop="InvStd" label="规格型号" width="100">
  42. </el-table-column>
  43. <el-table-column prop="MUSERName" label="维护人" width="100">
  44. </el-table-column>
  45. <el-table-column prop="MTIME" label="维护时间" width="150">
  46. </el-table-column>
  47. <el-table-column prop="FileName" label="文件名称" width="100">
  48. </el-table-column>
  49. <el-table-column label="操作">
  50. <template slot-scope="scope">
  51. <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>
  52. <a id="NF-Add" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="handleView(scope.$index, scope.row)"><i class="fa fa-pencil-square-o"></i>预览</a>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. </el-col>
  57. <el-col :span="2">
  58. &nbsp;&nbsp;
  59. </el-col>
  60. </el-row>
  61. </el-form>
  62. </template>
  63. </div>
  64. </form>
  65. <script type="text/javascript">
  66. //const { Console } = require("node:console");
  67. var vm = new Vue({
  68. el: '#app',
  69. data: {
  70. id:'',
  71. userCode: "",
  72. ssList: [],
  73. form: {},
  74. detail: {
  75. key:0,
  76. SetValueMin: 0,
  77. SetValueMax: 0,
  78. SampleQuantity: 0,
  79. EATTRIBUTE1: 0,
  80. EATTRIBUTE2: 0,
  81. EATTRIBUTE3: 0,
  82. },
  83. currentRow4Right: null,//规则单选
  84. rules: {
  85. RulesCode: [{ required: true, message: '请输入', trigger: 'blur' },],
  86. RulesName: [{ required: true, message: '请输入', trigger: 'blur' },],
  87. },
  88. dataSource4File: [],
  89. multipleSelection:[],
  90. },
  91. //挂在DOM 触发
  92. mounted() {
  93. let reactiveObject = {
  94. RulesCode: '',
  95. RulesName: '',
  96. RulesDesc: '',
  97. Type: '',
  98. Enable: true,
  99. DetailList: [],
  100. };
  101. this.form = reactiveObject;
  102. // this.loadGrid();
  103. // this.show();
  104. this.id = '@ViewData["ids"]';
  105. this.initControl();
  106. // console.log(this.id);
  107. },
  108. beforeDestroy() {
  109. // this.autoScrol1(true);
  110. },
  111. methods: {
  112. //删除行
  113. handleDelete(index, row) {
  114. //debugger;
  115. // console.log(index, row);
  116. this.dataSource4File = this.dataSource4File.filter(x => x.FileID != row.FileID);
  117. let ids = [];
  118. ids.push(row.FileID);
  119. axios
  120. .post('/BBWMS/IQCQuality/DeleteItem2AqlFile', { keyValue: JSON.stringify(ids) })
  121. .then(function (res) {
  122. if (res.data.state == "success") {
  123. $.modalMsg("操作成功", "success");
  124. // that.query();
  125. }
  126. else
  127. $.modalMsg(res.data.message, "warning");
  128. })
  129. .catch(function (error) { // 请求失败处理
  130. alert(error);
  131. });
  132. },
  133. handleView(index, row) {
  134. // debugger;
  135. axios
  136. .get('/BBWMS/IQCQuality/GetItem2AqlFilePath?fileName=' + row.FileName)
  137. .then(function (res) {
  138. if (res.data) {
  139. //console.log(res.data.message);
  140. window.open(res.data.message);
  141. }
  142. })
  143. .catch(function (error) { // 请求失败处理
  144. alert(error);
  145. });
  146. },
  147. initControl: function () {
  148. let that = this;
  149. // let orgName = '';
  150. // this.disabled4RulesCode = this.id ? true : false;
  151. let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
  152. // console.log(userName);
  153. this.getData();
  154. //this.getAllItem();
  155. //this.getAllAql();
  156. },
  157. getData() {
  158. if (!this.id) return;
  159. axios
  160. .get('/BBWMS/IQCQuality/GetItem2AqlFileList?keyValue=' + this.id)
  161. .then(function (res) {
  162. if (res.data) {
  163. res.data.forEach(function (el, i) {
  164. Vue.set(vm.dataSource4File, i, el)
  165. });
  166. }
  167. })
  168. .catch(function (error) { // 请求失败处理
  169. alert(error);
  170. });
  171. },
  172. handleSelectionChange4File(val) {
  173. this.multipleSelection = val;
  174. },
  175. submitCheck() {
  176. //$.submitForm({});
  177. $.currentWindow().$("#gridList").trigger("reloadGrid");
  178. },
  179. },
  180. });
  181. function submitForm() {
  182. //debugger;
  183. vm.submitCheck();
  184. }
  185. </script>