From 8b434a01ef9e2e48d1300be7792caa91f653b08e Mon Sep 17 00:00:00 2001 From: LSH Date: 星期一, 11 九月 2023 20:04:05 +0800 Subject: [PATCH] #销售核价可查看甲方单位与规划单信息 --- src/main/webapp/static/js/order/order.js | 126 +++++++++++++++++++++++++++++++++-------- 1 files changed, 101 insertions(+), 25 deletions(-) diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js index 44865a9..c4ab073 100644 --- a/src/main/webapp/static/js/order/order.js +++ b/src/main/webapp/static/js/order/order.js @@ -2,6 +2,8 @@ var pageCount = 0; var treeCond; var admin; +var userId ; +var userName ; layui.config({ base: baseUrl + "/static/layui/lay/modules/" }).extend({ @@ -59,7 +61,7 @@ case 1: // 妯℃澘涓嬭浇 layer.load(1, {shade: [0.1,'#fff']}); - location.href = baseUrl + "/mould/鐢叉柟鍗曚綅瀵煎叆妯℃澘.xls"; + location.href = baseUrl + "/mould/璺熻釜椤圭洰瀵煎叆妯℃澘.xls"; layer.closeAll('loading'); break case 2: @@ -120,6 +122,11 @@ }) } + let where = {} + if (getQueryVariable('status') !== false) { + where = {status: getQueryVariable('status')} + } + // 鏁版嵁娓叉煋 tableIns = table.render({ elem: '#order', @@ -132,31 +139,30 @@ height: 'full-148', // size: 'sm', skin: 'line', + where: where, cols: [[ {type: 'checkbox'} - // ,{field: 'id', align: 'center',title: 'ID'} - // ,{field: 'hostId$', align: 'center',title: '鎵�灞炲晢鎴�'} - ,{field: 'deptId$', align: 'center',title: '鎵�灞為儴闂�'} - ,{field: 'userId$', align: 'center',title: '鎵�灞炰汉鍛�'} - ,{field: 'cstmrId$', align: 'center',title: '鐢叉柟鍗曚綅'} - ,{field: 'uuid', align: 'center',title: '瀹㈡埛浠e彿'} - ,{field: 'name', align: 'center',title: '瀹㈡埛鍚嶇О'} - ,{field: 'money', align: 'center',title: '鎬婚噾棰�'} - ,{field: 'company$', align: 'center',title: '鎵�灞炲叕鍙�'} - ,{field: 'remarks', align: 'center',title: '澶囨敞'} - ,{field: 'director$', align: 'center',title: '璐熻矗浜�'} - ,{field: 'province', align: 'center',title: '鐪�', hide: true} - ,{field: 'city', align: 'center',title: '甯�', hide: true} - ,{field: 'district', align: 'center',title: '鍘�', hide: true} - ,{field: 'town', align: 'center',title: '闀�', hide: true} - ,{field: 'addr', align: 'center',title: '璇︾粏鍦板潃', hide: true} - ,{field: 'files', align: 'center',title: '闄勪欢', hide: true} - ,{field: 'status$', align: 'center',title: '鐘舵��', hide: true} - ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳', hide: true} - ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿', hide: true} - ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳', hide: true} - ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿', hide: true} - ,{field: 'memo', align: 'center',title: '娉ㄩ噴', hide: true} + ,{field: 'name', align: 'left',title: '璺熻釜椤圭洰鍚嶇О', style: 'color: #1890ff;cursor:pointer', event: 'more', width: 300} + ,{field: 'uuid', align: 'left',title: '椤圭洰浠e彿'} + ,{field: 'cstmrId$', align: 'left',title: '鐢叉柟鍗曚綅', style: 'color: #1890ff;cursor:pointer', event: 'cstmrMore', templet:function(d){return emptyShow(d.cstmrId$)}} + ,{field: 'pcd$', align: 'left',title: '鎵�灞炲尯鍩�', templet:function(d){return emptyShow(d.pcd$)}} + ,{field: 'addr', align: 'left',title: '椤圭洰鍦板潃', templet:function(d){return emptyShow(d.addr)}} + ,{field: 'money', align: 'right',title: '椤圭洰棰勭畻閲戦', templet:function(d){return emptyShow(d.money+"涓�")}} + ,{field: 'transactionRate', align: 'right',title: '椤圭洰棰勪及鎴愪氦鐜�', templet:function(d){return emptyShow(d.transactionRate+"%")}} + ,{field: 'director$', align: 'left',title: '椤圭洰璐熻矗浜�', templet:function(d){return emptyShow(d.director$)}} + ,{field: 'remarks', align: 'left',title: '澶囨敞', templet:function(d){return emptyShow(d.remarks)}} + ,{field: 'createTime$', align: 'left',title: '娣诲姞鏃堕棿'} + ,{field: 'company$', align: 'left',title: '鎵�灞炲叕鍙�', hide: false} + ,{field: 'orderProductTypeId$', align: 'left',title: '浜у搧绫诲瀷', hide: false} + ,{field: 'province', align: 'left',title: '鐪�', hide: true} + ,{field: 'city', align: 'left',title: '甯�', hide: true} + ,{field: 'district', align: 'left',title: '鍘�', hide: true} + ,{field: 'town', align: 'left',title: '闀�', hide: true} + ,{field: 'status$', align: 'left',title: '鐘舵��'} + ,{field: 'files', align: 'left',title: '闄勪欢', hide: true} + ,{field: 'updateBy$', align: 'left',title: '淇敼浜哄憳', hide: true} + ,{field: 'updateTime$', align: 'left',title: '淇敼鏃堕棿', hide: true} + ,{field: 'memo', align: 'left',title: '娉ㄩ噴', hide: true} ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120} ]], @@ -233,6 +239,18 @@ } }) break; + case 'cstmrMore': + top.cstmrByMore = data.cstmrId; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../cstmr/cstmr_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; case 'edit': showEditModel(data); break; @@ -252,10 +270,19 @@ success: function (layero, dIndex) { let cstmrSel = loadCstmrSel(); let companySel = loadCompanySel(); + let method = mData?'update':'add'; + if (!mData){ + companySel.setValue([{name: "娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�", value: 4}]); + } if (mData) { $('#cascaderVal').val(mData.pcd); if (mData.cstmrId) { cstmrSel.setValue([{name: mData.cstmrId$, value: mData.cstmrId}]); } if (mData.company) { companySel.setValue([{name: mData.company$, value: mData.company}]); } + }else { + mData = { + director: Number(userId), + director$: userName + } } layDateRender(mData); cascaderRender(); @@ -267,13 +294,35 @@ layer.msg("鎵�灞炲叕鍙镐笉鑳戒负绌�", {icon: 2}); return false; } + if (!data.field.cstmrId) { + layer.msg("鐢叉柟鍗曚綅涓嶈兘涓虹┖", {icon: 2}); + return false; + } + if (!data.field.transactionRate) { + layer.msg("棰勮鎴愪氦鐜囦笉鑳戒负绌�", {icon: 2}); + return false; + } + if (!data.field.status) { + layer.msg("椤圭洰鐘舵�佷笉鑳戒负绌�", {icon: 2}); + return false; + } + if (!data.field.pcd) { + layer.msg("鐪佸競鍖轰笉鑳戒负绌�", {icon: 2}); + return false; + } + if (!data.field.director) { + layer.msg("璐熻矗浜轰笉鑳戒负绌�", {icon: 2}); + return false; + } var loadIndex = layer.load(2); $.ajax({ - url: baseUrl+"/order/"+(mData?'update':'add')+"/auth", + url: baseUrl+"/order/"+(method)+"/auth", headers: {'token': localStorage.getItem('token')}, data: data.field, method: 'POST', success: function (res) { + console.log(data.field) + console.log(res) layer.close(loadIndex); if (res.code === 200){ layer.close(dIndex); @@ -284,6 +333,12 @@ }else { layer.msg(res.msg, {icon: 2}); } + } + ,error: function(xhr, status, error) { + // 澶勭悊閿欒 + console.log(data.field) + console.log(res) + console.log(error) } }) return false; @@ -366,12 +421,32 @@ }); } + $(document).ready(function() { + $.ajax({ + url: baseUrl + "/order/userName/userId/auth", + headers: { 'token': localStorage.getItem('token') }, + method: 'POST', + success: function(res) { + if (res.code === 200) { + userId = res.data.value; + userName = res.data.name; + } + }, + error: function(xhr, status, error) { + // 澶勭悊閿欒 + console.log(error); + } + }); + }); + + window.loadCstmrSel = function () { return xmSelect.render({ el: '#cstmrXmlSel', autoRow: true, filterable: true, remoteSearch: true, + clickClose: true, radio: true, remoteMethod: function (val, cb, show) { $.ajax({ @@ -400,6 +475,7 @@ autoRow: true, filterable: true, remoteSearch: true, + clickClose: true, radio: true, remoteMethod: function (val, cb, show) { $.ajax({ -- Gitblit v1.9.1