dessetting.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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="/depps">计划主交期</a></li>
  62. <li><a href="#">计划部门交期</a></li>
  63. </ul>
  64. </li>
  65. <li class="dropdown">
  66. <!--ie文件号管理-->
  67. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  68. IE工艺文件号管理
  69. <b class="caret"></b>
  70. </a>
  71. <ul class="nav dropdown-menu">
  72. <li><a href="/iefiletm">新增IE工艺文件号</a></li>
  73. <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
  74. <li><a href="/iefilemaintaindetailtm">IE效率明细表</a></li>
  75. <li><a href="#">IE效率统计表</a></li>
  76. </ul>
  77. </li>
  78. </ul>
  79. <ul class="nav navbar-nav navbar-right">
  80. <li v-if="username !=''">
  81. <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
  82. </li>
  83. <li v-else><a href="">请登录</a></li>
  84. <li><a href="/logout/" @click="logout()">退出登录</a></li>
  85. </ul>
  86. </div>
  87. </div>
  88. </div>
  89. <!--搜索-->
  90. <div class="filter">
  91. <div class="container ">
  92. <label>
  93. <div class="navbar-nav">部门:</div>
  94. <div class="navbar-nav">
  95. <input class="input form-control" id="testInput" type="text"
  96. autocomplete="off" />
  97. </div>
  98. </label>
  99. <!-- <label class="save" @click="seek()">确定查询</label> -->
  100. <label class="save def" id="def" @click="seek(1)">
  101. <div class="btn btn-primary navbar-nav">确定查询</div>
  102. </label>
  103. </div>
  104. </div>
  105. <!-- 内容 -->
  106. <!-- container这个类是设置居中对齐 -->
  107. <div class="container">
  108. <!-- row这个类是用于设置取消内边距 -->
  109. <table class="table table-bordered table-hover table-striped">
  110. <tbody>
  111. <tr class="save" v-for="(item,i) in list" :key="item.dep"
  112. :class="i == activeIndex?'tr_active':''">
  113. <td v-if="i >0" width="50px" v-text="i"></td>
  114. <td v-else width="50px" v-text="'行号'"></td>
  115. <td width="50px" v-text="item.dep"></td>
  116. <td width="200px" v-text="item.dep_name"></td>
  117. <td width="100px" v-text="item.up"></td>
  118. <td width="200px" v-text="item.up_dd"></td>
  119. <td v-if="i >0" width="120px"><input type='number' min="0" class="input" v-model="item.s_capacity" /></td>
  120. <td v-else width="120px" v-text="item.s_capacity"></td>
  121. <td v-if="i >0" width="120px"><input type='number' min="0" class="input" v-model="item.s_d_staffing" /></td>
  122. <td v-else width="120px" v-text="item.s_d_staffing"></td>
  123. <!-- <td v-if="i >0" width="120px"><input type="checkbox" :checked="item.selected=='T'?'checked':''" /></td> -->
  124. <td v-if="i >0" width="120px"><input type="checkbox" v-model="item.selected"/></td>
  125. <td v-else width="120px" v-text="item.selected"></td>
  126. <td v-if="i >0" width="50px">
  127. <button class="btn btn-primary" @click="ok_save(item.dep,item.s_capacity,item.s_d_staffing,i,item.selected)">保存</button></td>
  128. <td v-else width="50px" v-text="item.operation"></td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. </div>
  133. <div class="footer refresh">
  134. <div class="load">
  135. <span></span>
  136. <span></span>
  137. <span></span>
  138. <span></span>
  139. <span></span>
  140. <span></span>
  141. <span></span>
  142. <span></span>
  143. </div>
  144. </div>
  145. </div>
  146. <script>
  147. var vm = new Vue({
  148. el: '#app',
  149. data: {
  150. activeIndex: 0,
  151. dep:'',
  152. list: [],
  153. username: ''
  154. },
  155. mounted() {
  156. // 获取登录名
  157. // this.username=getCookie('username');
  158. this.username = $cookies.get('username')
  159. console.log($cookies.get('username'))
  160. },
  161. methods: {
  162. seek(i) { // 添加的方法
  163. // console.log('ok')
  164. // 添加一个对象用于增加数据
  165. // 获取货品
  166. this.dep = $("#testInput").val()
  167. if (this.dep == undefined) {
  168. this.dep = ''
  169. }
  170. if (this.dep == null) {
  171. this.dep = ''
  172. }
  173. // 清空数据
  174. this.list = ''
  175. $(".refresh").show();
  176. axios.get('/dessetting', {
  177. params: {
  178. dep:this.dep
  179. },
  180. })
  181. .then(res => {
  182. this.list = res.data.data
  183. // console.log(this.list)
  184. $(".refresh").hide();
  185. })
  186. .catch(err => {
  187. alert(err.response["data"] + err.response["status"])
  188. })
  189. },
  190. ok_save(dep, s_capacity, s_d_staffing, i,selected) {
  191. // console.log('ok1')
  192. // console.log(OS_NO, PMC_DD, WH_REM, ITM)
  193. // this.activeIndex = i
  194. var dep = dep
  195. var s_capacity = s_capacity
  196. var s_d_staffing = s_d_staffing
  197. axios.put('/dessetting/', {
  198. data: {
  199. dep: dep,
  200. s_capacity: s_capacity,
  201. s_d_staffing: s_d_staffing,
  202. selected,selected
  203. }
  204. })
  205. .then(res => {
  206. // alert(res.data)
  207. var data1 = res.data.code
  208. alert("修改成功")
  209. })
  210. .catch(err => {
  211. alert(err.response["data"] + err.response["status"])
  212. })
  213. },
  214. //退出登录
  215. logout() {
  216. console.log("qweq")
  217. axios.delete('/login/', {
  218. params: {
  219. user_1: this.user_1,
  220. pswd: this.pswd,
  221. }
  222. })
  223. .then(res => {
  224. })
  225. .catch(err => {
  226. })
  227. },
  228. },
  229. created() {
  230. this.seek(2)
  231. // this.select_cust()
  232. }
  233. });
  234. $(function () {
  235. // 开始写 jQuery 代码...
  236. var timer = null;
  237. // 定义一个公用的搜索接口
  238. // console.log(vm.$data.list)
  239. function getStr(n, url, field, clickif) {
  240. //n为搜索的参数 url为请求的路由,filed是定位表单的id,
  241. //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
  242. var search = n
  243. // 配置路由
  244. if (typeof search === 'undefined') {
  245. search = ''
  246. };
  247. // console.log(search)
  248. axios.get(url, {
  249. params: {
  250. search_no: search
  251. }
  252. })
  253. .then(res => {
  254. // alert(res.data)
  255. var data1 = res.data.data
  256. datas = data1
  257. // console.log(datas)
  258. if (datas.length == 0) {
  259. alert("没有搜索到数据")
  260. return
  261. }
  262. $.selectSuggest(field, datas);
  263. // 是否第一次进入
  264. if (clickif !== 1) {
  265. $("#" + field).trigger("click");
  266. }
  267. })
  268. .catch(err => {
  269. alert(err.response["data"] + err.response["status"])
  270. })
  271. };
  272. //查询货品资料调用
  273. $("#testInput").bind("input propertychange", function (event) {
  274. var search = $("#testInput").val()
  275. // console.log($("#testInput").val())
  276. timer && clearTimeout(timer);
  277. timer = setTimeout(function () {
  278. getStr(search, '/dept/', 'testInput');
  279. }, 2000);
  280. });
  281. getStr('', '/dept/', 'testInput', 1);
  282. });
  283. </script>
  284. <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
  285. </body>
  286. </html>