|
@@ -19,6 +19,16 @@ function loadUpdateMaterials(newMaterial, fields) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+function resetTpTable() {
|
|
|
|
+ const rate = $('#changeRate').val();
|
|
|
|
+ const bqhs = ZhCalc.round(ZhCalc.mul(m_tp, 1+rate/100), 2);
|
|
|
|
+ const jzbqhs = ZhCalc.round(ZhCalc.mul(ZhCalc.add(pre_tp, m_tp), 1+rate/100), 2);
|
|
|
|
+ $('#tp_set').find('td').eq(1).text(ZhCalc.round(m_tp, 2));
|
|
|
|
+ $('#tp_set').find('td').eq(2).text(ZhCalc.round(ZhCalc.add(pre_tp, m_tp), 2));
|
|
|
|
+ $('#rate_set').find('td').eq(1).text(bqhs !== 0 ? bqhs : '');
|
|
|
|
+ $('#rate_set').find('td').eq(2).text(jzbqhs !== 0 ? jzbqhs : '');
|
|
|
|
+}
|
|
$(document).ready(() => {
|
|
$(document).ready(() => {
|
|
autoFlashHeight();
|
|
autoFlashHeight();
|
|
const materialSpread = SpreadJsObj.createNewSpread($('#material-spread')[0]);
|
|
const materialSpread = SpreadJsObj.createNewSpread($('#material-spread')[0]);
|
|
@@ -64,7 +74,6 @@ $(document).ready(() => {
|
|
materialSpreadSetting.imageClick = function (data) {
|
|
materialSpreadSetting.imageClick = function (data) {
|
|
if (data.t_type === 2) {
|
|
if (data.t_type === 2) {
|
|
$('#bcyy').modal('show');
|
|
$('#bcyy').modal('show');
|
|
- console.log(data);
|
|
|
|
$('#materialbillsId').val(data.id);
|
|
$('#materialbillsId').val(data.id);
|
|
$('#expr').val(data.expr);
|
|
$('#expr').val(data.expr);
|
|
if (!readOnly && data.mid === materialID) {
|
|
if (!readOnly && data.mid === materialID) {
|
|
@@ -152,6 +161,8 @@ $(document).ready(() => {
|
|
const sheet = materialSpread.getActiveSheet();
|
|
const sheet = materialSpread.getActiveSheet();
|
|
const select = SpreadJsObj.getSelectObject(sheet);
|
|
const select = SpreadJsObj.getSelectObject(sheet);
|
|
postData(window.location.pathname + '/save', {type: 'del', id: select.id}, function (result) {
|
|
postData(window.location.pathname + '/save', {type: 'del', id: select.id}, function (result) {
|
|
|
|
+ m_tp = result.m_tp;
|
|
|
|
+ resetTpTable();
|
|
const index = materialBillsData.indexOf(select);
|
|
const index = materialBillsData.indexOf(select);
|
|
materialBillsData.splice(index, 1);
|
|
materialBillsData.splice(index, 1);
|
|
sheet.deleteRows(index, 1);
|
|
sheet.deleteRows(index, 1);
|
|
@@ -240,6 +251,8 @@ $(document).ready(() => {
|
|
select.m_tp = materialCol.getValue.m_tp(select);
|
|
select.m_tp = materialCol.getValue.m_tp(select);
|
|
// 更新至服务器
|
|
// 更新至服务器
|
|
postData(window.location.pathname + '/save', { type:'update', updateData: select }, function (result) {
|
|
postData(window.location.pathname + '/save', { type:'update', updateData: select }, function (result) {
|
|
|
|
+ m_tp = result.m_tp;
|
|
|
|
+ resetTpTable();
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
}, function () {
|
|
}, function () {
|
|
select[col.field] = orgValue;
|
|
select[col.field] = orgValue;
|
|
@@ -440,10 +453,19 @@ $(document).ready(() => {
|
|
const expr = $('#expr').val();
|
|
const expr = $('#expr').val();
|
|
// 判断表达式格式
|
|
// 判断表达式格式
|
|
const [valid, msg] = ExprObj._checkExpr(expr);
|
|
const [valid, msg] = ExprObj._checkExpr(expr);
|
|
- console.log(msg);
|
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
toastr.error(msg);
|
|
toastr.error(msg);
|
|
}
|
|
}
|
|
|
|
+ postData(window.location.pathname + '/save', { type:'expr', id: $('#materialbillsId').val(), expr: expr }, function (result) {
|
|
|
|
+ m_tp = result.m_tp;
|
|
|
|
+ resetTpTable();
|
|
|
|
+ const sheet = materialSpread.getActiveSheet();
|
|
|
|
+ const select = SpreadJsObj.getSelectObject(sheet);
|
|
|
|
+ const index = materialBillsData.indexOf(select);
|
|
|
|
+ materialBillsData.splice(index, 1, result.info);
|
|
|
|
+ SpreadJsObj.reLoadRowData(sheet, index);
|
|
|
|
+ $('#bcyy').modal('hide');
|
|
|
|
+ });
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
// SpreadJsObj.forbiddenSpreadContextMenu('#material-spread', materialSpread);
|
|
// SpreadJsObj.forbiddenSpreadContextMenu('#material-spread', materialSpread);
|