ydzpcjhtm.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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. <!-- 加载动画 -->
  11. <link rel="stylesheet" type="text/css" href="/static/css/loader.css">
  12. <script src="/static/js/jquery.min.js"></script>
  13. <script src="/static/js/bootstrap.min.js"></script>
  14. <script src="/static/js/vue-2.4.0.js"></script>
  15. <script src="/static/js/axios.min.js"></script>
  16. <script src="/static/js/vue-Cookies.js"></script>
  17. <script type="text/javascript" src="/static/js/jquery.select.js"></script>
  18. <script src="/static/js/bootstrap-select_new.js"></script>
  19. <!-- 图标js -->
  20. <!-- <script src="/static/js/ionicons.js"></script> -->
  21. <title>Document</title>
  22. </head>
  23. <body>
  24. <div id="app">
  25. <div class="navbar navbar-default">
  26. <div class="container">
  27. <!-- navbar-header用于设置内容横向显示 -->
  28. <div class="navbar-header">
  29. <a href="/index" class="navbar-brand"></a>
  30. </div>
  31. <!-- navbar-nav用来设置横向显示 -->
  32. <!-- navbar-right用来设置右浮动 -->
  33. <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
  34. <div class="hidden-xs">
  35. <ul class="nav navbar-nav">
  36. <li class="dropdown">
  37. <!--订单一览表-->
  38. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  39. 订单一览表
  40. <b class="caret"></b>
  41. </a>
  42. <ul class="nav dropdown-menu">
  43. <li><a href="/index">订单一览表</a></li>
  44. </ul>
  45. </li>
  46. <li class="dropdown">
  47. <!--月度产能评估表-->
  48. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  49. 月度产能评估表
  50. <b class="caret"></b>
  51. </a>
  52. <ul class="nav dropdown-menu">
  53. <li><a href="/depps">月度产能评估表</a></li>
  54. <li><a href="/dessettingtm">车间标准产能设置</a></li>
  55. </ul>
  56. </li>
  57. <li class="dropdown">
  58. <!--月度主排程计划-->
  59. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  60. 月度主排程计划
  61. <b class="caret"></b>
  62. </a>
  63. <ul class="nav dropdown-menu">
  64. <li><a href="/pcydscjhtm">PC月度生产计划(N+7)</a></li>
  65. <li><a href="/ydzpcjhtm">月度主排程计划</a></li>
  66. <li><a href="/ympxqjhtm">研磨品需求计划</a></li>
  67. <li><a href="/btmbxqtm">表头模板需求</a></li>
  68. </ul>
  69. </li>
  70. <li class="dropdown">
  71. <!--ie文件号管理-->
  72. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  73. IE工艺文件号管理
  74. <b class="caret"></b>
  75. </a>
  76. <ul class="nav dropdown-menu">
  77. <li><a href="/iefiletm">新增IE工艺文件号</a></li>
  78. <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
  79. <li><a href="/iefilemaintaindetailtm">IE效率明细表</a></li>
  80. <li><a href="/iefilemaintaininfotm">IE效率统计表</a></li>
  81. </ul>
  82. </li>
  83. </ul>
  84. <ul class="nav navbar-nav navbar-right">
  85. <li v-if="username !=''">
  86. <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
  87. </li>
  88. <li v-else><a href="">请登录</a></li>
  89. <li><a href="/login/" @click="logout()">退出登录</a></li>
  90. </ul>
  91. </div>
  92. </div>
  93. </div>
  94. <!--表头-->
  95. <div class="filter">
  96. <div class="container ">
  97. <label>
  98. <div class="navbar-nav">计划上线生产日期</div>
  99. <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timeqi' /></div>
  100. </label>
  101. <label>
  102. <div class="navbar-nav">至:</div>
  103. <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timezhi' />
  104. </div>
  105. </label>
  106. <label>
  107. <div class="navbar-nav">计划或受订单号:</div>
  108. <div class="navbar-nav">
  109. <input class="input form-control" id="so_no" type="text" autocomplete="off" />
  110. </div>
  111. </label>
  112. <label>
  113. <div class="navbar-nav">客户:</div>
  114. <div class="navbar-nav">
  115. <input class="input form-control" id="cus_no" type="text" autocomplete="off" />
  116. </div>
  117. </label>
  118. <label>
  119. <div class="navbar-nav">成品名称:</div>
  120. <div class="navbar-nav">
  121. <input class="input form-control" id="mrp_no" type="text" autocomplete="off" />
  122. </div>
  123. </label>
  124. <label class="save def" @click="seek('ok')">
  125. <div class="btn btn-primary navbar-nav">查询</div>
  126. </label>
  127. <label class="save def">
  128. <div class="btn btn-primary navbar-nav" @click="exportaa()">导出数据</div>
  129. </label>
  130. </div>
  131. </div>
  132. <div class="container">
  133. <table class="table table-hover">
  134. <tbody>
  135. <tr v-for="(item,i) in seek_data" :key="item.id">
  136. <td v-text="item.need_dd"></td>
  137. <td v-text="item.cus_no"></td>
  138. <td v-text="item.so_no"></td>
  139. <td v-text="item.mo_no"></td>
  140. <td v-text="item.knd"></td>
  141. <td v-text="item.scx"></td>
  142. <td v-text="item.mrp_no"></td>
  143. <td v-text="item.name"></td>
  144. <td v-text="item.qty"></td>
  145. <td v-text="item.gzwggs"></td>
  146. <td v-text="item.pmc_dd"></td>
  147. <td v-text="item.ymppt_dd"></td>
  148. <td v-text="item.rqdh_dd"></td>
  149. <td v-text="item.bcdh_dd"></td>
  150. <td v-text="item.prdt1_qty"></td>
  151. <td v-text="item.iebz"></td>
  152. <td v-text="item.xqry"></td>
  153. <td v-text="item.jhscrq"></td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. </div>
  158. <div class="page footer" style="display: none;">
  159. <ul class="pagination">
  160. <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
  161. {{ '第'+Number(page)+'页' }} {% endverbatim %}</button></li>
  162. <li><button type="button" class="btn btn-default previouspage" disabled="disabled"
  163. @click="click_page('up')" :disabled="page == 1 ? true : false">上一页</button></li>
  164. <li><button type="button" class="btn btn-default nextpage" @click="click_page('next')" :disabled="page == count_page ? true : false">下一页</button></li>
  165. <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
  166. {{ '共'+count_page+'页' }} {% endverbatim %}</button></li>
  167. <li><button type="button" class="btn btn-default" disabled="disabled">{% verbatim %}
  168. {{ '共'+total_count+'笔' }} {% endverbatim %}</button></li>
  169. </ul>
  170. </div>
  171. <div class="load" style="display: none;">
  172. <span></span>
  173. <span></span>
  174. <span></span>
  175. <span></span>
  176. <span></span>
  177. <span></span>
  178. <span></span>
  179. <span></span>
  180. </div>
  181. </div>
  182. <!-- 这里是导出数据 -->
  183. <script type="text/javascript" src="/static/js/export/exports.js"></script>
  184. <script>
  185. var vm = new Vue({
  186. el: '#app',
  187. data: {
  188. data_timeqi: '', //查询时间起
  189. data_timezhi: '', //查询时间止
  190. username: '', //登录用户名
  191. seek_data: [], //查询到的数据
  192. cls_id:'1' , //结案否
  193. count_page:0, //总页数
  194. page:1,//第几页
  195. total_count:0,//总记录数
  196. },
  197. mounted() {
  198. // 获取登录名
  199. // this.username=getCookie('username');
  200. this.username = $cookies.get('username')
  201. console.log($cookies.get('username'))
  202. },
  203. methods: {
  204. // 查询
  205. seek(n) {
  206. $(".footer").hide();
  207. $(".load").show();
  208. // 如果是点击查询清空分页数据
  209. if(n=='ok'){
  210. this.count_page = this.total_count = 0
  211. this.page = 1
  212. }
  213. // 初始化数据
  214. this.seek_data = []
  215. var titled = {
  216. "id": "id",
  217. "need_dd": "订单交货期",
  218. "cus_no": "客户代码",
  219. "so_no": "计划受订",
  220. "mo_no": "制令单号",
  221. "knd": "成品大类",
  222. "scx": "生产线",
  223. "mrp_no": "成品代码",
  224. "name": "成品名称",
  225. "qty": "制令数量",
  226. "gzwggs": "灌装未完工数量",
  227. "pmc_dd": "计划完成日期",
  228. "ymppt_dd": "研磨品齐套时间",
  229. "rqdh_dd": "容器到货时间",
  230. "bcdh_dd": "包材到货日期",
  231. "prdt1_qty": "当前库存",
  232. "iebz": "IE标准",
  233. "xqry": "需求人员",
  234. "id_no": "BOM代号",
  235. "jhscrq": "计划上线生产日期"
  236. }
  237. url = '/ydzpcjh/?'+'min_pmc_dd='+this.data_timeqi+'&'+'max_pmc_dd='+this.data_timezhi+'&'+'page='+this.page
  238. var cus_no = $("#cus_no").val().split('->')[0]
  239. if (cus_no){
  240. url = url + '&' + 'cus_no='+cus_no
  241. }
  242. var mrp_no = $("#mrp_no").val().split('->')[0]
  243. if (mrp_no){
  244. url = url + '&' + 'mrp_no='+ mrp_no
  245. }
  246. var so_no =$("#so_no").val().split('->')[0]
  247. if (so_no){
  248. url = url + '&' + 'so_no='+ so_no
  249. }
  250. console.log(url)
  251. axios.get(url, {
  252. // params: {
  253. // data_timeqi: this.data_timeqi,
  254. // data_timezhi: this.data_timezhi,
  255. // cls_id:this.cls_id
  256. // }
  257. }).then(res => {
  258. var data = res.data
  259. this.seek_data = data.results
  260. if (this.seek_data.length==0){
  261. alert("没有查询到数据")
  262. return
  263. }
  264. this.count_page = data.count_page
  265. this.total_count = data.count
  266. this.seek_data.splice(0,0,titled)
  267. $(".load").hide();
  268. $(".footer").show();
  269. }).catch(err => {
  270. alert(err.response["data"] + err.response["status"])
  271. })
  272. },
  273. // 点击分页
  274. click_page(n){
  275. if(n == 'up'){
  276. this.page = this.page -1
  277. }
  278. if(n == 'next'){
  279. this.page = this.page +1
  280. }
  281. this.seek('no')
  282. // if(this.page==1){
  283. // $(".previouspage").attr("disabled", "disabled");
  284. // }
  285. // else{
  286. // $('.previouspage').removeAttr('disabled')
  287. // }
  288. // if(this.page==this.count_page){
  289. // $(".nextpage").attr("disabled", "disabled");
  290. // }
  291. // else{
  292. // $('.nextpage').removeAttr('disabled')
  293. // }
  294. console.log(this.page)
  295. console.log(this.count_page)
  296. },
  297. // 导出数据
  298. exportaa() {
  299. // console.log(this.list)
  300. var filter = [];
  301. var title = [];
  302. exportExcel(this.seek_data, '月度主排产计划', title, filter);
  303. },
  304. //获取当前日期
  305. addDate() {
  306. var date = new Date();
  307. var seperator1 = "-";
  308. var year = date.getFullYear();
  309. var month = date.getMonth() + 1;
  310. var strDate = date.getDate();
  311. if (month >= 1 && month <= 9) {
  312. month = "0" + month;
  313. }
  314. if (strDate >= 0 && strDate <= 9) {
  315. strDate = "0" + strDate;
  316. }
  317. var currentdate = year + seperator1 + month + seperator1 + strDate;
  318. // console.log(currentdate)
  319. this.data_timeqi = this.data_timezhi = currentdate
  320. },
  321. //退出登录
  322. logout() {
  323. console.log("qweq")
  324. axios.delete('/login/', {
  325. params: {
  326. user_1: this.user_1,
  327. pswd: this.pswd,
  328. }
  329. })
  330. .then(res => {
  331. })
  332. .catch(err => {
  333. })
  334. },
  335. },
  336. created() {
  337. this.addDate()
  338. }
  339. });
  340. $(function () {
  341. // 开始写 jQuery 代码...
  342. var timer = null;
  343. // 定义一个公用的搜索接口
  344. // console.log(vm.$data.list)
  345. function getStr(n, url, field, clickif) {
  346. //n为搜索的参数 url为请求的路由,filed是定位表单的id,
  347. //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
  348. var search = n
  349. // 配置路由
  350. if (typeof search === 'undefined') {
  351. search = ''
  352. };
  353. // console.log(search)
  354. axios.get(url, {
  355. params: {
  356. search_no: search
  357. }
  358. })
  359. .then(res => {
  360. // alert(res.data)
  361. var data1 = res.data.data
  362. datas = data1
  363. // console.log(datas)
  364. if (datas.length == 0) {
  365. alert("没有搜索到数据")
  366. return
  367. }
  368. $.selectSuggest(field, datas);
  369. // 是否第一次进入
  370. if (clickif !== 1) {
  371. $("#" + field).trigger("click");
  372. }
  373. })
  374. .catch(err => {
  375. Console.log(err.response)
  376. alert(err.response["data"] + err.response["status"])
  377. })
  378. };
  379. //查询客户资料调用
  380. $("#cus_no").bind("input propertychange", function (event) {
  381. var search = $("#cus_no").val()
  382. // console.log($("#testInput").val())
  383. timer && clearTimeout(timer);
  384. timer = setTimeout(function () {
  385. getStr(search, '/cust/', 'cus_no');
  386. }, 1000);
  387. });
  388. getStr('', '/cust/', 'cus_no', 1);
  389. // 查询成品编码
  390. $("#mrp_no").bind("input propertychange", function (event) {
  391. var search = $("#mrp_no").val()
  392. // console.log($("#testInput").val())
  393. timer && clearTimeout(timer);
  394. timer = setTimeout(function () {
  395. getStr(search, '/prdt/', 'mrp_no');
  396. }, 1000);
  397. });
  398. getStr('', '/prdt/', 'mrp_no', 1);
  399. // 查询成品编码
  400. $("#so_no").bind("input propertychange", function (event) {
  401. var search = $("#so_no").val()
  402. // console.log($("#testInput").val())
  403. timer && clearTimeout(timer);
  404. timer = setTimeout(function () {
  405. getStr(search, '/jhsd/', 'so_no');
  406. }, 1000);
  407. });
  408. getStr('', '/jhsd/', 'so_no', 1);
  409. });
  410. </script>
  411. <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
  412. </body>
  413. </html>