| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- @using ShwasherSys
- @using ShwasherSys.Models.Modal
- <!-- 千件重编辑模态框 -->
-
- <div class="modal fade" id="kgWeightModal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" >
- <div class="modal-dialog modal-dialog-centered" role="document">
- <div class="modal-content" style="min-width: 850px;">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("修改千件重", ""))
- @{
- var inputsKg = new List<InputViewModel>
- {
- new InputViewModel("kgWight", displayName:"千件重",@class:"number",other:"min=0.001"),
- new InputViewModel("kg_productionOrderId", hide:true,name:"id")
- };
-
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputsKg))
- @Html.Partial("Modals/_SwModalFooter", new ModelFooterModel("kgWeightModal", "saveKgWeight()"))
-
- </div>
- </div>
- </div>
- @using (Html.BeginScripts())
- {
- <style>
- .kg-weight-editable {
- color: #007bff;
- cursor: pointer;
- text-decoration: underline;
- }
- .kg-weight-editable:hover {
- color: #0056b3;
- }
- </style>
-
- <script type="text/javascript">
- $(function() {
- //todo
- });
- function f_modifyKgWeight(id, oldVal) {
- $('#kg_productionOrderId').val(id);
- $('#kgWight').val(oldVal);
- $('#kgWeightModal').modal('show');
- }
- function saveKgWeight() {
- var id = $('#kg_productionOrderId').val();
- var kgWeight = $('#kgWight').val();
- if (!kgWeight || kgWeight <= 0) {
- abp.message.error('请输入有效的千件重值');
- return;
- }
- var data = {
- id: parseInt(id),
- kgWeight: parseFloat(kgWeight)
- };
- SaveAjax({
- url: window.appUrl + 'ProductionOrders/UpdateKgWeight',
- data,
- isAlert: false,
- isValidate: false,
- success: function (res) {
- if (res || res.length > 0) {
- RefreshTable();
- $('#kgWeightModal').modal('hide');
- } else {
- abp.message.error(result.error || '更新失败');
- }
- }
- });
- }
- // 千件重格式化器
- function KgWeightFormatter(value, row) {
- if (!value && value !== 0) {
- return '-';
- }
- // 检查是否可编辑(排产单状态小于等于2:排产中、已审核)
- var noEdit = row.productionOrderStatus > 2 && row.productionOrderStatus !=7;
-
- if (!noEdit) {
- return `<span class="table-action" onclick="f_modifyKgWeight(${row.id},${value})">${value}</span>`
- } else {
- return value;
- }
- }
- </script>
- }
|