| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- var exData = null;
- var edit_id = "";
- var _memo_msg = "";
- var cdrImgUrl = null;
- var viewUrl = null;
- function actionRenderer(e) {
- var record = e.record;
- var id = record.ID;
- var html = "";
- if (record.isAudit == 0) {
- html += getGridBtn("edit", "修改", "modifyFn('" + id + "')");
- if (record.OrderState == 8) {
- html += getGridBtn("yes", "审核", "verifyFn('" + id + "')");
- }
- }
- else {
- html += "<div style='color:green;'>已审核</div>";
- }
- if (record.OrderState >= 5) {
- html += getGridBtn("view", "预览文件", "viewCdrImg('" + id + "')");
- }
- return html;
- }
- function designRenderer(e) {
- var record = e.record;
- var html = "<div>" + record.tid;
- if (record.designNum > 0) {
- html += "<span style=\"width:40px;color:#C97805;border:1px solid #C97805;\">设计</span>";
- } else if (record.modifyNum > 0 && record.designNum == 0){
- html += "<span style=\"width:40px;color:#C97805;border:1px solid #C97805;\">改稿</span>";
- }
- html += "</div>";
- return html;
- }
- function viewCdrImg(id) {
- var rec = grid.getSelected();
- if (rec.OrderState < 5) {
- mini.alert("还没有上传文件,没有图片");
- return;
- }
- var finish = formatCommonDate(rec.FinishDesignTime);
- var yearmonth = finish.substring(0, 7);
- var monthUrl = yearmonth.replace("/", "");
- var url = cdrImgUrl + "/" + monthUrl + "/" + rec.seller_memo + ".png";
- mini.get("viewimg_win").show();
- $("#r_img").attr("src", url);
- }
- function largeImage(that) {
- var large_image = '<img src= ' + $(that).attr("src") + '></img>';
- $('.image_large').html($(large_image).css({
- display: "block",
- height: '60%',
- //width: '40%',
- position: "absolute",
- left: "50%",
- top: "50%",
- transform: "translate(-50%,-50%)",
- }, 500));
- $('.image_large').css("display", "block");
- }
- function hideImage(that) {
- $(that).css("display", "none");
- }
- /*function numRenderer(e) {
- var grid = e.sender;
- var record = e.record;
- var html = "";
- if (record.designNum > 0 && record.modifyNum == 0) {
- html += "<div>设计:" + record.designNum + "款</div>";
- }
- if (record.modifyNum > 0 && record.designNum == 0) {
- html += "<div>改稿:" + record.modifyNum + "款</div>";
- }
- return html;
- }*/
- function timeRenderer(e) {
- var grid = e.sender;
- var record = e.record;
- var html = "";
- html += "创建时间:<br/><div>" + formatCommonDate(record.create_time) +"</div>";
- if (record.update_time != "") {
- html += "修改时间:<br/><div>" + formatCommonDate(record.update_time) +"</div>";
- }
- return html;
- }
- function endTimeRenderer(e) {
- var grid = e.sender;
- var record = e.record;
- var html = "";
- html = "<div>" + formatCommonDate(record.end_time) + "</div>";
- return html;
- }
- function orderSellerRenderer(e) {
- var grid = e.sender;
- var record = e.record;
- var html = "<div style=\"display:flex;flex-direction:column;\">";
- html += ("<div style=\"color:#666;\">" + record.seller_nick + "</div>");
- html += getWWurlByNick(record.buyer_nick);
- return html;
- }
- function orderStatusRenderer(e) {
- var grid = e.sender;
- var record = e.record;
- var statestr = getOrderStatestrByState(record.OrderState);
- var taostatus = getInitStatusstrByState(record.status);
- var html = "<div style=\"display:flex;flex-direction:column;\">";
- html += ("<div onclick=\"clickToLog('" + record.tid + "')\" style=\"color:" + (record.OrderState == 0 ? "red" : "blue") + ";margin-bottom:10px;\">" + statestr + "</div>");
- html += ("<div>" + taostatus + "</div>");
- html += "</div>";
- return html;
- }
- function designBillRenderer(e) {
- var grid = e.sender;
- var rec = e.record;
- var html = "<div onclick=\"designBillLog('" + rec.tid + "')\" style=\"color: blue\">" + rec.realPrice + "</div>";
- return html;
- }
- function afterOrderRenderer(e) {
- var grid = e.sender;
- var rec = e.record;
- var html = "";
- if (rec.afterSaleResponsible == undefined) {
- } else {
- html += "<div style=\"display:flex;flex-direction:column;\">";
- html += "<div>" + rec.afterSaleResponsible + "</div>";
- console.log(rec.afterSaleResponsible.equal("设计师"));
- if (rec.afterSaleResponsible.equal("设计师")) {
- html += "<div>" + rec.refundFee + "</div>";
- }
- html += "</div>";
- }
- return html;
- }
- function sizeRenderer(e) {
- var grid = e.sender;
- var record = e.record;
- var html = "";
- if (record.designSize != "") {
- html += "<div>设计尺寸:" + record.designSize + "</div>";
- } else if (record.modifySize != "") {
- html += "<div>改稿尺寸:" + record.modifySize + "</div>";
- }
- return html;
- }
- //修改金额
- function modifyFn(id) {
- var rec = grid.getSelected();
- edit_id = id;
- mini.get("modify_win").show();
- $("#txtModifyRealPrice").val(rec.realPrice);
- }
- function saveModifyFn() {
- var parms = new Object();
- parms.ID = edit_id;
- parms.designerpirce = $("#txtModifyRealPrice").val();
- postAjax("upd_erp_designerbill", parms, function (data) {
- mini.get("modify_win").hide();
- resultShow(data, "grid.reload();");
- });
- }
- function cancelModifyFn() {
- mini.get("modify_win").hide();
- }
- function allAuditFn() {
- var list = new Array;
- var idList = "";
- list = grid.getSelecteds();
- if (list.length > 0) {
- for (var i = 0; i < list.length; i++) {
- if (list[i].OrderState != 8) {
- mini.alert("交易未完成无法审批");
- return;
- } else {
- idList += "," + list[i].ID;
- }
- }
- idList = idList.substring(1);
- postAjax("all_audit_erp_designerbill", "idList=" + idList, function (data) {
- resultShow(data, "grid.reload();");
- });
- }
- else {
- mini.alert("请至少选中一行记录!");
- }
- }
- //点击审核按钮
- function verifyFn(id) {
- var rec = grid.getSelected();
- var tid = rec.tid;
- edit_id = id;
- mini.get("return_win").show();
- $("#return_win").find("input").val("");
- $("#txtTid").val(tid);
- $("#txtDesigner").val(rec.userName);
- $("#txtRealPrice").val(rec.realPrice);
- }
- //点击审核
- function saveAuditFn() {
- if (!confirm("确认审核通过吗?")) return;
- var price = $("#txtRealPrice").val();
- postAjax("audit_erp_designerbill", "ID=" + edit_id + "&designerpirce=" + price, function (data) {
- mini.get("return_win").hide();
- resultShow(data, "grid.reload();");
- });
- }
- function canceAuditFn() {
- mini.get("return_win").hide();
- }
- //查询按钮
- function searchFn() {
- var form = new mini.Form("#ctl00_f_all");
- var data = form.getData(true, false);
- var s = data;
- grid.load({
- tid: s.tid, design: s.design, realPrice1: s.realPrice1, realPrice2: s.realPrice2, designerType: s.designerType, price1: s.price1, price2: s.price2, auditType: s.isAudit,isDk: s.isDk,
- orderState: s.state, endTime1: s.endTime1, endTime2: s.endTime2, designSize: s.designSize, modifySize: s.modifySize, designAuditType: s.designAuditType, designType: s.designType, designNum: s.designNum, org: s.designerorg
- });
- }
- //清除查询内容
- function clearFn() {
- //$("#ctl00_f_all").find("input").val("");
- var form = new mini.Form("#ctl00_f_all");
- form.clear();
- }
- $(function () {
- if (openPageData != "") {
- var s = openPageData;
- grid.load({
- tid: s.tid, design: s.design, realPrice: s.realPrice, designerTypeText: s.designerTypeText, price: s.price, afterSalePayment: s.afterSalePayment,
- orderState: s.orderState, buyer_nick: s.buyer_nick, seller_nick: s.seller_nick, seller_memo: s.seller_memo, afterSaleResponsible: s.afterSaleResponsible, refundFee: s.refundFee,
- end_time: s.end_time, designSize: s.designSize, modifySize: s.modifySize
- });
- var form = new mini.Form("#ctl00_f_all");
- if (form != undefined && form != null) {
- form.setData(s);
- }
- //$("#ic_chkNewPageSearch")[0].checked = true;
- }
- });
|