|
@@ -577,6 +577,8 @@
|
577
|
577
|
var kmXmzys = [[${kmFyInfo.xmzys}]];
|
578
|
578
|
console.log(kmXmzys)
|
579
|
579
|
var xgqsqje = [[${budgetapproval.sqje}]];
|
|
580
|
+ var tsmclist = [[${tsmclist}]];
|
|
581
|
+ var userInfo = [[${userInfo}]];
|
580
|
582
|
if ($("#fylbmc").val().indexOf("设备使用费") > -1) {
|
581
|
583
|
flag = '_Dev';
|
582
|
584
|
document.getElementById('sbsyfDiv').style.display = 'block';
|
|
@@ -2077,15 +2079,12 @@
|
2077
|
2079
|
cols: [
|
2078
|
2080
|
[
|
2079
|
2081
|
{type: "checkbox", align: 'center'},
|
2080
|
|
- {type: 'numbers', align: 'center'},
|
2081
|
|
- {field: 'fysq', title: '费用申请', width: '15%'},
|
2082
|
|
- {field: 'kyfh', title: '科研费号', width: '15%'},
|
2083
|
|
- {field: 'bzfy', title: '报账费用', width: '15%'},
|
2084
|
|
- {field: 'tsmc', title: '图书名称', width: '15%'},
|
2085
|
|
- {field: 'cbs', title: '出版社', width: '20%'},
|
2086
|
|
- {field: 'sl', title: '数量', width: '10%'},
|
2087
|
|
- {field: 'zj', title: '总价', width: '10%'},
|
2088
|
|
- {field: 'lyr',title: '领用人',width: '10%'},
|
|
2082
|
+ {type: 'numbers', align: 'center',width: '6%'},
|
|
2083
|
+ {field: 'tsmc', title: '图书名称', width: '25%'},
|
|
2084
|
+ {field: 'cbs', title: '出版社', width: '25%'},
|
|
2085
|
+ {field: 'sl', title: '数量', width: '11%'},
|
|
2086
|
+ {field: 'zj', title: '总价', width: '11%'},
|
|
2087
|
+ {field: 'lyr',title: '领用人',width: '15%'},
|
2089
|
2088
|
]
|
2090
|
2089
|
],
|
2091
|
2090
|
autoSort: false,
|
|
@@ -2110,11 +2109,18 @@
|
2110
|
2109
|
end: function (index) {
|
2111
|
2110
|
if (updateflag == 1) {
|
2112
|
2111
|
updateflag = 0;
|
2113
|
|
- //刷新表格
|
2114
|
|
- // dataInformation.push(information);
|
2115
|
|
- // tabIndirect.reload();
|
2116
|
2112
|
var oldData = table.cache["currentTableId_Zlf"];
|
2117
|
|
- oldData.push(information);
|
|
2113
|
+ var oldDataTsmcList = new Array();
|
|
2114
|
+ for (let i = 0; i < oldData.length; i++) {
|
|
2115
|
+ oldDataTsmcList.push(oldData[i].tsmc)
|
|
2116
|
+ }
|
|
2117
|
+ if (tsmclist.includes(information.tsmc)){
|
|
2118
|
+ layer.alert(userInfo.deptName+'在资料费中已申请过:'+information.tsmc)
|
|
2119
|
+ }else if (oldDataTsmcList.includes(information.tsmc)){
|
|
2120
|
+ layer.alert('表中已存在资料:'+information.tsmc)
|
|
2121
|
+ }else {
|
|
2122
|
+ oldData.push(information);
|
|
2123
|
+ }
|
2118
|
2124
|
table.reload('currentTableId_Zlf', {
|
2119
|
2125
|
data: oldData
|
2120
|
2126
|
});
|
|
@@ -2127,7 +2133,10 @@
|
2127
|
2133
|
var oldData = table.cache["currentTableId_Zlf"];
|
2128
|
2134
|
if (oldData.length == 0)
|
2129
|
2135
|
return;
|
2130
|
|
-
|
|
2136
|
+ var oldDataTsmcList = new Array();
|
|
2137
|
+ for (let i = 0; i < oldData.length; i++) {
|
|
2138
|
+ oldDataTsmcList.push(oldData[i].tsmc)
|
|
2139
|
+ }
|
2131
|
2140
|
var checkStatus = table.checkStatus('currentTableId_Zlf')
|
2132
|
2141
|
, data = checkStatus.data;
|
2133
|
2142
|
if (data == null || data.length === 0) {
|
|
@@ -2161,8 +2170,26 @@
|
2161
|
2170
|
for (var i = 0; i < oldData.length; i++) {
|
2162
|
2171
|
var item = oldData[i];
|
2163
|
2172
|
if (item.LAY_CHECKED) {//条件:选中
|
2164
|
|
- oldData[i] = information;
|
2165
|
|
- break;
|
|
2173
|
+ for (let i = 0; i < oldDataTsmcList.length; i++) {
|
|
2174
|
+ if (oldDataTsmcList[i] === item.tsmc) {
|
|
2175
|
+ oldDataTsmcList.splice(i, 1); // 删除当前项
|
|
2176
|
+ }
|
|
2177
|
+ }
|
|
2178
|
+ console.log(tsmclist)
|
|
2179
|
+ for (let i = 0; i < tsmclist.length; i++) {
|
|
2180
|
+ if (tsmclist[i] === item.tsmc) {
|
|
2181
|
+ tsmclist.splice(i, 1); // 删除当前项
|
|
2182
|
+ }
|
|
2183
|
+ }
|
|
2184
|
+ console.log(tsmclist)
|
|
2185
|
+ if (tsmclist.includes(information.tsmc)){
|
|
2186
|
+ layer.alert(userInfo.deptName+'在资料费中已申请过:'+information.tsmc)
|
|
2187
|
+ }else if (oldDataTsmcList.includes(information.tsmc)){
|
|
2188
|
+ layer.alert('表中已存在资料:'+information.tsmc)
|
|
2189
|
+ }else {
|
|
2190
|
+ oldData[i] = information;
|
|
2191
|
+ break;
|
|
2192
|
+ }
|
2166
|
2193
|
}
|
2167
|
2194
|
}
|
2168
|
2195
|
//刷新表格
|