btmbxqtm.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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-text="item.dep"></td>
  139. <td v-text="item.dep_name"></td>
  140. <td v-text="item.tjbz"></td>
  141. <td v-text="item.qty_fin"></td>
  142. <td v-text="item.xl"></td>
  143. </tr>
  144. </tbody>
  145. </table>
  146. </div>
  147. </div>
  148. <!-- 这里是导出数据 -->
  149. <script type="text/javascript" src="/static/js/export/exports.js"></script>
  150. <script>
  151. var vm = new Vue({
  152. el: '#app',
  153. data: {
  154. data_timeqi: '', //查询时间起
  155. data_timezhi: '', //查询时间止
  156. username: '', //登录用户名
  157. seek_data: [], //查询到的数据
  158. cls_id:'1' //结案否
  159. },
  160. mounted() {
  161. // 获取登录名
  162. // this.username=getCookie('username');
  163. this.username = $cookies.get('username')
  164. console.log($cookies.get('username'))
  165. },
  166. methods: {
  167. // 查询
  168. seek() {
  169. var erp_dep = $('#erp_dep').val()
  170. if(erp_dep.indexOf("->") != -1){
  171. erp_dep = erp_dep.split("->")[0]
  172. }
  173. var iefileno = $('#iefileno').val()
  174. if(iefileno.indexOf("->") != -1){
  175. iefileno = iefileno.split("->")[0]
  176. }
  177. axios.get('/iefilemaintaininfo/', {
  178. params: {
  179. erp_dep: erp_dep,
  180. iefileno: iefileno,
  181. data_timeqi: this.data_timeqi,
  182. data_timezhi: this.data_timezhi,
  183. cls_id:this.cls_id
  184. }
  185. }).then(res => {
  186. var data = res.data.data
  187. this.seek_data = data
  188. console.log(this.seek_data)
  189. }).catch(err => {
  190. alert(err.response["data"] + err.response["status"])
  191. })
  192. },
  193. // 导出数据
  194. exportaa() {
  195. // console.log(this.list)
  196. var filter = [];
  197. var title = [];
  198. exportExcel(this.seek_data, 'IE效率统计表', title, filter);
  199. },
  200. //获取当前日期
  201. addDate() {
  202. var date = new Date();
  203. var seperator1 = "-";
  204. var year = date.getFullYear();
  205. var month = date.getMonth() + 1;
  206. var strDate = date.getDate();
  207. if (month >= 1 && month <= 9) {
  208. month = "0" + month;
  209. }
  210. if (strDate >= 0 && strDate <= 9) {
  211. strDate = "0" + strDate;
  212. }
  213. var currentdate = year + seperator1 + month + seperator1 + strDate;
  214. // console.log(currentdate)
  215. this.data_timeqi = this.data_timezhi = currentdate
  216. },
  217. //退出登录
  218. logout() {
  219. console.log("qweq")
  220. axios.delete('/login/', {
  221. params: {
  222. user_1: this.user_1,
  223. pswd: this.pswd,
  224. }
  225. })
  226. .then(res => {
  227. })
  228. .catch(err => {
  229. })
  230. },
  231. },
  232. created() {
  233. this.addDate()
  234. }
  235. });
  236. $(function () {
  237. // 开始写 jQuery 代码...
  238. var timer = null;
  239. // 定义一个公用的搜索接口
  240. // console.log(vm.$data.list)
  241. function getStr(n, url, field, clickif) {
  242. //n为搜索的参数 url为请求的路由,filed是定位表单的id,
  243. //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
  244. var search = n
  245. // 配置路由
  246. if (typeof search === 'undefined') {
  247. search = ''
  248. };
  249. // console.log(search)
  250. axios.get(url, {
  251. params: {
  252. search_no: search
  253. }
  254. })
  255. .then(res => {
  256. // alert(res.data)
  257. var data1 = res.data.data
  258. datas = data1
  259. // console.log(datas)
  260. if (datas.length == 0) {
  261. alert("没有搜索到数据")
  262. return
  263. }
  264. $.selectSuggest(field, datas);
  265. // 是否第一次进入
  266. if (clickif !== 1) {
  267. $("#" + field).trigger("click");
  268. }
  269. })
  270. .catch(err => {
  271. Console.log(err.response)
  272. alert(err.response["data"] + err.response["status"])
  273. })
  274. };
  275. //查询部门资料调用
  276. $("#erp_dep").bind("input propertychange", function (event) {
  277. var search = $("#erp_dep").val()
  278. // console.log($("#testInput").val())
  279. timer && clearTimeout(timer);
  280. timer = setTimeout(function () {
  281. getStr(search, '/dept/', 'erp_dep');
  282. }, 1000);
  283. });
  284. getStr('', '/dept/', 'erp_dep', 1);
  285. // 查询ie文件号
  286. $("#iefileno").bind("input propertychange", function (event) {
  287. var search = $("#iefileno").val()
  288. // console.log($("#testInput").val())
  289. timer && clearTimeout(timer);
  290. timer = setTimeout(function () {
  291. getStr(search, '/iefileno/', 'iefileno');
  292. }, 1000);
  293. });
  294. getStr('', '/iefileno/', 'iefileno', 1);
  295. });
  296. </script>
  297. <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
  298. </body>
  299. </html>