123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014 |
- <!DOCTYPE html>
- <html lang="zh-cn">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
- <meta name="format-detection" content="telephone=no" />
- <meta name="format-detection" content="email=no" />
- <title>mes</title>
- <link rel="stylesheet" href="../css/reset.css">
- <link rel="stylesheet" href="../css/style.css">
- <style>
- body {
- background-color: #f7f7f7;
- }
- .taskXQ {
- display: none;
- }
- .taskXQ div {
- margin-bottom: .3rem;
- background-color: #fff;
- padding: 1rem;
- }
- .taskXQ div h3 {
- font-size: 1.3rem;
- color: #212121;
- font-weight: normal;
- }
- .taskXQ pre {
- display: block;
- width: 100%;
- }
- .task_taskCon p {
- margin-bottom: .9rem;
- color: #212121;
- font-size: 1.3rem;
- }
- .task_taskCon p:nth-of-type(3),
- .task_taskCon p:nth-of-type(2) {
- margin-bottom: .3rem;
- }
- .task_name {
- font-size: 1.3rem;
- }
- .task_dbqk {
- font-size: 1.2rem;
- border-radius: .3rem;
- padding: 0 .4rem;
- margin-left: .8rem;
- }
- .task_dbqk1 {
- color: #f26522;
- border: 1px solid #f26522;
- }
- .task_dbqk2 {
- color: #6db495;
- border: 1px solid #6db495;
- }
- .task_dbqk3 {
- color: #bbbc5f;
- border: 1px solid #bbbc5f;
- }
- .task_dbqk4 {
- color: #bf8077;
- border: 1px solid #bf8077;
- }
- .task_dbqk5 {
- color: #cacbbb;
- border: 1px solid #cacbbb;
- }
- .task_dw,
- .task_people,
- .task_duty {
- color: #818181;
- }
- .task_pssj,
- .task_wcsj {
- display: inline-block;
- height: 1.5rem;
- line-height: 1.5rem;
- font-size: 1.3rem;
- color: #fff;
- padding: 0 .3rem;
- border-radius: .3rem;
- }
- .task_pssj {
- background-color: #bd8cbf;
- margin-bottom: .5rem;
- }
- .task_wcsj {
- background-color: #65ba8e;
- }
- .gz {
- display: inline-block;
- width: 2rem;
- height: 2rem;
- background-image: url("../image/gz.png");
- background-size: 100%;
- margin-left: 1.5rem;
- margin-bottom: -.3rem;
- }
- .gz-active {
- display: inline-block;
- width: 2rem;
- height: 2rem;
- background-image: url("../image/gz-active.png");
- background-size: 100%;
- margin-left: 1.5rem;
- margin-bottom: -.3rem;
- }
- .task_text {
- font-size: 1.3rem;
- color: #818181;
- }
- .gzjl>li {
- padding: .4rem 0 .2rem;
- /*border-bottom: 1px dotted #c0c0c0;*/
- position: relative;
- }
- .gzjl>li:last-of-type {
- border-bottom: none;
- }
- .gzjl>li p {
- color: #818181;
- font-size: 1rem;
- line-height: 1.9rem;
- }
- .gzjl>li p:last-of-type {
- color: #414141;
- font-size: 1.2rem;
- }
- .c_imgList {
- margin-bottom: .3rem;
- }
- .c_imgList li {
- float: left;
- margin-bottom: .3rem;
- }
- .c_fileList li p {
- font-size: 1.4rem;
- background-color: #f8f8f8;
- border-radius: .3rem;
- padding: .6rem;
- margin-bottom: .2rem;
- }
- .zzPopups {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- background-color: rgba(0, 0, 0, 0.8);
- z-index: 99;
- display: none;
- }
- .zzPopups div {
- height: 80%;
- position: absolute;
- top: 50%;
- left: 10%;
- right: 10%;
- -webkit-transform: translateY(-50%);
- }
- .zzPopups div img {
- background-color: #fff;
- width: 100%;
- height: auto;
- }
- .delBtn {
- display: inline-block;
- width: 3rem;
- height: 1.6rem;
- line-height: 1.6rem;
- text-align: center;
- font-size: 1.1rem;
- background-color: #f26522;
- color: #fff;
- border-radius: .3rem;
- margin-left: .4rem;
- /*position: absolute;*/
- /*right: 0;*/
- /*top: 0.2rem;*/
- }
- .onAudit:after {
- content: "(暂未审核)";
- display: inline-block;
- color: #ff2211;
- font-size: 1.1rem;
- margin-left: 1rem;
- }
- .offAudit:after {
- content: "(已审核)";
- display: inline-block;
- color: #00db00;
- font-size: 1.1rem;
- margin-left: 1rem;
- }
- #tomore {
- font-size: 1.1rem;
- }
- .taskFn{
- position: fixed;
- top: .5rem;
- right: .5rem;
- background-color: #fff;
- border: 1px solid #e0e0e0;
- border-radius: .2rem;
- }
- .taskFn:after{
- display: block;
- content: "";
- height: 0;
- border-style: solid;
- border-color: transparent transparent #e0e0e0 transparent;
- border-width: .6rem;
- position: absolute;
- right: 2rem;
- top: -1.2rem;
- }
- .taskFn:before{
- display: block;
- content: "";
- height: 0;
- border-style: solid;
- border-color: transparent transparent #fff transparent;
- border-width: .6rem;
- position: absolute;
- right: 2rem;
- top: -1.1rem;
- z-index: 1;
- }
- .taskFn li{
- padding: 1rem .6rem;
- border-bottom: 1px solid #e0e0e0;
- }
- .taskFn li:last-of-type{
- border-bottom: none;
- }
- .hid {
- display: none;
- }
- </style>
- </head>
- <body>
- <div class="taskXQ">
- <div class="task_taskCon flex-con">
- <p>
- <span class="task_name">{{name}}</span>
- <i class="{{gz}}" id="attention"></i>
- </p>
- <p>分管县领导:
- <span class="task_duty">{{duty}}</span>
- <span class="task_dbqk right {{class}}">办结情况:{{status}}</span>
- </p>
- <p class="hid">执行单位:
- <span class="task_dw">{{enterprise}}</span>
- </p>
- <p>执行单位:
- <span class="task_people">{{people}}</span>
- </p>
- <p>行业分类:
- <span class="task_hyfl">{{hyfl}}</span>
- </p>
- </div>
- <div>
- <p>
- <span class="task_pssj">批示时间:{{pssj}}</span>
- <br>
- <span class="task_wcsj">完成时限:{{wcsj}}</span>
- </p>
- </div>
- <div>
- <h3>工作内容:</h3>
- <div class="task_text">{{task_content}}</div>
- </div>
- <div>
- <h3>工作要求:</h3>
- <div class="task_text">{{list_content}}</div>
- </div>
- <div>
- <h3>备注:</h3>
- <div class="task_text">{{beizhu}}</div>
- </div>
- <div>
- <h3>最新进展:
- <span id="tomore" class="right">[查看更多]</span>
- </h3>
- <ul class="gzjl">
- {{task_jilu}}
- </ul>
- </div>
- <div>
- <h3>任务批示:
- <span id="toInstructionsList" class="right">[查看更多]</span>
- </h3>
- <ul class="gzjl">
- {{task_pishi}}
- </ul>
- </div>
- </div>
- <div class="taskFn hid">
- <ul>
- <li>任务反馈</li>
- <li>任务批示</li>
- </ul>
- </div>
- <!-- <div class="zzPopups">
- <div></div>
- </div> -->
- <script src="../script/publicData.js"></script>
- <script src="../script/jquery-3.1.0.min.js"></script>
- <script type="text/javascript" src="../script/api.js"></script>
- <script>
- var ii = 0;
- function showImg(that) {
- // if (ii != 0) {
- // api.toast({
- // msg: '正在加载图片,请稍等...',
- // duration: 2000,
- // location: 'bottom'
- // });
- // return;
- // }
- api.imageCache({
- url: that.getAttribute("src")
- }, function (ret, err) {
- if (ret.status) {
- var url = ret.url;
- // $(".zzPopups div").append("<img src='"+url+"'>");
- var imageBrowser = api.require('imageBrowser');
- imageBrowser.openImages({
- imageUrls: [url]
- });
- //$(".zzPopups").css("display", "block");
- ii++;
- } else {
- api.toast({
- msg: '加载图片失败',
- duration: 2000,
- location: 'bottom'
- });
- ii = 0;
- }
- });
- }
- apiready = function () {
- api.showProgress({
- title: '努力加载中...',
- text: '请稍等...',
- modal: false
- });
- var dialogBox = api.require('dialogBox');
- var ulModel = $(".taskXQ").html(), str = "";
- var task = $api.getStorage("taskXQ");
- var winWidth = api.winWidth / 3 - 10;
- var ad = ["1", "3", "4"];
- var postData = {
- task_id: task.taskID
- }
- $(".zzPopups").click(function () {
- // $(".zzPopups").css("display", "none");
- // $(".zzPopups div").html(" ");
- // ii = 0;
- })
- $.get(pageUrl + "renwudetail", postData, function (data) {
- console.log(JSON.stringify(data))
- var data = data.data, user = "", dep = "", dataImg = [], dataFile = [];
- switch (data['0']['task_status']) {
- case "0":
- str = ulModel.replace("{{status}}", "未开始").replace("{{class}}", "task_dbqk1");
- break;
- case "1":
- str = ulModel.replace("{{status}}", "进行中").replace("{{class}}", "task_dbqk2");
- break;
- case "5":
- str = ulModel.replace("{{status}}", "临期").replace("{{class}}", "task_dbqk3");
- break;
- case "7":
- str = ulModel.replace("{{status}}", "已逾期").replace("{{class}}", "task_dbqk4");
- break;
- case "3":
- str = ulModel.replace("{{status}}", "已完结").replace("{{class}}", "task_dbqk5");
- break;
- }
- str = str.replace("{{name}}", data[0]['task_title']).replace("{{duty}}", data[0]['fuzeren_name']).replace("{{hyfl}}", data[0]['tradeclass_name']).replace("{{pssj}}", getTime(data[0]['task_start_time'])).replace("{{wcsj}}", getTime(data['0']['task_end_time']))
- .replace("{{beizhu}}", data[0]['task_beizhu'] || "无").replace("{{people}}", data[0]['user_name'] || "无").replace("{{enterprise}}", data[0]['department_name'] || "无")
- .replace("{{task_content}}", data[0]['task_list_content'] ? toHtml(data[0]['task_list_content']) : "无").replace("{{list_content}}", data[0]['task_content'] ? toHtml(data[0]['task_content']) : "无").replace("{{gz}}", data[0]['task_look_status'] == "0" ? "gz" : "gz-active")
- var gzjlModel = "<li rel='{{mesid}}'><p><span class='depName'>{{task_beizhu_time}}</span></p><p class='fkName'>{{task_beizhu_dep}}<span class='{{task_beizhu_audit}}'></span></p> <p style='margin-bottom: .3rem;' class='task_content'>{{task_beizhu_content}}</p><ul class='c_imgList clearFix'>{{imglList}}</ul><ul class='c_fileList'>{{fileList}}</ul></li>", str2 = "", imgStr = "", fileStr = "", str3="",fkData=[],pishiData=[];
- if (data['task_dynamic_content']) {
- for(var dataNum in data['task_dynamic_content']){
- fkData.push(data['task_dynamic_content'][dataNum])
- }
- for(var pishiNum in data['task_dynamic_content_pishi']){
- pishiData.push(data['task_dynamic_content_pishi'][pishiNum])
- }
- if(fkData.length!=0&&fkData[0]['imgs']&&fkData[0]['imgs'].length!=0){
- for (var num in fkData[0]['imgs']) {
- if (fkData[0]['imgs'][num]['task_dynamic_upload_status'] == "2") {
- dataFile.push(fkData[0]['imgs'][num])
- } else {
- dataImg.push(fkData[0]['imgs'][num])
- }
- }
- }
- }
- if (fkData && fkData.length != 0) {
- str2 += gzjlModel.replace("{{mesid}}", fkData[0]["task_dynamic_id"]).replace("{{task_beizhu_audit}}", ad.indexOf($api.getStorage("user").user_group_id) == 8 ? (fkData[0]["task_dynamic_content_status"] == "1" ? "offAudit" : "onAudit") : "").replace("{{task_beizhu_time}}", ["22"].indexOf($api.getStorage("user").user_group_id) == -1 ? getTime(fkData[0]["task_dynamic_createtime"], true) : getTime(fkData[0]["task_dynamic_createtime"], true) + "<span class='delBtn'>删除</span>").replace("{{task_beizhu_dep}}",fkData[0]["user_name"])
- .replace("{{task_beizhu_content}}", fkData[0]["task_dynamic_content"] ? toHtml(fkData[0]["task_dynamic_content"]) : "")
- if (dataImg && dataImg.length) {
- for (var imgIndex in dataImg) {
- imgStr += "<li style='width:32%;height:" + winWidth + "px;margin-right: 1%'><img src='" + pageImg + "/" + dataImg[imgIndex]['task_dynamic_upload_photo'] + "' alt='' onclick='showImg(this)'></li>";
- }
- str2 = str2.replace("{{imglList}}", imgStr || "");
- } else {
- str2 = str2.replace("{{imglList}}", "");
- }
- imgStr = "";
- if (dataFile && dataFile.length) {
- for (var fileIndex in dataFile) {
- fileStr += "<li class='recodeLi'><p><a href='" + pageImg + "/" + dataFile[fileIndex]['task_dynamic_upload_photo'] + "' download='download'>" + dataFile[fileIndex]['task_dynamic_upload_photo'].replace("upload/" + dataFile[fileIndex]['task_dynamic_task_id'], "").slice(10) + "</a></p></li>";
- }
- str2 = str2.replace("{{fileList}}", fileStr || "");
- } else {
- str2 = str2.replace("{{fileList}}", "");
- }
- fileStr = "";
- dataFile = [];
- dataImg = [];
- } else {
- str2 += "暂无";
- }
- if (pishiData && pishiData.length != 0) {
- for (var j in pishiData) {
- if (pishiData[j]['imgs']&&pishiData[j]['imgs'].length) {
- for (var num in pishiData[j]['imgs']) {
- if (pishiData[j]['imgs'][num]['task_dynamic_upload_status'] == "2") {
- dataFile.push(pishiData[j]['imgs'][num])
- } else {
- dataImg.push(pishiData[j]['imgs'][num])
- }
- }
- }
- str3 += gzjlModel.replace("{{mesid}}", pishiData[j]["task_dynamic_id"]).replace("{{active}}", j == 0 ? "active" : "").replace("{{task_beizhu_audit}}", "").replace("{{task_beizhu_time}}", ad.indexOf($api.getStorage("user").user_group_id) == -1 ? getTime(pishiData[j]["task_dynamic_createtime"], true) : getTime(pishiData[j]["task_dynamic_createtime"], true)).replace("{{task_beizhu_dep}}", pishiData[j]["user_name"])
- .replace("{{task_beizhu_content}}",pishiData[j]["task_dynamic_content"] ? toHtml(pishiData[j]["task_dynamic_content"]) : "")
- if (dataImg && dataImg.length) {
- for (var imgIndex in dataImg) {
- imgStr += "<li style='width:32%;height:" + winWidth + "px;margin-right: 1%'><img src='" + pageImg + "/" + dataImg[imgIndex]['task_dynamic_upload_photo'] + "' alt='' onclick='showImg(this)'></li>";
- }
- str3 = str3.replace("{{imglList}}", imgStr || "");
- } else {
- str3 = str3.replace("{{imglList}}", "");
- }
- imgStr = "";
- if (dataFile && dataFile.length) {
- for (var fileIndex in dataFile) {
- fileStr += "<li class='recodeLi'><p><a href='" + pageImg + "/" + dataFile[fileIndex]['task_dynamic_upload_photo'] + "' download='download'>" + dataFile[fileIndex]['task_dynamic_upload_photo'].replace("upload/" + dataFile[fileIndex]['task_dynamic_task_id'], "").slice(10) + "</a></p></li>";
- }
- str3 = str3.replace("{{fileList}}", fileStr || "");
- } else {
- str3 = str3.replace("{{fileList}}", "");
- }
- fileStr = "";
- dataFile = [];
- dataImg = [];
- }
- } else {
- str3 += "暂无";
- }
- str = str.replace("{{task_jilu}}", str2).replace("{{task_pishi}}",str3);
- api.hideProgress();
- $(".taskXQ").html(str).css("display", "block");
- if ($api.getStorage("user").user_group_id != "5") {
- $("#attention").css("display", "none");
- }
- if (data['task_dynamic_content'].length == 0) {
- $("#tomore").css("display", "none");
- }
- // if (pishiData.length == 0) {
- $("#toInstructionsList").css("display", "none");
- // }
- $("#tomore").click(function () {
- api.openWin({
- name: 'morejl',
- url: './recordXQ.html'
- });
- })
- $("#toInstructionsList").click(function () {
- api.openWin({
- name: 'instructionsList',
- url: './instructionsList.html'
- });
- })
- $("#attention").click(function () {
- if ($(this).hasClass("gz")) {
- $.post(pageUrl + "lookstatus", { task_id: task.taskID - 0, task_look_status: "1" }, function (data) {
- // alert(JSON.stringify(data))
- })
- $(this).addClass("gz-active").removeClass("gz")
- api.toast({
- msg: "已关注此任务",
- duration: 2000,
- location: 'bottom'
- });
- } else {
- $.post(pageUrl + "lookstatus", { task_id: task.taskID - 0, task_look_status: "0" }, function (data) {
- // alert(JSON.stringify(data))
- })
- $(this).addClass("gz").removeClass("gz-active")
- api.toast({
- msg: "已取消关注",
- duration: 2000,
- location: 'bottom'
- });
- }
- })
- // if(ad.indexOf($api.getStorage("user").user_group_id)!=-1){
- // $(".gzjl li .fkName").click(function () {
- // $api.setStorage("fkid",$(this).parent().attr("rel"));
- // var toFK="toFrame(6)";
- // api.execScript({
- // script: toFK
- // });
- // })
- // }
- $(".task_dbqk").on("click", function () {
- if (ad.indexOf($api.getStorage("user").user_group_id) != -1) {
- api.actionSheet({
- title: '修改任务状态',
- cancelTitle: '取消',
- buttons: ['未开始', '进行中', '临期', '逾期', '已完结']
- }, function (ret, err) {
- var index = ret.buttonIndex;
- switch (index) {
- case 1:
- postData(0, '将任务修改为未开始吗?');
- break;
- case 2:
- postData(1, '将任务修改为进行中吗?');
- break;
- case 3:
- postData(5, '将任务修改为临期吗?');
- break;
- case 4:
- postData(7, '将任务修改为逾期吗?');
- break;
- case 5:
- postData(3, '将任务修改为已完结吗?');
- break;
- }
- function postData(type, val) {
- dialogBox.alert({
- texts: {
- title: '确认提示',
- content: val,
- leftBtnTitle: '取消',
- rightBtnTitle: '确认'
- },
- styles: {
- bg: '#fff',
- w: 300,
- title: {
- marginT: 20,
- icon: 'widget://res/gou.png',
- iconSize: 40,
- titleSize: 13,
- titleColor: '#000'
- },
- content: {
- color: '#000',
- size: 16
- },
- left: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#f9f9f9',
- color: '#818181',
- size: 12
- },
- right: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#51c4d4',
- color: '#fff',
- size: 12
- }
- }
- }, function (ret) {
- if (ret.eventType == 'right') {
- var taskData = {
- task_id: task.taskID - 0,
- task_status: type
- }
- $.post(pageUrl + "taskstatus", taskData, function (data) {
- if (data.status == "200") {
- $(".task_dbqk")[0].className = "task_dbqk right";
- var li = $api.getStorage("selectli");
- switch (type) {
- case 0:
- $(".task_dbqk").addClass("task_dbqk1").text("办结情况:未开始");
- api.sendEvent({
- name: 'addLi',
- extra: { html: li, type: "0" }
- });
- break;
- case 1:
- $(".task_dbqk").addClass("task_dbqk2").text("办结情况:进行中");
- api.sendEvent({
- name: 'addLi',
- extra: { html: li, type: "1" }
- });
- break;
- case 5:
- $(".task_dbqk").addClass("task_dbqk3").text("办结情况:临期");
- api.sendEvent({
- name: 'addLi',
- extra: { html: li, type: "2" }
- });
- break;
- case 7:
- $(".task_dbqk").addClass("task_dbqk4").text("办结情况:逾期");
- api.sendEvent({
- name: 'addLi',
- extra: { html: li, type: "3" }
- });
- break;
- case 3:
- $(".task_dbqk").addClass("task_dbqk5").text("办结情况:已完结");
- api.sendEvent({
- name: 'addLi',
- extra: { html: li, type: "4" }
- });
- break;
- }
- api.sendEvent({
- name: 'removeLi',
- extra: { type: task.taskStatus }
- });
- }
- api.toast({
- msg: data.message,
- duration: 2000,
- location: 'bottom'
- });
- });
- dialogBox.close({
- dialogName: 'alert'
- });
- } else if (ret.eventType == 'left') {
- dialogBox.close({
- dialogName: 'alert'
- });
- }
- })
- }
- });
- }
- /* if($api.getStorage("user").user_group_id!=4) {
- api.toast({
- msg: '无此权限',
- duration: 2000,
- location: 'bottom'
- });
- return;
- }
- switch (data['0']['task_status']){
- case "0":
- popupsBox('确认开始任务吗?',1);
- break;
- case "1":
- popupsBox('确认完成任务吗?',4);
- break;
- case "2":
- popupsBox('确认完成任务吗?',4);
- break;
- case "3":
- popupsBox('确认完成任务吗?',4);
- break;
- }*/
- })
- // $(".c_fileList span").click(function (e) {
- // e.stopPropagation();
- // var url=this.getAttribute("rel");
- // var thisFile=url.slice(url.lastIndexOf("/")+1).split(".");
- // api.download({
- // url: this.getAttribute("rel"),
- // cache: true,
- // savePath:"fs://"+thisFile[0].replace(task.taskID,"").slice(10)+"."+thisFile[1]
- // }, function (ret, err){
- // if(ret.state==1){
- //// alert(ret.savePath)
- //// var fs = api.require('fs');
- //// fs.open({
- //// path: ret.savePath,
- //// flags: 'read'
- //// }, function(ret, err) {
- //// if (ret.status) {
- //// alert(JSON.stringify(ret));
- //// } else {
- //// alert(JSON.stringify(err));
- //// }
- //// });
- // api.readFile({
- // path: ret.savePath
- // }, function (ret, err) {
- // api.openWin({
- // name: 'test',
- // url: './test.html',
- // pageParam: {content: ret.data},
- // delay:300
- // });
- // });
- // }else if(ret.state==2){
- // api.toast({
- // msg: '下载失败',
- // duration: 2000,
- // location: 'bottom'
- // });
- // }
- // });
- // })
- $(".delBtn").on('click', function (e) {
- e.stopPropagation();
- var mesID = $(this).parent().parent().parent().attr('rel');
- var that = $(this).parent().parent().parent();
- dialogBox.alert({
- texts: {
- title: '确认提示',
- content: "删除该条记录吗?",
- leftBtnTitle: '取消',
- rightBtnTitle: '确认'
- },
- styles: {
- bg: '#fff',
- w: 300,
- title: {
- marginT: 20,
- icon: 'widget://res/gou.png',
- iconSize: 40,
- titleSize: 13,
- titleColor: '#000'
- },
- content: {
- color: '#000',
- size: 16
- },
- left: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#f9f9f9',
- color: '#818181',
- size: 12
- },
- right: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#51c4d4',
- color: '#fff',
- size: 12
- }
- }
- }, function (ret) {
- if (ret.eventType == 'right') {
- var recordData = {
- recordid: mesID
- }
- $.post(pageUrl + "contentdel", recordData, function (data) {
- if (data.status == "200") {
- that.remove();
- // var upload = 'toFrame(5);';
- // setTimeout(function () {
- // api.execScript({
- // name: 'root',
- // script: upload
- // });
- // },500)
- }
- api.toast({
- msg: data.message,
- duration: 2000,
- location: 'bottom'
- });
- });
- dialogBox.close({
- dialogName: 'alert'
- });
- } else if (ret.eventType == 'left') {
- dialogBox.close({
- dialogName: 'alert'
- });
- }
- })
- })
- })
- api.addEventListener({
- name: 'showTaskFn'
- }, function (ret, err) {
- if(ret.value.state=="show"){
- $(".taskFn").removeClass("hid")
- }else {
- $(".taskFn").addClass("hid")
- }
- });
- $(".taskFn li:first-of-type").click(function () {
- $(".taskFn").addClass("hid");
- $api.setStorage("taskFnStatus",null)
- var toFK = "toFrame(6)";
- api.execScript({
- name: "root",
- script: toFK
- });
- })
- $(".taskFn li:last-of-type").click(function () {
- $(".taskFn").addClass("hid");
- $api.setStorage("taskFnStatus",null)
- var toFK = "toFrame(9)";
- api.execScript({
- name: "root",
- script: toFK
- });
- })
- function getTime(time, bl) {
- var oldTime = new Date(time * 1000), str = "";
- var year = oldTime.getFullYear();
- var month = oldTime.getMonth() + 1;
- var day = oldTime.getDate();
- var hours = oldTime.getHours();
- var minutes = oldTime.getMinutes();
- if (bl) {
- str = year + "/" + checkTime(month) + "/" + checkTime(day) + " " + checkTime(hours) + ":" + checkTime(minutes);
- } else {
- str = year + "/" + checkTime(month) + "/" + checkTime(day);
- }
- return str;
- }
- function checkTime(val) {
- var val = val;
- if ((val + "").length == 1) {
- val = "0" + val;
- }
- return val
- }
- function popupsBox(val, type) {
- dialogBox.alert({
- texts: {
- title: '确认提示',
- content: val,
- leftBtnTitle: '取消',
- rightBtnTitle: '确认'
- },
- styles: {
- bg: '#fff',
- w: 300,
- title: {
- marginT: 20,
- icon: 'widget://res/gou.png',
- iconSize: 40,
- titleSize: 13,
- titleColor: '#000'
- },
- content: {
- color: '#000',
- size: 16
- },
- left: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#f9f9f9',
- color: '#818181',
- size: 12
- },
- right: {
- marginB: 0,
- marginL: 0,
- w: 150,
- h: 60,
- corner: 2,
- bg: '#51c4d4',
- color: '#fff',
- size: 12
- }
- }
- }, function (ret) {
- if (ret.eventType == 'right') {
- var taskData = {
- task_id: task.taskID - 0,
- task_status: type
- }
- $.post(pageUrl + "taskstatus", taskData, function (data) {
- api.toast({
- msg: data.message,
- duration: 2000,
- location: 'bottom'
- });
- if (data.status == "200") {
- if (type == "1") {
- $(".task_dbqk").addClass("task_dbqk2").text("办结情况:进行中");
- var li = $api.getStorage("selectli");
- var task = $api.getStorage("taskXQ");
- api.sendEvent({
- name: 'addLi',
- extra: { html: li, type: "1" }
- });
- api.sendEvent({
- name: 'removeLi',
- extra: { type: task.taskStatus }
- });
- } else if (type == "4") {
- $(".task_dbqk").addClass("task_dbqk5").text("办结情况:已完结");
- var li = $api.getStorage("selectli");
- var task = $api.getStorage("taskXQ");
- api.sendEvent({
- name: 'addLi',
- extra: { html: li, type: "4" }
- });
- api.sendEvent({
- name: 'removeLi',
- extra: { type: task.taskStatus }
- });
- }
- $(".task_dbqk").off("click");
- }
- })
- dialogBox.close({
- dialogName: 'alert'
- });
- } else if (ret.eventType == 'left') {
- dialogBox.close({
- dialogName: 'alert'
- });
- }
- });
- }
- function toHtml(str) {
- var a = "<", b = ">", c = " ", d = "&nbsp;", text = str;
- if (text.match(a)) {
- toChange(a, "<")
- }
- if (text.match(b)) {
- toChange(b, ">")
- }
- if (text.match(c)) {
- toChange(c, " ")
- }
- if (text.match(d)) {
- toChange(d, " ")
- }
- function toChange(type, type1) {
- text = text.replace(type, type1);
- if (text.match(type)) {
- toChange(type, type1)
- }
- }
- return text;
- }
- }
- </script>
- </body>
- </html>
|