Quellcode durchsuchen

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

临城职教中职
zhangli vor 2 Jahren
Ursprung
Commit
c1e4d47a7e
5 geänderte Dateien mit 34 neuen und 19 gelöschten Zeilen
  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 Datei anzeigen

@@ -41,6 +41,10 @@
<div class="lr-form-item-title">其他作者</div> <div class="lr-form-item-title">其他作者</div>
<input id="OtherAuthor" type="text" class="form-control" readonly /> <input id="OtherAuthor" type="text" class="form-control" readonly />
</div> </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="col-xs-12 lr-form-item" data-table="TextBookIndent">
<div class="lr-form-item-title">备注</div> <div class="lr-form-item-title">备注</div>
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> <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 Datei anzeigen

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


var bootstrap = function ($, learun) { var bootstrap = function ($, learun) {
"use strict"; "use strict";
@@ -61,13 +61,16 @@ var bootstrap = function ($, learun) {
if (learun.checkrow(keyValue)) { if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res, index) { learun.layerConfirm('是否确认删除该项!', function (res, index) {
if (res) { if (res) {
order = 0;
$.each(tempdatra, function (key, val) { $.each(tempdatra, function (key, val) {
if (tempdatra[key].ID === keyValue) { if (tempdatra[key].ID === keyValue) {
pricecount -= tempdatra[key].AAIPrice * tempdatra[key].AAIStock;
// order -= tempdatra[key].TeachSum + tempdatra[key].StuSum;
tempdatra.splice(key, 1); 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)); $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber));
top.layer.close(index); top.layer.close(index);
} }
@@ -185,13 +188,13 @@ var bootstrap = function ($, learun) {
} }
else { else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]); $('[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) { refreshGirdData = function (temprow) {
@@ -205,16 +208,17 @@ var bootstrap = function ($, learun) {
if (ifnewrow) { if (ifnewrow) {
tempdatra.push(temprow); 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)); $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber));
}; };
function sortNumber(a, b) { function sortNumber(a, b) {
return a.AAIOrder - b.AAIOrder;
return a.StuSum - b.StuSum;
} }
// 设置表单数据 // 设置表单数据
setFormData = function (processId, param, callback) { setFormData = function (processId, param, callback) {


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.cshtml Datei anzeigen

@@ -9,11 +9,11 @@
</div> </div>
<div class="col-xs-6 lr-form-item"> <div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">教师人数<font face="宋体">*</font></div> <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>
<div class="col-xs-6 lr-form-item"> <div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">学生人数<font face="宋体">*</font></div> <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>
<div class="col-xs-12 lr-form-item"> <div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">备注</div> <div class="lr-form-item-title">备注</div>


+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js Datei anzeigen

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

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

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


Laden…
Abbrechen
Speichern