ソースを参照

教材订单新增订购数量字段,自动计算

临城职教中职
zhangli 2年前
コミット
c1e4d47a7e
5個のファイルの変更34行の追加19行の削除
  1. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml
  2. +18
    -14
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js
  3. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.cshtml
  4. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js
  5. +7
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentEntity.cs

+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml ファイルの表示

@@ -41,6 +41,10 @@
<div class="lr-form-item-title">其他作者</div>
<input id="OtherAuthor" type="text" class="form-control" readonly />
</div>
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent">
<div class="lr-form-item-title">订购数量</div>
<input id="OrderNum" type="number" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent">
<div class="lr-form-item-title">备注</div>
<textarea id="Remark" class="form-control" style="height:100px;"></textarea>


+ 18
- 14
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js ファイルの表示

@@ -17,7 +17,7 @@ var save;
var selectedRow;
var refreshGirdData;
var tempdatra = new Array();
var pricecount = 0;
var order = 0;

var bootstrap = function ($, learun) {
"use strict";
@@ -61,13 +61,16 @@ var bootstrap = function ($, learun) {
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res, index) {
if (res) {
order = 0;
$.each(tempdatra, function (key, val) {
if (tempdatra[key].ID === keyValue) {
pricecount -= tempdatra[key].AAIPrice * tempdatra[key].AAIStock;
// order -= tempdatra[key].TeachSum + tempdatra[key].StuSum;
tempdatra.splice(key, 1);
} else {
order += (parseInt(tempdatra[key].TeachSum) + parseInt(tempdatra[key].StuSum));
}
});
$("#AAPrice").val(pricecount);
$("#OrderNum").val(order);
$('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber));
top.layer.close(index);
}
@@ -185,13 +188,13 @@ var bootstrap = function ($, learun) {
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
if (data[id].AAPrice) {
pricecount = data[id].AAPrice;
}
//if (data[id].AAPrice) {
// pricecount = data[id].AAPrice;
//}
}
}
});
}
}
}
};
refreshGirdData = function (temprow) {
@@ -205,16 +208,17 @@ var bootstrap = function ($, learun) {
if (ifnewrow) {
tempdatra.push(temprow);
}
//总价计算
pricecount = 0;
//for (var i = 0; i < tempdatra.length; i++) {
// pricecount += tempdatra[i].AAIPrice * tempdatra[i].AAIStock;
//}
//$("#AAPrice").val(pricecount);
//订购数量
order = 0;
for (var i = 0; i < tempdatra.length; i++) {
order += (parseInt(tempdatra[i].TeachSum) + parseInt(tempdatra[i].StuSum));
}
$("#OrderNum").val(order);

$('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber));
};
function sortNumber(a, b) {
return a.AAIOrder - b.AAIOrder;
return a.StuSum - b.StuSum;
}
// 设置表单数据
setFormData = function (processId, param, callback) {


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.cshtml ファイルの表示

@@ -9,11 +9,11 @@
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">教师人数<font face="宋体">*</font></div>
<input id="TeachSum" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
<input id="TeachSum" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">学生人数<font face="宋体">*</font></div>
<input id="StuSum" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
<input id="StuSum" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">备注</div>


+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js ファイルの表示

@@ -174,10 +174,10 @@ var bootstrap = function ($, learun) {
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetPageList',
headData: [
{ label: "主键", name: "ID", width: 200, align: "left" },
//{ label: "主键", name: "ID", width: 200, align: "left" },
{
label: "专业部", name: "DeptNo", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
@@ -223,6 +223,7 @@ var bootstrap = function ($, learun) {
{ label: "书籍编码", name: "PublishNo", width: 150, align: "left" },
{ label: "作者", name: "FirstAuthor", width: 100, align: "left" },
{ label: "其他作者", name: "OtherAuthor", width: 200, align: "left" },
{ label: "订购数量", name: "OrderNum", width: 100, align: "left" },
{ label: "备注", name: "Remark", width: 200, align: "left" },
{ label: "录入时间", name: "CreateTime", width: 100, align: "left" },
{


+ 7
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentEntity.cs ファイルの表示

@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 日 期:2022-02-18 14:27
/// 描 述:教材订单管理
/// </summary>
public class TextBookIndentEntity
public class TextBookIndentEntity
{
#region 实体成员
/// <summary>
@@ -79,6 +79,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[Column("OTHERAUTHOR")]
public string OtherAuthor { get; set; }

/// <summary>
/// 订购数量
/// </summary>
[Column("ORDERNUM")]
public int? OrderNum { get; set; }
/// <summary>
/// Remark
/// </summary>


読み込み中…
キャンセル
保存