123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510 |
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="widtd=device-widtd, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" href="/static/css/css.css">
- <link rel="stylesheet" type="text/css" href="/static/css/iefilemaintain.css">
- <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-select.min.css">
- <script src="/static/js/jquery.min.js"></script>
- <script src="/static/js/bootstrap.min.js"></script>
- <script src="/static/js/vue-2.4.0.js"></script>
- <script src="/static/js/axios.min.js"></script>
- <script src="/static/js/vue-Cookies.js"></script>
- <script type="text/javascript" src="/static/js/jquery.select.js"></script>
- <script src="/static/js/bootstrap-select_new.js"></script>
- <!-- 图标js -->
- <!-- <script src="/static/js/ionicons.js"></script> -->
- <title>Document</title>
- </head>
- <body>
- <div id="app">
- <div class="navbar navbar-default">
- <div class="container">
- <!-- navbar-header用于设置内容横向显示 -->
- <div class="navbar-header">
- <a href="/index" class="navbar-brand"></a>
- </div>
- <!-- navbar-nav用来设置横向显示 -->
- <!-- navbar-right用来设置右浮动 -->
- <!-- hidden-xs用于当屏幕很小的情况下隐藏div里面的内容 -->
- <div class="hidden-xs">
- <ul class="nav navbar-nav">
- <li class="dropdown">
- <!--订单一览表-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- 订单一览表
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/index">订单一览表</a></li>
- </ul>
- </li>
- <li class="dropdown">
- <!--月度产能评估表-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- 月度产能评估表
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/depps">月度产能评估表</a></li>
- <li><a href="/dessettingtm">车间标准产能设置</a></li>
- </ul>
- </li>
- <li class="dropdown">
- <!--月度主排程计划-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- 月度主排程计划
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/pcydscjhtm">PC月度生产计划(N+7)</a></li>
- <li><a href="/ydzpcjhtm">月度主排程计划</a></li>
- <li><a href="/ympxqjhtm">研磨品需求计划</a></li>
- <li><a href="/btmbxqtm">表头模板需求</a></li>
- </ul>
- </li>
- <li class="dropdown">
- <!--ie文件号管理-->
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- IE工艺文件号管理
- <b class="caret"></b>
- </a>
- <ul class="nav dropdown-menu">
- <li><a href="/iefiletm">新增IE工艺文件号</a></li>
- <li><a href="/iefilemaintaintm">IE工艺文件号维护</a></li>
- <li><a href="/iefilemaintaindetailtm">IE效率明细表</a></li>
- <li><a href="/iefilemaintaininfotm">IE效率统计表</a></li>
- </ul>
- </li>
- </ul>
- <ul class="nav navbar-nav navbar-right">
- <li v-if="username !=''">
- <a>{% verbatim %}{{ '欢迎'+username+'!!!' }} {% endverbatim %}</a>
- </li>
- <li v-else><a href="">请登录</a></li>
- <li><a href="/login/" @click="logout()">退出登录</a></li>
- </ul>
- </div>
- </div>
- </div>
- <!--表头-->
- <div class="filter">
- <div class="container ">
- <label>
- <div class="navbar-nav">IE录入日期:</div>
- <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timeqi' /></div>
- </label>
- <label>
- <div class="navbar-nav">至:</div>
- <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timezhi' />
- </div>
- </label>
- <label>
- <div class="navbar-nav">车间:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="erp_dep" type="text" autocomplete="off" />
- </div>
- </label>
- <label>
- <div class="navbar-nav">缴库单号:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="mf_mmo" type="text" autocomplete="off" />
- </div>
- </label>
- <label>
- <div class="navbar-nav">IE工艺文件号:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="iefileno" type="text" autocomplete="off" />
- </div>
- </label>
- <label class="save def" @click="seek()">
- <div class="btn btn-primary navbar-nav">查询</div>
- </label>
- <label class="save def" @click="toiefile()">
- <div class="btn btn-primary navbar-nav">新增</div>
- </label>
- <label class="save def" @click="delete_data()">
- <div class="btn btn-primary navbar-nav">删除</div>
- </label>
- <label class="save def">
- <div class="btn btn-primary navbar-nav" @click="save()">保存</div>
- </label>
- <label>
- <div class="navbar-nav">更新日期范围:</div>
- <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timeqi_mo' /></div>
- </label>
- <label>
- <div class="navbar-nav">至:</div>
- <div class="navbar-nav"><input type='date' class="input form-control" v-model='data_timezhi_mo' />
- </div>
- </label>
- <label>
- <div class="navbar-nav">指定缴库单号更新:</div>
- <div class="navbar-nav">
- <input class="input form-control" id="zdmf_mmo" type="text" autocomplete="off" />
- </div>
- </label>
- <label class="save def">
- <div class="btn btn-primary navbar-nav" @click="zdmf_mmoodd()">更新缴库IE工艺文件号</div>
- </label>
- </div>
- </div>
- <div class="container">
- <div style="background-color:#EFEDED; color: red;">
- 注收到IE文件后录入更新文件。平衡率大于100%标注为蓝色;小于等于0%标注为绿色;等于100%标注为红色;大于0%小于90%标注为浅黄色</div>
- <table class="table table-hover">
- <tbody>
- <tr v-for="(item,i) in seek_data" :key="i"
- v-bind:class="{ 'tr_blue': item.scxphl > 1 ? true:false, 'tr_green': item.scxphl <=0 ? true:false, 'tr_red': item.scxphl == 1 ? true:false, 'tr_yellow': item.scxphl < 0.9 && item.scxphl >0 ? true:false }">
- <td v-if="i>0"><input type="checkbox" v-text="item.choice" @click="selected(i,item)" /></td>
- <td v-else><input type="checkbox" @click="selected(i,item,'all')" /><span>全选否</span></td>
- <td v-if="i >0" v-text="i"></td>
- <td v-else v-text="'行号'"></td>
- <td v-text="item.bom_no"></td>
- <td v-if="i>0">
- <select class="input form-control" v-model="item.qiting">
- <option value="T">T</option>
- <option value="F">F</option>
- </select>
- </td>
- <td v-else v-text="item.qiting"></td>
- <td v-if="i >0 ">
- <textarea rows="2" cols="10" v-model="item.qitingexplain"></textarea>
- </td>
- <td v-else v-text="item.qitingexplain"></td>
- <td v-text="item.ae_date"></td>
- <td v-text="item.hr_up"></td>
- <td v-text="item.file_serial"></td>
- <td v-text="item.workshop_name"></td>
- <td v-text="item.dep_name"></td>
- <td v-text="item.total_manpower"></td>
- <td v-text="item.point"></td>
- <td v-text="item.job_time"></td>
- <td v-text="item.postil_up"></td>
- <td v-text="item.rem"></td>
- <td v-text="item.iefile_no"></td>
- <td v-text="item.sys_date"></td>
- <td v-text="item.user_no"></td>
- <td v-text="item.bzsj"></td>
- <td v-text="item.scxphl"></td>
- <td v-text="item.scxbphl"></td>
- <td v-text="item.scjp"></td>
- <td v-text="item.xscn"></td>
- <td v-text="item.rjcn"></td>
- <td v-text="item.bxscn"></td>
- <td v-text="item.djcb"></td>
- <td v-text="item.bzzys"></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <script>
- var vm = new Vue({
- el: '#app',
- data: {
- data_timeqi: '', //查询时间起
- data_timezhi: '', //查询时间止
- data_timeqi_mo:'', //更新缴库单号开始日期
- data_timezhi_mo:'', //更新缴库单号结束日期
- username: '', //登录用户名
- seek_data: [], //查询到的数据
- selected_data: [], //选中的数据
- all_data: 0, //用于处理全选
- isActiveblue: 0,
- isActivegreen: 0,
- isActivered: 0,
- isActiveyellow: 0
- },
- mounted() {
- // 获取登录名
- // this.username=getCookie('username');
- this.username = $cookies.get('username')
- console.log($cookies.get('username'))
- },
- methods: {
- // 查询
- seek() {
- var erp_dep = $('#erp_dep').val().split("->")[0];
- var mf_mmo = $('#mf_mmo').val().split("->")[0];
- var iefileno = $('#iefileno').val().split("->")[0];
- axios.get('/iefilemaintain/', {
- params: {
- erp_dep: erp_dep,
- mf_mmo: mf_mmo,
- iefileno: iefileno,
- data_timeqi: this.data_timeqi,
- data_timezhi: this.data_timezhi
- }
- }).then(res => {
- var data = res.data.data
- this.seek_data = data
- }).catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- // 选择按钮选择数据
- selected(i, item, enall) {
- // 第一个参数表示项次,第二个参数表示选中的对象,第三个用于判断是否点击全选
- // 这里是处理全选数据
- if (enall == "all") {
- if (this.all_data == 0) {
- this.all_data = 1
- }
- else {
- this.all_data = 0
- }
- //这里是处理了点击全选
- if (this.all_data == 1) {
- for (i = 0; i < this.seek_data.length; i++) {
- this.seek_data[i]["choice"]='T'
- }
- this.selected_data = []
- // this.selected_data = this.seek_data
- this.selected_data = this.seek_data.slice(0)
- $("input:checkbox").prop("checked", "checked");
- }
- // 处理点击不全选
- else {
- this.selected_data = []
- for (i = 0; i < this.seek_data.length; i++) {
- this.seek_data[i]["choice"]=''
- }
- $("input:checkbox").removeAttr("checked");
- }
- console.log(this.selected_data)
- console.log(this.all_data)
- return
- }
- // 这里是处理单向选中数据
- console.log(this.seek_data)
- if (this.seek_data[i]["choice"] =='') {
- console.log(this.seek_data[i])
- console.log(1111111111111)
- console.log(this.seek_data[i]["choice"])
- this.selected_data.push(this.seek_data[i])
- console.log(33333333333)
- this.seek_data[i]["choice"] = 'T'
- }
- else {
- console.log(item)
- console.log(i)
- console.log(2222222222,this.selected_data)
- var index = this.selected_data.findIndex(itemindex => {
- if (itemindex == item) {
- return true;
- }
- })
-
- console.log(index)
- this.seek_data[i]["index"] = ''
- this.selected_data.splice(index, 1)
- console.log(5555555555)
- }
- console.log(this.selected_data)
- console.log(this.seek_data)
- },
- // 跳转到ie工艺文件新增界面
- toiefile() {
- window.location.href = "/iefiletm";
- },
- // 设置启用状态
- save() {
- if (this.selected_data.length <= 0) {
- alert("请选择数据")
- return
- }
- console.log("点击了保存")
- axios.post('/iefilemaintain/', {
- data: {
- selected_data: this.selected_data
- }
- }).then(res => {
- console.log("设置状态成功")
- }).catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- // 删除选中
- delete_data() {
- if (this.selected_data.length <= 0) {
- alert("请选择数据")
- return
- }
- axios.delete('/iefilemaintain/', {
- data: {
- selected_data: this.selected_data
- }
- }).then(res => {
- console.log("删除")
- }).catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- // 更新指定缴库单单号ie文件
- zdmf_mmoodd() {
- if (this.selected_data.length <= 0) {
- alert("请选择数据")
- return
- }
- var mm_no = $('#zdmf_mmo').val()
- if(mm_no.indexOf("->") != -1){
- mm_no = mm_no.split("->")[0]
- }
- axios.put('/iefilemaintain/', {
- data: {
- mm_no: mm_no,
- selected_data: this.selected_data,
- data_timeqi_mo:this.data_timeqi_mo,
- data_timezhi_mo:this.data_timezhi_mo
- }
- }).then(res => {
- // console.log("更新成功")
- alert("更新缴库单号成功")
- }).catch(err => {
- alert(err.response["data"] + err.response["status"])
- })
- },
- //获取当前日期
- addDate() {
- var date = new Date();
- var seperator1 = "-";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = year + seperator1 + month + seperator1 + strDate;
- // console.log(currentdate)
- this.data_timeqi = this.data_timezhi = currentdate
- },
- //退出登录
- logout() {
- console.log("qweq")
- axios.delete('/login/', {
- params: {
- user_1: this.user_1,
- pswd: this.pswd,
- }
- })
- .then(res => {
- })
- .catch(err => {
- })
- },
- },
- created() {
- this.addDate()
- }
- });
- $(function () {
- // 开始写 jQuery 代码...
- var timer = null;
- // 定义一个公用的搜索接口
- // console.log(vm.$data.list)
- function getStr(n, url, field, clickif) {
- //n为搜索的参数 url为请求的路由,filed是定位表单的id,
- //clickif用于判断是否是第一次加载,如果不是第一次加载则需要模拟点击
- var search = n
- // 配置路由
- if (typeof search === 'undefined') {
- search = ''
- };
- // console.log(search)
- axios.get(url, {
- params: {
- search_no: search
- }
- })
- .then(res => {
- // alert(res.data)
- var data1 = res.data.data
- datas = data1
- // console.log(datas)
- if (datas.length == 0) {
- alert("没有搜索到数据")
- return
- }
- $.selectSuggest(field, datas);
- // 是否第一次进入
- if (clickif !== 1) {
- $("#" + field).trigger("click");
- }
- })
- .catch(err => {
- Console.log(err.response)
- alert(err.response["data"] + err.response["status"])
- })
- };
- //查询部门资料调用
- $("#erp_dep").bind("input propertychange", function (event) {
- var search = $("#erp_dep").val()
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/dept/', 'erp_dep');
- }, 1000);
- });
- getStr('', '/dept/', 'erp_dep', 1);
- // 查询缴库单号
- $("#mf_mmo").bind("input propertychange", function (event) {
- var search = $("#mf_mmo").val()
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/mfmmooddno/', 'mf_mmo');
- }, 1000);
- });
- getStr('', '/mfmmooddno/', 'mf_mmo', 1);
- // 查询指定缴库单号
- $("#zdmf_mmo").bind("input propertychange", function (event) {
- var search = $("#zdmf_mmo").val()
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/mfmmooddno/', 'zdmf_mmo');
- }, 1000);
- });
- getStr('', '/mfmmooddno/', 'zdmf_mmo', 1);
- // 查询ie文件号
- $("#iefileno").bind("input propertychange", function (event) {
- var search = $("#iefileno").val()
- // console.log($("#testInput").val())
- timer && clearTimeout(timer);
- timer = setTimeout(function () {
- getStr(search, '/iefileno/', 'iefileno');
- }, 1000);
- });
- getStr('', '/iefileno/', 'iefileno', 1);
- });
- </script>
- <!-- <script type="text/javascript" src="/static/js/export/jquery-1.8.2.js"></script> -->
- </body>
- </html>
|