dessetting.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. <!-- 加载动画 -->
  9. <link rel="stylesheet" type="text/css" href="/static/css/loader.css">
  10. <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
  11. <script src="/static/js/jquery.min.js"></script>
  12. <script src="/static/js/bootstrap.min.js"></script>
  13. <script src="/static/js/vue-2.4.0.js"></script>
  14. <script src="/static/js/axios.min.js"></script>
  15. <script src="/static/js/vue-Cookies.js"></script>
  16. <script type="text/javascript" src="/static/js/jquery.select.js"></script>
  17. <script src="/static/js/bootstrap-select_new.js"></script>
  18. <title>Document</title>
  19. </head>
  20. <body>
  21. <div id="app">
  22. <div class="navbar navbar-default">
  23. <div class="container">
  24. <!-- navbar-header用于设置内容横向显示 -->
  25. <div class="navbar-header">
  26. <a href="/index" class="navbar-brand"></a>
  27. </div>
  28. <!-- navbar-nav用来设置横向显示 -->
  29. <!-- navbar-right用来设置右浮动 -->
  30. <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
  31. <div class="hidden-xs">
  32. <ul class="nav navbar-nav">
  33. <li class="dropdown">
  34. <!--订单一览表-->
  35. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  36. 订单一览表
  37. <b class="caret"></b>
  38. </a>
  39. <ul class="nav dropdown-menu">
  40. <li><a href="/index">订单一览表</a></li>
  41. </ul>
  42. </li>
  43. <li class="dropdown">
  44. <!--月度产能评估表-->
  45. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  46. 月度产能评估表
  47. <b class="caret"></b>
  48. </a>
  49. <ul class="nav dropdown-menu">
  50. <li><a href="/depps">月度产能评估表</a></li>
  51. <li><a href="/dessettingtm">车间标准产能设置</a></li>
  52. </ul>
  53. </li>
  54. <li class="dropdown">
  55. <!--月度主排程计划-->
  56. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  57. 月度主排程计划
  58. <b class="caret"></b>
  59. </a>
  60. <ul class="nav dropdown-menu">
  61. <li><a href="/pcydscjhtm">PC月度生产计划(N+7)</a></li>
  62. <li><a href="/ydzpcjhtm">月度主排程计划</a></li>
  63. <li><a href="/ympxqjhtm">研磨品需求计划</a></li>
  64. <li><a href="/btmbxqtm">表头模板需求</a></li>
  65. </ul>
  66. </li>
  67. <li class="dropdown">
  68. <!--ie文件号管理-->
  69. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  70. IE工艺文件号管理
  71. <b class="caret"></b>
  72. </a>
  73. <ul class="nav dropdown-menu">
  74. <li><a href="/iefiletm">新增IE工艺文件号</a></li>
  75. <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
  76. <li><a href="/iefilemaintaindetailtm">IE效率明细表</a></li>
  77. <li><a href="/iefilemaintaininfotm">IE效率统计表</a></li>
  78. </ul>
  79. </li>
  80. </ul>
  81. <ul class="nav navbar-nav navbar-right">
  82. <li v-if="username !=''">
  83. <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
  84. </li>
  85. <li v-else><a href="">请登录</a></li>
  86. <li><a href="/login/" @click="logout()">退出登录</a></li>
  87. </ul>
  88. </div>
  89. </div>
  90. </div>
  91. <!--搜索-->
  92. <div class="filter">
  93. <div class="container ">
  94. <label>
  95. <div class="navbar-nav">部门:</div>
  96. <div class="navbar-nav">
  97. <input class="input form-control" id="testInput" type="text"
  98. autocomplete="off" />
  99. </div>
  100. </label>
  101. <!-- <label class="save" @click="seek()">确定查询</label> -->
  102. <label class="save def" id="def" @click="seek(1)">
  103. <div class="btn btn-primary navbar-nav">确定查询</div>
  104. </label>
  105. </div>
  106. </div>
  107. <!-- 内容 -->
  108. <!-- container这个类是设置居中对齐 -->
  109. <div class="container">
  110. <!-- row这个类是用于设置取消内边距 -->
  111. <table class="table table-bordered table-hover table-striped">
  112. <tbody>
  113. <tr class="save" v-for="(item,i) in list" :key="item.dep"
  114. :class="i == activeIndex?'tr_active':''">
  115. <td v-if="i >0" width="50px" v-text="i"></td>
  116. <td v-else width="50px" v-text="'行号'"></td>
  117. <td width="50px" v-text="item.dep"></td>
  118. <td width="200px" v-text="item.dep_name"></td>
  119. <td width="100px" v-text="item.up"></td>
  120. <td width="200px" v-text="item.up_dd"></td>
  121. <td v-if="i >0" width="120px"><input type='number' min="0" class="input" v-model="item.s_capacity" /></td>
  122. <td v-else width="120px" v-text="item.s_capacity"></td>
  123. <td v-if="i >0" width="120px"><input type='number' min="0" class="input" v-model="item.s_d_staffing" /></td>
  124. <td v-else width="120px" v-text="item.s_d_staffing"></td>
  125. <!-- <td v-if="i >0" width="120px"><input type="checkbox" :checked="item.selected=='T'?'checked':''" /></td> -->
  126. <td v-if="i >0" width="120px"><input type="checkbox" v-model="item.selected"/></td>
  127. <td v-else width="120px" v-text="item.selected"></td>
  128. <td v-if="i >0" width="50px">
  129. <button class="btn btn-primary" @click="ok_save(item.dep,item.s_capacity,item.s_d_staffing,i,item.selected)">保存</button></td>
  130. <td v-else width="50px" v-text="item.operation"></td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. </div>
  135. <div class="footer refresh">
  136. <div class="load">
  137. <span></span>
  138. <span></span>
  139. <span></span>
  140. <span></span>
  141. <span></span>
  142. <span></span>
  143. <span></span>
  144. <span></span>
  145. </div>
  146. </div>
  147. </div>
  148. <script>
  149. var vm = new Vue({
  150. el: '#app',
  151. data: {
  152. activeIndex: 0,
  153. dep:'',
  154. list: [],
  155. username: ''
  156. },
  157. mounted() {
  158. // 获取登录名
  159. // this.username=getCookie('username');
  160. this.username = $cookies.get('username')
  161. console.log($cookies.get('username'))
  162. },
  163. methods: {
  164. seek(i) { // 添加的方法
  165. // console.log('ok')
  166. // 添加一个对象用于增加数据
  167. // 获取货品
  168. this.dep = $("#testInput").val()
  169. if (this.dep == undefined) {
  170. this.dep = ''
  171. }
  172. if (this.dep == null) {
  173. this.dep = ''
  174. }
  175. // 清空数据
  176. this.list = ''
  177. $(".refresh").show();
  178. axios.get('/dessetting', {
  179. params: {
  180. dep:this.dep
  181. },
  182. })
  183. .then(res => {
  184. this.list = res.data.data
  185. // console.log(this.list)
  186. $(".refresh").hide();
  187. })
  188. .catch(err => {
  189. alert(err.response["data"] + err.response["status"])
  190. })
  191. },
  192. ok_save(dep, s_capacity, s_d_staffing, i,selected) {
  193. // console.log('ok1')
  194. // console.log(OS_NO, PMC_DD, WH_REM, ITM)
  195. // this.activeIndex = i
  196. var dep = dep
  197. var s_capacity = s_capacity
  198. var s_d_staffing = s_d_staffing
  199. axios.put('/dessetting/', {
  200. data: {
  201. dep: dep,
  202. s_capacity: s_capacity,
  203. s_d_staffing: s_d_staffing,
  204. selected,selected
  205. }
  206. })
  207. .then(res => {
  208. // alert(res.data)
  209. var data1 = res.data.code
  210. alert("修改成功")
  211. })
  212. .catch(err => {
  213. alert(err.response["data"] + err.response["status"])
  214. })
  215. },
  216. //退出登录
  217. logout() {
  218. console.log("qweq")
  219. axios.delete('/login/', {
  220. params: {
  221. user_1: this.user_1,
  222. pswd: this.pswd,
  223. }
  224. })
  225. .then(res => {
  226. })
  227. .catch(err => {
  228. })
  229. },
  230. },
  231. created() {
  232. this.seek(2)
  233. // this.select_cust()
  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. alert(err.response["data"] + err.response["status"])
  272. })
  273. };
  274. //查询货品资料调用
  275. $("#testInput").bind("input propertychange", function (event) {
  276. var search = $("#testInput").val()
  277. // console.log($("#testInput").val())
  278. timer && clearTimeout(timer);
  279. timer = setTimeout(function () {
  280. getStr(search, '/dept/', 'testInput');
  281. }, 2000);
  282. });
  283. getStr('', '/dept/', 'testInput', 1);
  284. });
  285. </script>
  286. <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
  287. </body>
  288. </html>