From 11344667237a69d8812ee5c5c24c67c1ae207f18 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 08 九月 2023 14:39:35 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/reimburseOnline/reimburseOnline.js | 259 ++++++++++++++++++++-------------------------------
1 files changed, 103 insertions(+), 156 deletions(-)
diff --git a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
index c6b4fa7..827a3ed 100644
--- a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
+++ b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
@@ -89,6 +89,8 @@
,{field: 'checkData', align: 'center',title: '鏄惁鍐茶处',hide: false}
,{field: 'orderNum', align: 'center',title: '鎶ラ攢鍗曞彿',width: 320, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false}
,{field: 'planId$', align: 'center',title: '椤圭洰鍙�',hide: false}
+ ,{field: 'name', align: 'center',title: '瀹㈡埛淇℃伅',hide: false}
+ ,{field: 'settle', align: 'center',title: '杩涘害',hide: false}
,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿',hide: false}
,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿',hide: false}
,{field: 'status$', align: 'center',title: '鐘舵��',hide: false}
@@ -236,6 +238,17 @@
table.on('tool(reimburseOnline)', function(obj){
var data = obj.data;
switch (obj.event) {
+ case 'approval2':
+ layer.confirm('瀹℃壒閫氳繃锛�', {
+ skin: 'layui-layer-admin',
+ shade: .1,
+ offset: '200px',
+ title: data.name
+ }, function (i) {
+ layer.close(i);
+ approval2(data.id);
+ });
+ break;
case 'more':
top.reimburseOnlineByMore=data.id;
console.log(top.reimburseOnlineByMore)
@@ -286,101 +299,7 @@
});
break;
case "edit":
- showEditForm(data);
- break;
- case "upload":
- $.ajax({
- type:"get",
- url: baseUrl+"/reimburseOnline/viewCheck/" + data.id + "/auth",
- dataType:"json",
- headers: {'token': localStorage.getItem('token')},
- success:function(res) {
- if (res.code == 200) {
- layer.confirm('褰撳墠宸插瓨鍦ㄦ暟鎹紝缁х画涓婁紶灏嗕細瑕嗙洊鏃ф暟鎹紝鏄惁涓婁紶锛�', function(){
- $("#uploadQuote").click()
- });
- }else{
- $("#uploadQuote").click()
- }
- }
- });
-
- $("#uploadQuote").on("change",(evt) => {
- var files = evt.target.files;
- if(files==null || files.length==0){
- alert("No files wait for import");
- return;
- }
-
- let name = files[0].name;
- let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1];
- if(suffix!="xlsx"){
- alert("Currently only supports the import of xlsx files");
- return;
- }
- LuckyExcel.transformExcelToLucky(files[0], function(exportJson, luckysheetfile){
- if(exportJson.sheets==null || exportJson.sheets.length==0){
- alert("Failed to read the content of the excel file, currently does not support xls files!");
- return;
- }
-
- let formData = new FormData($("#uploadFile")[0]);
- formData.append("id", data.id);
- formData.append("checkData", zip(exportJson.sheets));
- $.ajax({
- url: baseUrl+"/reimburseOnline/uploadCheck/auth",
- headers: {'token': localStorage.getItem('token')},
- data: formData,
- // data: JSON.stringify({
- // id: data.id,
- // checkData: zip(exportJson.sheets)
- // }),
- // dataType: "json",
- method: 'POST',
- cache: false,
- processData: false,
- contentType: false,
- // contentType:'application/json;charset=UTF-8',
- success: function (res) {
- if (res.code == 200) {
- layer.msg('涓婁紶鎴愬姛',{time:1000},() => {
- parent.location.reload()
- })
- }else{
- layer.msg(res.msg,{time:1000},() => {
- parent.location.reload()
- })
- }
- }
- })
- });
- })
- break;
- case "viewCheck":
- //鏌ョ湅璇环
- $.ajax({
- type:"get",
- url: baseUrl+"/reimburseOnline/viewCheck/" + data.id + "/auth",
- dataType:"json",
- headers: {'token': localStorage.getItem('token')},
- success:function(res) {
- if (res.code == 200) {
- layer.open({
- type: 2,
- title: '鏌ョ湅璇环',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: 'reimburseOnline_check.html?id=' + data.id,
- success: function(layero, index){
- // layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- }
- });
- }else{
- layer.msg(res.msg,{time:1000})
- }
- }
- });
+ showEditModel(data);
break;
case "look":
var $a = $(obj.tr).find('a[lay-event="look"]');
@@ -476,6 +395,7 @@
var isExpAdd = !expTpe;
// 鍥炴樉鏁版嵁
form.val('editForm', expTpe);
+ console.log(expTpe)
if (expTpe) {
// $('#orderNo').attr("disabled", "disabled");
}
@@ -503,7 +423,8 @@
orderNo: data.field.planId,
templateName: data.field.templateName,
checkData: data.field.checkData,
- reimburseOnlineDetls: nList
+ reimburseOnlineDetls: nList,
+ name: data.field.name
}),
contentType:'application/json;charset=UTF-8',
method: 'POST',
@@ -534,31 +455,53 @@
cellMinWidth: 100,
cols: [[
{type: 'numbers', title: '#'},
- {field: 'occupation', title: '浜嬬敱', width: 100},
+ {field: 'occupation', title: '浜嬬敱', width: 100, style: 'color: blue;font-weight: bold', edit:true},
// {field: 'expenseType', title: '璐圭敤绫诲瀷', width: 100},
{field: 'expenseType$', title: '璐圭敤绫诲瀷', width: 100},
- {field: 'taxRate', title: '绋庣巼', width: 60},
- {field: 'untaxedAmountInLocalCurrency', title: '鏈◣鏈竵閲戦', width: 120},
- {field: 'untaxedAmount', title: '鏈◣閲戦', width: 100},
- {field: 'taxAmount', title: '绋庨', width: 60},
- {field: 'invoiceValue', title: '鍙戠エ閲戦', width: 100},
- {field: 'invoiceAmountInLocalCurrency', title: '鍙戠エ鏈竵閲戦', width: 120},
- {field: 'reimbursementRatio', title: '鎶ラ攢姣斾緥', width: 100},
- {field: 'reimbursementAmount', title: '鎶ラ攢閲戦', width: 100},
- {field: 'reimbursementAmountInLocalCurrency', title: '鎶ラ攢鏈竵閲戦', width: 120},
- {field: 'cashierConfirmationAmount', title: '鍑虹撼纭閲戦', width: 120},
- {field: 'cashierCurrency', title: '鍑虹撼甯佺', width: 100},
+ {field: 'taxRate', title: '绋庣巼', width: 60, edit: true},
+ {field: 'untaxedAmountInLocalCurrency', title: '鏈◣鏈竵閲戦', width: 120, edit: true},
+ {field: 'untaxedAmount', title: '鏈◣閲戦', width: 100, edit: true},
+ {field: 'taxAmount', title: '绋庨', width: 60, edit: true},
+ {field: 'invoiceValue', title: '鍙戠エ閲戦', width: 100, edit: true},
+ {field: 'invoiceAmountInLocalCurrency', title: '鍙戠エ鏈竵閲戦', width: 120, edit: true},
+ {field: 'reimbursementRatio', title: '鎶ラ攢姣斾緥', width: 100, edit: true},
+ {field: 'reimbursementAmount', title: '鎶ラ攢閲戦', width: 100, edit: true},
+ {field: 'reimbursementAmountInLocalCurrency', title: '鎶ラ攢鏈竵閲戦', width: 120, edit: true},
+ {field: 'cashierConfirmationAmount', title: '鍑虹撼纭閲戦', width: 120, edit: true},
+ {field: 'cashierCurrency', title: '鍑虹撼甯佺', width: 100, edit: true},
{field: 'departureTime', title: '鍑哄彂鏃ユ湡', width: 100},
- {field: 'cashierConfirmationAmount', title: '鍑虹撼纭閲戦', width: 120},
+ {field: 'cashierConfirmationAmount', title: '鍑虹撼纭閲戦', width: 120, edit: true},
{field: 'userId', title: '鍒楁敮浜哄憳', width: 120},
{field: 'deptId', title: '鍒楁敮閮ㄩ棬', width: 120},
{field: 'updateTime', title: '鏇存柊鏃ユ湡', width: 100},
// {field: 'updateUserId', title: '鏇存柊浜哄憳ID', width: 160},
{field: 'updateUserName', title: '鏇存柊浜哄憳鍚嶅瓧'},
// {field: 'creationTime', title: '鍒涘缓鏃ユ湡', width: 160}
+ {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
]],
- done: function (res) {
+ done: function (res, curr, count) {
$(layero).find('.layui-table-view').css('margin', '0');
+ var options = this;
+
+ // 鑾峰彇褰撳墠琛屾暟鎹�
+ table.getRowData = function(elem){
+ var index = $(elem).closest('tr').data('index');
+ return table.cache[options.id][index] || {};
+ };
+
+ $('.input-occupation').on('text', function(){
+ var value = this.value; // 鑾峰彇閫変腑椤� value
+ var data = table.getRowData(this);
+ console.log(value);
+ console.log("value------===");
+ xxDataList.forEach(res => {
+ if (data.id === res.id){
+ console.log(res)
+ res.occupation = value;
+ }
+ })
+
+ });
},
size: ''
};
@@ -641,6 +584,7 @@
// 琛ㄥ崟鎻愪氦浜嬩欢
form.on('submit(matEditSubmit)', function (data) {
let selectList = matXmSelect.getValue();
+ console.log(selectList)
for (let i = 0; i<selectList.length; i++) {
let item = selectList[i];
// 鏌ヨ鐗╂枡璇︽儏
@@ -652,13 +596,16 @@
success: function (res) {
if (res.code === 200){
var bige=true;
- for (var j = 0; j < xxDataList.length; j++) {
- if (xxDataList[j].matnr === res.data.matnr && xxDataList[j].batch === res.data.batch) {
- bige=false;
- break;
- }
- }
+ // console.log("-------2.1-------")
+ // for (var j = 0; j < xxDataList.length; j++) {
+ // if (xxDataList[j].expenseType === res.data.expenseType && xxDataList[j].batch === res.data.batch) {
+ // bige=false;
+ // console.log("-------2.2-------")
+ // break;
+ // }
+ // }
if (bige){
+ // console.log("-------2.3-------")
xxDataList.push(res.data);
insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
}
@@ -712,10 +659,10 @@
});
}
- function approval(planId, plannerId, dIdx) {
+ function approval2(planId, plannerId, dIdx) {
let loadIndex = layer.load(2);
$.ajax({
- url: baseUrl+"/reimburseOnline/approval/auth",
+ url: baseUrl+"/reimburseOnline/approval2/auth",
headers: {'token': localStorage.getItem('token')},
data: {
planId: planId,
@@ -772,44 +719,44 @@
// });
// }
- //鏇存柊form
- function showEditForm(mData) {
- admin.open({
- type: 1,
- area: '800px',
- title: '鏍镐环淇℃伅缂栬緫',
- content: $('#editStatus').html(),
- success: function (layero, dIndex) {
- form.val('editStatusDetail', mData);
- form.render('select')
- form.on('submit(editSubmit)', function (data) {
- var loadIndex = layer.load(2);
- $.ajax({
- url: baseUrl+"/reimburseOnline/updateForm/auth",
- headers: {'token': localStorage.getItem('token')},
- data: data.field,
- method: 'POST',
- traditional:true,
- success: function (res) {
- if (res.code === 200){
- layer.closeAll();
- tableReload(false);
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- } else {
- layer.msg(res.msg)
- }
- }
- })
- layer.close(loadIndex);
- layer.close(dIndex);
- return false;
- });
- $(layero).children('.layui-layer-content').css('overflow', 'visible');
- layui.form.render('select');
- }
- });
- }
+ // // 鏇存柊form
+ // function showEditForm(mData) {
+ // admin.open({
+ // type: 1,
+ // area: '800px',
+ // title: '鏍镐环淇℃伅缂栬緫',
+ // content: $('#editStatus').html(),
+ // success: function (layero, dIndex) {
+ // form.val('editStatusDetail', mData);
+ // form.render('select')
+ // form.on('submit(editSubmit)', function (data) {
+ // var loadIndex = layer.load(2);
+ // $.ajax({
+ // url: baseUrl+"/reimburseOnline/updateForm/auth",
+ // headers: {'token': localStorage.getItem('token')},
+ // data: data.field,
+ // method: 'POST',
+ // traditional:true,
+ // success: function (res) {
+ // if (res.code === 200){
+ // layer.closeAll();
+ // tableReload(false);
+ // } else if (res.code === 403){
+ // top.location.href = baseUrl+"/";
+ // } else {
+ // layer.msg(res.msg)
+ // }
+ // }
+ // })
+ // layer.close(loadIndex);
+ // layer.close(dIndex);
+ // return false;
+ // });
+ // $(layero).children('.layui-layer-content').css('overflow', 'visible');
+ // layui.form.render('select');
+ // }
+ // });
+ // }
});
--
Gitblit v1.9.1