iefilemaintaindetail.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <html lang="en">
  2. <head>
  3. <meta charset="UTF-8">
  4. <meta name="viewport" content="widtd=device-widtd, initial-scale=1.0">
  5. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  6. <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
  7. <link rel="stylesheet" type="text/css" href="/static/css/css.css">
  8. <link rel="stylesheet" type="text/css" href="/static/css/iefilemaintaindetail.css">
  9. <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
  10. <script src="/static/js/jquery.min.js"></script>
  11. <script src="/static/js/bootstrap.min.js"></script>
  12. <script src="/static/js/vue-2.4.0.js"></script>
  13. <script src="/static/js/axios.min.js"></script>
  14. <script src="/static/js/vue-Cookies.js"></script>
  15. <script type="text/javascript" src="/static/js/jquery.select.js"></script>
  16. <script src="/static/js/bootstrap-select_new.js"></script>
  17. <!-- 图标js -->
  18. <!-- <script src="/static/js/ionicons.js"></script> -->
  19. <title>Document</title>
  20. </head>
  21. <body>
  22. <div id="app">
  23. <div class="navbar navbar-default">
  24. <div class="container">
  25. <!-- navbar-header用于设置内容横向显示 -->
  26. <div class="navbar-header">
  27. <a href="/index" class="navbar-brand"></a>
  28. </div>
  29. <!-- navbar-nav用来设置横向显示 -->
  30. <!-- navbar-right用来设置右浮动 -->
  31. <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
  32. <div class="hidden-xs">
  33. <ul class="nav navbar-nav">
  34. <li class="dropdown">
  35. <!--订单一览表-->
  36. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  37. 订单一览表
  38. <b class="caret"></b>
  39. </a>
  40. <ul class="nav dropdown-menu">
  41. <li><a href="/index">订单一览表</a></li>
  42. </ul>
  43. </li>
  44. <li class="dropdown">
  45. <!--月度产能评估表-->
  46. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  47. 月度产能评估表
  48. <b class="caret"></b>
  49. </a>
  50. <ul class="nav dropdown-menu">
  51. <li><a href="/depps">月度产能评估表</a></li>
  52. <li><a href="/dessettingtm">车间标准产能设置</a></li>
  53. </ul>
  54. </li>
  55. <li class="dropdown">
  56. <!--月度主排程计划-->
  57. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  58. 月度主排程计划
  59. <b class="caret"></b>
  60. </a>
  61. <ul class="nav dropdown-menu">
  62. <li><a href="/pcydscjhtm">PC月度生产计划(N+7)</a></li>
  63. <li><a href="/ydzpcjhtm">月度主排程计划</a></li>
  64. <li><a href="/ympxqjhtm">研磨品需求计划</a></li>
  65. <li><a href="/btmbxqtm">表头模板需求</a></li>
  66. </ul>
  67. </li>
  68. <li class="dropdown">
  69. <!--ie文件号管理-->
  70. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  71. IE工艺文件号管理
  72. <b class="caret"></b>
  73. </a>
  74. <ul class="nav dropdown-menu">
  75. <li><a href="/iefiletm">新增IE工艺文件号</a></li>
  76. <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
  77. <li><a href="/iefilemaintaindetailtm">IE效率明细表</a></li>
  78. <li><a href="/iefilemaintaininfotm">IE效率统计表</a></li>
  79. </ul>
  80. </li>
  81. </ul>
  82. <ul class="nav navbar-nav navbar-right">
  83. <li v-if="username !=''">
  84. <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
  85. </li>
  86. <li v-else><a href="">请登录</a></li>
  87. <li><a href="/login/" @click="logout()">退出登录</a></li>
  88. </ul>
  89. </div>
  90. </div>
  91. </div>
  92. <!--表头-->
  93. <div class="filter">
  94. <div class="container ">
  95. <label>
  96. <div class="navbar-nav">日期:</div>
  97. <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timeqi' /></div>
  98. </label>
  99. <label>
  100. <div class="navbar-nav">至:</div>
  101. <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timezhi' />
  102. </div>
  103. </label>
  104. <label>
  105. <div class="navbar-nav">车间:</div>
  106. <div class="navbar-nav">
  107. <input class="input form-control" id="erp_dep" type="text" autocomplete="off" />
  108. </div>
  109. </label>
  110. <label>
  111. <div class="navbar-nav">IE工艺文件号:</div>
  112. <div class="navbar-nav">
  113. <input class="input form-control" id="iefileno" type="text" autocomplete="off" />
  114. </div>
  115. </label>
  116. <label>
  117. <div class="navbar-nav">结案否:</div>
  118. <div class="navbar-nav">
  119. <select class="input form-control" v-model="cls_id">
  120. <option value="1" selected="selected">全部</option>
  121. <option value="2">结案</option>
  122. <option value="3">未结案</option>
  123. </select>
  124. </div>
  125. </label>
  126. <label class="save def" @click="seek()">
  127. <div class="btn btn-primary navbar-nav">查询</div>
  128. </label>
  129. <label class="save def">
  130. <div class="btn btn-primary navbar-nav" @click="exportaa()">导出数据</div>
  131. </label>
  132. </div>
  133. </div>
  134. <div class="container">
  135. <table class="table table-hover">
  136. <tbody>
  137. <tr v-for="(item,i) in seek_data" ::key="i">
  138. <td v-if="i>0" v-text="i"></td>
  139. <td v-else>行号</td>
  140. <td v-text="item.gdmc_mb"></td>
  141. <td v-text="item.prd_no"></td>
  142. <td v-text="item.prd_name"></td>
  143. <td v-text="item.so_no"></td>
  144. <td v-text="item.zyxt_mb"></td>
  145. <td v-text="item.dep_name"></td>
  146. <td v-text="item.t_wh"></td>
  147. <td v-text="item.t_qty"></td>
  148. <td v-text="item.jjdj_mb"></td>
  149. <td v-text="item.jj_up"></td>
  150. <td v-text="item.mo_bc_qty"></td>
  151. <td v-text="item.mo_ym_qty"></td>
  152. <td v-text="item.cj_qty"></td>
  153. <td v-text="item.job_time"></td>
  154. <td v-text="item.file_serial"></td>
  155. <td v-text="item.xxcn_t_mb"></td>
  156. <td v-text="item.rjcn_t_mb"></td>
  157. <td v-text="item.mo_cli_id"></td>
  158. <td v-text="item.mo_no"></td>
  159. <td v-text="item.mo_qty"></td>
  160. <td v-text="item.ws__mo_qty"></td>
  161. <td v-text="item.sh_mo_qty"></td>
  162. <td v-text="item.dep_qty_sum"></td>
  163. <td v-text="item.total_manpower"></td>
  164. <td v-text="item.s_ie"></td>
  165. </tr>
  166. </tbody>
  167. </table>
  168. </div>
  169. </div>
  170. <!-- 这里是导出数据 -->
  171. <script type="text/javascript" src="/static/js/export/exports.js"></script>
  172. <script>
  173. var vm = new Vue({
  174. el: '#app',
  175. data: {
  176. data_timeqi: '', //查询时间起
  177. data_timezhi: '', //查询时间止
  178. username: '', //登录用户名
  179. seek_data: [], //查询到的数据
  180. cls_id:'1' //结案否
  181. },
  182. mounted() {
  183. // 获取登录名
  184. // this.username=getCookie('username');
  185. this.username = $cookies.get('username')
  186. console.log($cookies.get('username'))
  187. },
  188. methods: {
  189. // 查询
  190. seek() {
  191. var erp_dep = $('#erp_dep').val()
  192. if(erp_dep.indexOf("->") != -1){
  193. erp_dep = erp_dep.split("->")[0]
  194. }
  195. var iefileno = $('#iefileno').val()
  196. if(iefileno.indexOf("->") != -1){
  197. iefileno = iefileno.split("->")[0]
  198. }
  199. axios.get('/iefilemaintaindetail/', {
  200. params: {
  201. erp_dep: erp_dep,
  202. iefileno: iefileno,
  203. data_timeqi: this.data_timeqi,
  204. data_timezhi: this.data_timezhi,
  205. cls_id:this.cls_id
  206. }
  207. }).then(res => {
  208. var data = res.data.data
  209. this.seek_data = data
  210. console.log(this.seek_data)
  211. }).catch(err => {
  212. alert(err.response["data"] + err.response["status"])
  213. })
  214. },
  215. // 导出数据
  216. exportaa() {
  217. // console.log(this.list)
  218. var filter = [];
  219. var title = [];
  220. exportExcel(this.seek_data, 'IE效率明细表', title, filter);
  221. },
  222. //获取当前日期
  223. addDate() {
  224. var date = new Date();
  225. var seperator1 = "-";
  226. var year = date.getFullYear();
  227. var month = date.getMonth() + 1;
  228. var strDate = date.getDate();
  229. if (month >= 1 && month <= 9) {
  230. month = "0" + month;
  231. }
  232. if (strDate >= 0 && strDate <= 9) {
  233. strDate = "0" + strDate;
  234. }
  235. var currentdate = year + seperator1 + month + seperator1 + strDate;
  236. // console.log(currentdate)
  237. this.data_timeqi = this.data_timezhi = currentdate
  238. },
  239. //退出登录
  240. logout() {
  241. console.log("qweq")
  242. axios.delete('/login/', {
  243. params: {
  244. user_1: this.user_1,
  245. pswd: this.pswd,
  246. }
  247. })
  248. .then(res => {
  249. })
  250. .catch(err => {
  251. })
  252. },
  253. },
  254. created() {
  255. this.addDate()
  256. }
  257. });
  258. $(function () {
  259. // 开始写 jQuery 代码...
  260. var timer = null;
  261. // 定义一个公用的搜索接口
  262. // console.log(vm.$data.list)
  263. function getStr(n, url, field, clickif) {
  264. //n为搜索的参数 url为请求的路由,filed是定位表单的id,
  265. //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
  266. var search = n
  267. // 配置路由
  268. if (typeof search === 'undefined') {
  269. search = ''
  270. };
  271. // console.log(search)
  272. axios.get(url, {
  273. params: {
  274. search_no: search
  275. }
  276. })
  277. .then(res => {
  278. // alert(res.data)
  279. var data1 = res.data.data
  280. datas = data1
  281. // console.log(datas)
  282. if (datas.length == 0) {
  283. alert("没有搜索到数据")
  284. return
  285. }
  286. $.selectSuggest(field, datas);
  287. // 是否第一次进入
  288. if (clickif !== 1) {
  289. $("#" + field).trigger("click");
  290. }
  291. })
  292. .catch(err => {
  293. Console.log(err.response)
  294. alert(err.response["data"] + err.response["status"])
  295. })
  296. };
  297. //查询部门资料调用
  298. $("#erp_dep").bind("input propertychange", function (event) {
  299. var search = $("#erp_dep").val()
  300. // console.log($("#testInput").val())
  301. timer && clearTimeout(timer);
  302. timer = setTimeout(function () {
  303. getStr(search, '/dept/', 'erp_dep');
  304. }, 1000);
  305. });
  306. getStr('', '/dept/', 'erp_dep', 1);
  307. // 查询ie文件号
  308. $("#iefileno").bind("input propertychange", function (event) {
  309. var search = $("#iefileno").val()
  310. // console.log($("#testInput").val())
  311. timer && clearTimeout(timer);
  312. timer = setTimeout(function () {
  313. getStr(search, '/iefileno/', 'iefileno');
  314. }, 1000);
  315. });
  316. getStr('', '/iefileno/', 'iefileno', 1);
  317. });
  318. </script>
  319. <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
  320. </body>
  321. </html>