From 811e1085c075d956f4c82041ab61905fd480339d Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 31 五月 2023 12:47:05 +0800
Subject: [PATCH] #货物状态自选

---
 src/main/webapp/static/js/order/order.js |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index 133061c..65ada4d 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -256,6 +256,7 @@
                         return false;
                     }
                     let nList = admin.util.deepClone(xxDataList);
+                    console.log(nList);
                     for (let xi = 0; xi < nList.length; xi++) {
                         if (nList[xi].anfme <= 0){
                             layer.msg('鏄庣粏淇敼鏁伴噺涓嶅悎娉�', {icon: 2});
@@ -316,13 +317,36 @@
                         {field: 'specs', title: '瑙勬牸'},
                         {field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                         {field: 'owner', title: '璐т富缂栧彿', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
+                        {field: 'payment', title: '璐т富缂栧彿', style: 'color: blue;font-weight: bold', templet: '#payment'},
+                        // {field: 'payment', title: '璐х墿鐘舵��',align: 'center', templet: '#payment'},
                         {field: 'qty', title: '浣滀笟鏁伴噺',  minWidth: 100, width: 100},
                         // {field: 'unit', title: '鍗曚綅', width: 80},
                         {field: 'memo', title: '澶囨敞' , edit: true},
                         {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
                     ]],
-                    done: function (res) {
+                    done: function (res, curr, count) {
                         $(layero).find('.layui-table-view').css('margin', '0');
+                        var options = this;
+
+                        // 鑾峰彇褰撳墠琛屾暟鎹�
+                        table.getRowData = function(elem){
+                            var index = $(elem).closest('tr').data('index');
+                            return table.cache[options.id][index] || {};
+                        };
+
+                        $('.select-primary').on('change', function(){
+                            var value = this.value; // 鑾峰彇閫変腑椤� value
+                            var data = table.getRowData(this);
+                            console.log(value);
+                            xxDataList.forEach(res => {
+                                if (data.id === res.id){
+                                    console.log(res)
+                                    res.payment = value;
+                                }
+                            })
+
+
+                        });
                     },
                     size: ''
                 };
@@ -557,4 +581,6 @@
         ,type: 'datetime'
         ,range: true
     });
+
+
 });

--
Gitblit v1.9.1