kts-component-invoice-operate 3.2.174 → 3.2.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Invoice/Invoice-digtal/_test/architecture/index.d.ts +4 -0
- package/dist/Invoice/Invoice-digtal/_test/freight/index.d.ts +4 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.d.ts +6 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.d.ts +23 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.d.ts +21 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.d.ts +31 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +5 -0
- package/dist/Invoice/InvoiceController/fns/addFreight.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/delFreight.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/saveEditFreight.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/setEditFreight.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/setFreight.d.ts +6 -0
- package/dist/Invoice/InvoiceController/index.d.ts +10 -0
- package/dist/Invoice/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/Architecture/index.d.ts +15 -0
- package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/FreightList/hook/useOnRow/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/FreightList/index.d.ts +9 -0
- package/dist/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/FreightList/ui/TableRow/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.d.ts +4 -0
- package/dist/index.esm.js +1896 -52
- package/dist/index.js +1896 -52
- package/package.json +3 -3
- package/src/Invoice/Invoice-digtal/_test/architecture/index.tsx +22 -0
- package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +14564 -0
- package/src/Invoice/Invoice-digtal/index.md +7 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.ts +10 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.ts +33 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.ts +81 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.ts +40 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +6 -0
- package/src/Invoice/InvoiceController/fns/addFreight.ts +11 -0
- package/src/Invoice/InvoiceController/fns/delFreight.ts +38 -0
- package/src/Invoice/InvoiceController/fns/saveEditFreight.ts +24 -0
- package/src/Invoice/InvoiceController/fns/setEditFreight.ts +16 -0
- package/src/Invoice/InvoiceController/fns/setFreight.ts +11 -0
- package/src/Invoice/InvoiceController/index.ts +20 -1
- package/src/Invoice/index.tsx +8 -1
- package/src/Invoice/tools/useToGenerateId/index.ts +2 -0
- package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +10 -11
- package/src/Invoice/ui/digtal/Architecture/index.less +15 -0
- package/src/Invoice/ui/digtal/Architecture/index.tsx +166 -0
- package/src/Invoice/ui/digtal/FreightList/hook/useColumns/dist/index.js +616 -0
- package/src/Invoice/ui/digtal/FreightList/hook/useColumns/index.tsx +246 -0
- package/src/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.tsx +20 -0
- package/src/Invoice/ui/digtal/FreightList/hook/useOnRow/index.tsx +37 -0
- package/src/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.tsx +120 -0
- package/src/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.tsx +23 -0
- package/src/Invoice/ui/digtal/FreightList/index.less +74 -0
- package/src/Invoice/ui/digtal/FreightList/index.tsx +108 -0
- package/src/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.tsx +65 -0
- package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
- package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -0
- package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.less +29 -0
- package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.tsx +21 -0
- package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.less +39 -0
- package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.tsx +109 -0
- package/src/Invoice/ui/digtal/GoodsList/index.tsx +0 -1
- package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +0 -1
- package/src/TaxClassificationCodeModal/index.less +0 -8
- package/src/TaxClassificationCodeModal/index.tsx +4 -13
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var mathjs = require('mathjs');
|
|
|
9
9
|
var ktsComponentsAntdX3 = require('kts-components-antd-x3');
|
|
10
10
|
var uuid = require('uuid');
|
|
11
11
|
var ktsXui = require('kts-xui');
|
|
12
|
-
var
|
|
12
|
+
var classnames = require('classnames');
|
|
13
13
|
var ktsComponentsAntdX4V4 = require('kts-components-antd-x4-v4');
|
|
14
14
|
var ReactDOM = require('react-dom');
|
|
15
15
|
var ktsComponentsAntdX4 = require('kts-components-antd-x4');
|
|
@@ -20,7 +20,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
20
|
|
|
21
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
22
|
var GreyReactBox__default = /*#__PURE__*/_interopDefaultLegacy(GreyReactBox);
|
|
23
|
-
var
|
|
23
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
24
24
|
|
|
25
25
|
function ownKeys(object, enumerableOnly) {
|
|
26
26
|
var keys = Object.keys(object);
|
|
@@ -1140,6 +1140,26 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
1140
1140
|
this.drag = new Drag();
|
|
1141
1141
|
});
|
|
1142
1142
|
|
|
1143
|
+
var FreightListState = /*#__PURE__*/_createClass(function FreightListState() {
|
|
1144
|
+
_classCallCheck(this, FreightListState);
|
|
1145
|
+
|
|
1146
|
+
this.goodMax = void 0;
|
|
1147
|
+
this.editGood = void 0;
|
|
1148
|
+
this.isAddRow = true;
|
|
1149
|
+
this.isRemRow = true;
|
|
1150
|
+
this.goodsMap = new Map();
|
|
1151
|
+
this.form = void 0;
|
|
1152
|
+
this.vehicleTypeList = [];
|
|
1153
|
+
this.goodsList = [];
|
|
1154
|
+
this.selectedGoodIndex = [];
|
|
1155
|
+
this.area = [];
|
|
1156
|
+
this.addressFieldNames = {
|
|
1157
|
+
label: 'label',
|
|
1158
|
+
value: 'value',
|
|
1159
|
+
children: 'children'
|
|
1160
|
+
};
|
|
1161
|
+
});
|
|
1162
|
+
|
|
1143
1163
|
var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
|
|
1144
1164
|
_classCallCheck(this, BuyerState);
|
|
1145
1165
|
|
|
@@ -1231,6 +1251,7 @@ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControlle
|
|
|
1231
1251
|
this.typeModalProps = void 0;
|
|
1232
1252
|
this.autoComplete = new AutoComplete();
|
|
1233
1253
|
this.taxClassificationProps = void 0;
|
|
1254
|
+
this.freightListState = new FreightListState();
|
|
1234
1255
|
});
|
|
1235
1256
|
|
|
1236
1257
|
/**
|
|
@@ -1267,6 +1288,40 @@ var setEditGood = /*#__PURE__*/(function () {
|
|
|
1267
1288
|
};
|
|
1268
1289
|
})();
|
|
1269
1290
|
|
|
1291
|
+
/**
|
|
1292
|
+
* 设置当前的编辑货物运输
|
|
1293
|
+
*/
|
|
1294
|
+
var setEditFreight = /*#__PURE__*/(function () {
|
|
1295
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, newEditGood) {
|
|
1296
|
+
var editGood;
|
|
1297
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1298
|
+
while (1) {
|
|
1299
|
+
switch (_context.prev = _context.next) {
|
|
1300
|
+
case 0:
|
|
1301
|
+
if (newEditGood) {
|
|
1302
|
+
editGood = state.freightListState.editGood;
|
|
1303
|
+
state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
|
|
1304
|
+
editGood: _objectSpread2(_objectSpread2({}, editGood), newEditGood)
|
|
1305
|
+
});
|
|
1306
|
+
} else {
|
|
1307
|
+
state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
|
|
1308
|
+
editGood: undefined
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
case 1:
|
|
1313
|
+
case "end":
|
|
1314
|
+
return _context.stop();
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}, _callee);
|
|
1318
|
+
}));
|
|
1319
|
+
|
|
1320
|
+
return function (_x, _x2) {
|
|
1321
|
+
return _ref.apply(this, arguments);
|
|
1322
|
+
};
|
|
1323
|
+
})();
|
|
1324
|
+
|
|
1270
1325
|
/**
|
|
1271
1326
|
* 设置单个货物属性
|
|
1272
1327
|
*/
|
|
@@ -1305,6 +1360,44 @@ var setGoods = /*#__PURE__*/(function () {
|
|
|
1305
1360
|
};
|
|
1306
1361
|
})();
|
|
1307
1362
|
|
|
1363
|
+
/**
|
|
1364
|
+
* 设置单个货物属性
|
|
1365
|
+
*/
|
|
1366
|
+
var setFreight = /*#__PURE__*/(function () {
|
|
1367
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
|
|
1368
|
+
var goodsList;
|
|
1369
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1370
|
+
while (1) {
|
|
1371
|
+
switch (_context.prev = _context.next) {
|
|
1372
|
+
case 0:
|
|
1373
|
+
if (!(!options || !options.$index)) {
|
|
1374
|
+
_context.next = 2;
|
|
1375
|
+
break;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
return _context.abrupt("return");
|
|
1379
|
+
|
|
1380
|
+
case 2:
|
|
1381
|
+
goodsList = state.freightListState.goodsList.map(function (e) {
|
|
1382
|
+
return e.$index === options.$index ? _objectSpread2(_objectSpread2({}, e), options) : e;
|
|
1383
|
+
});
|
|
1384
|
+
state.freightListState = _objectSpread2(_objectSpread2({}, state.freightListState), {}, {
|
|
1385
|
+
goodsList: goodsList
|
|
1386
|
+
});
|
|
1387
|
+
|
|
1388
|
+
case 4:
|
|
1389
|
+
case "end":
|
|
1390
|
+
return _context.stop();
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
}, _callee);
|
|
1394
|
+
}));
|
|
1395
|
+
|
|
1396
|
+
return function (_x, _x2) {
|
|
1397
|
+
return _ref.apply(this, arguments);
|
|
1398
|
+
};
|
|
1399
|
+
})();
|
|
1400
|
+
|
|
1308
1401
|
/**
|
|
1309
1402
|
* 删除一个货物
|
|
1310
1403
|
*/
|
|
@@ -1389,6 +1482,87 @@ var delGood = /*#__PURE__*/(function () {
|
|
|
1389
1482
|
};
|
|
1390
1483
|
})();
|
|
1391
1484
|
|
|
1485
|
+
/**
|
|
1486
|
+
* 删除一个货物运输
|
|
1487
|
+
*/
|
|
1488
|
+
var delFreight = /*#__PURE__*/(function () {
|
|
1489
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, $index) {
|
|
1490
|
+
var goods, goodsList, goodsMap, i;
|
|
1491
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1492
|
+
while (1) {
|
|
1493
|
+
switch (_context.prev = _context.next) {
|
|
1494
|
+
case 0:
|
|
1495
|
+
if ($index) {
|
|
1496
|
+
_context.next = 2;
|
|
1497
|
+
break;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
return _context.abrupt("return");
|
|
1501
|
+
|
|
1502
|
+
case 2:
|
|
1503
|
+
// 查下要删除的货物
|
|
1504
|
+
goods = state.freightListState.goodsList.filter(function (e) {
|
|
1505
|
+
return e.$index === $index;
|
|
1506
|
+
})[0];
|
|
1507
|
+
|
|
1508
|
+
if (goods) {
|
|
1509
|
+
_context.next = 5;
|
|
1510
|
+
break;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
return _context.abrupt("return");
|
|
1514
|
+
|
|
1515
|
+
case 5:
|
|
1516
|
+
// 如果正在编辑 就取消编辑
|
|
1517
|
+
if (state.freightListState.editGood && state.freightListState.editGood.$index === $index) {
|
|
1518
|
+
state.freightListState.editGood = undefined;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
goodsList = state.freightListState.goodsList;
|
|
1522
|
+
goodsMap = state.freightListState.goodsMap;
|
|
1523
|
+
goodsMap.delete($index);
|
|
1524
|
+
i = 0;
|
|
1525
|
+
|
|
1526
|
+
case 10:
|
|
1527
|
+
if (!(i < goodsList.length)) {
|
|
1528
|
+
_context.next = 17;
|
|
1529
|
+
break;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
if (!(goodsList[i].$index === $index)) {
|
|
1533
|
+
_context.next = 14;
|
|
1534
|
+
break;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
// const good = goodsList[i];
|
|
1538
|
+
// if (good.lineAttribute === LineAttributeType.折扣行 && goodsList[i - 1] && goodsList[i - 1].lineAttribute === LineAttributeType.被折扣行) {
|
|
1539
|
+
// goodsList[i - 1].lineAttribute = LineAttributeType.正常;
|
|
1540
|
+
// }
|
|
1541
|
+
goodsList.splice(i, 1);
|
|
1542
|
+
return _context.abrupt("break", 17);
|
|
1543
|
+
|
|
1544
|
+
case 14:
|
|
1545
|
+
i++;
|
|
1546
|
+
_context.next = 10;
|
|
1547
|
+
break;
|
|
1548
|
+
|
|
1549
|
+
case 17:
|
|
1550
|
+
state.freightListState.goodsList = _toConsumableArray(goodsList);
|
|
1551
|
+
state.freightListState.goodsMap = new Map(goodsMap);
|
|
1552
|
+
|
|
1553
|
+
case 19:
|
|
1554
|
+
case "end":
|
|
1555
|
+
return _context.stop();
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}, _callee);
|
|
1559
|
+
}));
|
|
1560
|
+
|
|
1561
|
+
return function (_x, _x2) {
|
|
1562
|
+
return _ref.apply(this, arguments);
|
|
1563
|
+
};
|
|
1564
|
+
})();
|
|
1565
|
+
|
|
1392
1566
|
var idGenerator = (function () {
|
|
1393
1567
|
return uuid.v4();
|
|
1394
1568
|
});
|
|
@@ -1754,6 +1928,33 @@ var addGood = /*#__PURE__*/(function () {
|
|
|
1754
1928
|
};
|
|
1755
1929
|
})();
|
|
1756
1930
|
|
|
1931
|
+
/**
|
|
1932
|
+
* 添加的编辑货物运输
|
|
1933
|
+
*/
|
|
1934
|
+
|
|
1935
|
+
var addFreight = /*#__PURE__*/(function () {
|
|
1936
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
|
|
1937
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1938
|
+
while (1) {
|
|
1939
|
+
switch (_context.prev = _context.next) {
|
|
1940
|
+
case 0:
|
|
1941
|
+
options.$index = idGenerator();
|
|
1942
|
+
state.freightListState.goodsList = [].concat(_toConsumableArray(state.freightListState.goodsList), [options]);
|
|
1943
|
+
return _context.abrupt("return", options);
|
|
1944
|
+
|
|
1945
|
+
case 3:
|
|
1946
|
+
case "end":
|
|
1947
|
+
return _context.stop();
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
}, _callee);
|
|
1951
|
+
}));
|
|
1952
|
+
|
|
1953
|
+
return function (_x, _x2) {
|
|
1954
|
+
return _ref.apply(this, arguments);
|
|
1955
|
+
};
|
|
1956
|
+
})();
|
|
1957
|
+
|
|
1757
1958
|
/**
|
|
1758
1959
|
* 保存正在编辑的货物
|
|
1759
1960
|
*/
|
|
@@ -1833,6 +2034,85 @@ var validateFields = function validateFields(form) {
|
|
|
1833
2034
|
});
|
|
1834
2035
|
};
|
|
1835
2036
|
|
|
2037
|
+
/**
|
|
2038
|
+
* 保存正在编辑的货物
|
|
2039
|
+
*/
|
|
2040
|
+
var saveEditFreight = /*#__PURE__*/(function () {
|
|
2041
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
|
|
2042
|
+
var editGood, form;
|
|
2043
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2044
|
+
while (1) {
|
|
2045
|
+
switch (_context.prev = _context.next) {
|
|
2046
|
+
case 0:
|
|
2047
|
+
editGood = state.freightListState.editGood;
|
|
2048
|
+
form = state.freightListState.form;
|
|
2049
|
+
|
|
2050
|
+
if (!(!editGood || !form)) {
|
|
2051
|
+
_context.next = 4;
|
|
2052
|
+
break;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
return _context.abrupt("return");
|
|
2056
|
+
|
|
2057
|
+
case 4:
|
|
2058
|
+
_context.next = 6;
|
|
2059
|
+
return validateFields$1(form);
|
|
2060
|
+
|
|
2061
|
+
case 6:
|
|
2062
|
+
if (!_context.sent.err) {
|
|
2063
|
+
_context.next = 8;
|
|
2064
|
+
break;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
return _context.abrupt("return");
|
|
2068
|
+
|
|
2069
|
+
case 8:
|
|
2070
|
+
state.freightListState.goodsList = state.freightListState.goodsList.map(function (e) {
|
|
2071
|
+
return e.$index === editGood.$index ? _objectSpread2(_objectSpread2({}, e), editGood) : e;
|
|
2072
|
+
});
|
|
2073
|
+
state.freightListState.editGood = undefined;
|
|
2074
|
+
|
|
2075
|
+
case 10:
|
|
2076
|
+
case "end":
|
|
2077
|
+
return _context.stop();
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
}, _callee);
|
|
2081
|
+
}));
|
|
2082
|
+
|
|
2083
|
+
return function (_x) {
|
|
2084
|
+
return _ref.apply(this, arguments);
|
|
2085
|
+
};
|
|
2086
|
+
})();
|
|
2087
|
+
|
|
2088
|
+
var validateFields$1 = function validateFields(form) {
|
|
2089
|
+
return new Promise(function (resolve) {
|
|
2090
|
+
form.validateFields( /*#__PURE__*/function () {
|
|
2091
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
|
|
2092
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2093
|
+
while (1) {
|
|
2094
|
+
switch (_context2.prev = _context2.next) {
|
|
2095
|
+
case 0:
|
|
2096
|
+
resolve({
|
|
2097
|
+
err: err,
|
|
2098
|
+
values: values
|
|
2099
|
+
});
|
|
2100
|
+
|
|
2101
|
+
case 1:
|
|
2102
|
+
case "end":
|
|
2103
|
+
return _context2.stop();
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
}, _callee2);
|
|
2107
|
+
}));
|
|
2108
|
+
|
|
2109
|
+
return function (_x2, _x3) {
|
|
2110
|
+
return _ref2.apply(this, arguments);
|
|
2111
|
+
};
|
|
2112
|
+
}());
|
|
2113
|
+
});
|
|
2114
|
+
};
|
|
2115
|
+
|
|
1836
2116
|
/**
|
|
1837
2117
|
* 计算搜索商品
|
|
1838
2118
|
* @param goodsList 被搜索列表
|
|
@@ -9739,10 +10019,15 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
|
|
|
9739
10019
|
_this.updateInvoiceNo = void 0;
|
|
9740
10020
|
_this.getBuyerList = void 0;
|
|
9741
10021
|
_this.setGoods = _this.pipeline(setGoods);
|
|
10022
|
+
_this.setFreight = _this.pipeline(setFreight);
|
|
10023
|
+
_this.setEditFreight = _this.pipeline(setEditFreight);
|
|
9742
10024
|
_this.setEditGood = _this.pipeline(setEditGood);
|
|
9743
10025
|
_this.saveEditGood = _this.pipeline(saveEditGood);
|
|
10026
|
+
_this.saveEditFreight = _this.pipeline(saveEditFreight);
|
|
9744
10027
|
_this.delGood = _this.pipeline(delGood);
|
|
10028
|
+
_this.delFreight = _this.pipeline(delFreight);
|
|
9745
10029
|
_this.addGood = _this.pipeline(addGood);
|
|
10030
|
+
_this.addFreight = _this.pipeline(addFreight);
|
|
9746
10031
|
_this.mergeDetails = _this.pipeline(mergeDetails);
|
|
9747
10032
|
_this.mergeDiscount = _this.pipeline(mergeDiscount);
|
|
9748
10033
|
_this.addGoodDiscount = _this.pipeline(addGoodDiscount);
|
|
@@ -9774,6 +10059,14 @@ function useToGenerateId(controller) {
|
|
|
9774
10059
|
e.serialNo = i + 1;
|
|
9775
10060
|
});
|
|
9776
10061
|
}, [goodsList]);
|
|
10062
|
+
var freightList = controller.useMemo(function (s) {
|
|
10063
|
+
return s.freightListState.goodsList;
|
|
10064
|
+
}, []);
|
|
10065
|
+
React__default['default'].useEffect(function () {
|
|
10066
|
+
freightList.forEach(function (e, i) {
|
|
10067
|
+
e.sortNumber = i + 1;
|
|
10068
|
+
});
|
|
10069
|
+
}, [freightList]);
|
|
9777
10070
|
}
|
|
9778
10071
|
|
|
9779
10072
|
var Nzh = require("nzh");
|
|
@@ -10761,7 +11054,7 @@ function TableRow(props) {
|
|
|
10761
11054
|
bottom: 0
|
|
10762
11055
|
}
|
|
10763
11056
|
})) : /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
10764
|
-
className:
|
|
11057
|
+
className: classnames__default['default'](props.className, discount, expandedRow, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
|
|
10765
11058
|
}));
|
|
10766
11059
|
}
|
|
10767
11060
|
|
|
@@ -12645,8 +12938,8 @@ var Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
12645
12938
|
_React$useContext$pre = _React$useContext.prefixCls,
|
|
12646
12939
|
prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre;
|
|
12647
12940
|
|
|
12648
|
-
var classString =
|
|
12649
|
-
var svgClassString =
|
|
12941
|
+
var classString = classnames__default['default'](prefixCls, className);
|
|
12942
|
+
var svgClassString = classnames__default['default'](_defineProperty$1({}, "".concat(prefixCls, "-spin"), !!spin));
|
|
12650
12943
|
var svgStyle = rotate ? {
|
|
12651
12944
|
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
12652
12945
|
transform: "rotate(".concat(rotate, "deg)")
|
|
@@ -16285,7 +16578,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
16285
16578
|
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton, null), endowCodeButton.button, delRowButton.button, mergeDetails.button, mergeDiscount.button, addDiscountRowButton.drawer, salesDiscount.button, salesGifts.button, /*#__PURE__*/React__default['default'].createElement(Search, null)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16286
16579
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
16287
16580
|
}, props.menuExpansion, /*#__PURE__*/React__default['default'].createElement(DescribeSwitch, null), /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16288
|
-
className:
|
|
16581
|
+
className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
|
|
16289
16582
|
'kts-invoice-operate-prefab': isprefab
|
|
16290
16583
|
})
|
|
16291
16584
|
}, /*#__PURE__*/React__default['default'].createElement(TableVirtual, {
|
|
@@ -17202,7 +17495,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
17202
17495
|
setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
|
|
17203
17496
|
}, [props.isExpand]);
|
|
17204
17497
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17205
|
-
className:
|
|
17498
|
+
className: classnames__default['default']("kts-invoice-operate-invoice-digtal-stakeholder", {
|
|
17206
17499
|
readOnly: readOnly
|
|
17207
17500
|
})
|
|
17208
17501
|
}, /*#__PURE__*/React__default['default'].createElement("div", null, '购买方信息'.split('').map(function (e) {
|
|
@@ -17790,7 +18083,7 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
|
|
|
17790
18083
|
setExpand(typeof props.isExpand === 'boolean' ? props.isExpand : true);
|
|
17791
18084
|
}, [props.isExpand]);
|
|
17792
18085
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17793
|
-
className:
|
|
18086
|
+
className: classnames__default['default']("kts-invoice-operate-invoice-digtal-stakeholder", {
|
|
17794
18087
|
readOnly: readOnly
|
|
17795
18088
|
})
|
|
17796
18089
|
}, /*#__PURE__*/React__default['default'].createElement("div", null, '销售方信息'.split('').map(function (e) {
|
|
@@ -20257,7 +20550,7 @@ function TableRow$1(props) {
|
|
|
20257
20550
|
/*#__PURE__*/
|
|
20258
20551
|
// <tr {...props} className={classnames(props.className, discount, (rowKey === container && current) ? 'kts-invoice-operate-goods-list-itemName-drag-container' : '')} />
|
|
20259
20552
|
React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
20260
|
-
className:
|
|
20553
|
+
className: classnames__default['default'](props.className, discount, rowKey === container && current ? 'kts-invoice-operate-goods-list-itemName-drag-container-' + site : undefined)
|
|
20261
20554
|
}));
|
|
20262
20555
|
}
|
|
20263
20556
|
|
|
@@ -23657,7 +23950,7 @@ var Main$3 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
23657
23950
|
flex: 1
|
|
23658
23951
|
}
|
|
23659
23952
|
}), props.menuExpansion, reselectInvoiceType.button, emptyRefill.button), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
23660
|
-
className:
|
|
23953
|
+
className: classnames__default['default']('kts-invoice-operate-goods-list-table-digtal')
|
|
23661
23954
|
}, /*#__PURE__*/React__default['default'].createElement(TableVirtual$1, {
|
|
23662
23955
|
size: "small",
|
|
23663
23956
|
rowKey: "$index",
|
|
@@ -23924,16 +24217,1572 @@ var MyNY = /*#__PURE__*/function (_React$Component4) {
|
|
|
23924
24217
|
return MyNY;
|
|
23925
24218
|
}(React__default['default'].Component);
|
|
23926
24219
|
|
|
23927
|
-
var
|
|
24220
|
+
var css_248z$s = ".kts-invoice-operate-real-estate-info-digtal {\n padding: 20px;\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-real-estate-info-digtal .real-estate-info-digtal-label {\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-real-estate-info-digtal .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n";
|
|
24221
|
+
styleInject(css_248z$s);
|
|
24222
|
+
|
|
24223
|
+
/** 特殊信息-建筑服务 */
|
|
24224
|
+
|
|
24225
|
+
var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
24226
|
+
/** 控制器 */
|
|
23928
24227
|
var controller = Invoice.useInvoiceController();
|
|
23929
|
-
var
|
|
23930
|
-
|
|
24228
|
+
var form = props.form;
|
|
24229
|
+
var getFieldDecorator = form.getFieldDecorator;
|
|
24230
|
+
var model = controller.useMemo(function (s) {
|
|
24231
|
+
return s.model;
|
|
23931
24232
|
}, []);
|
|
23932
|
-
var
|
|
23933
|
-
return
|
|
23934
|
-
}, []); //
|
|
23935
|
-
|
|
23936
|
-
|
|
24233
|
+
var readOnly = React__default['default'].useMemo(function () {
|
|
24234
|
+
return model === 'readOnly';
|
|
24235
|
+
}, [model]); // 注册 form
|
|
24236
|
+
|
|
24237
|
+
controller.useForm('realEstateInfo', form);
|
|
24238
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24239
|
+
className: "kts-invoice-operate-real-estate-info-digtal"
|
|
24240
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24241
|
+
className: 'real-estate-info-digtal-label'
|
|
24242
|
+
}, "\u7279\u6B8A\u4FE1\u606F-\u5EFA\u7B51\u670D\u52A1"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Row, {
|
|
24243
|
+
gutter: [17, 0]
|
|
24244
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
24245
|
+
span: 6
|
|
24246
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
24247
|
+
label: "\u571F\u5730\u589E\u503C\u7A0E\u9879\u76EE\u7F16\u53F7"
|
|
24248
|
+
}, getFieldDecorator('landNumber', {})(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
|
|
24249
|
+
autoComplete: 'off',
|
|
24250
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
24251
|
+
})))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
24252
|
+
span: 6
|
|
24253
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
24254
|
+
label: "\u8DE8\u5730\uFF08\u5E02\uFF09\u6807\u5FD7"
|
|
24255
|
+
}, getFieldDecorator('crossCitiesSign', {
|
|
24256
|
+
rules: readOnly ? [] : [{
|
|
24257
|
+
required: true,
|
|
24258
|
+
message: '请选择跨地(市)标志'
|
|
24259
|
+
}]
|
|
24260
|
+
})(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyNY$1, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select, {
|
|
24261
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
24262
|
+
style: {
|
|
24263
|
+
width: '100%'
|
|
24264
|
+
}
|
|
24265
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
|
|
24266
|
+
value: 'Y'
|
|
24267
|
+
}, "\u662F"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
|
|
24268
|
+
value: 'N'
|
|
24269
|
+
}, "\u5426"))))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
24270
|
+
span: 6
|
|
24271
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
24272
|
+
label: "\u5EFA\u7B51\u670D\u52A1\u53D1\u751F\u5730"
|
|
24273
|
+
}, getFieldDecorator('constructAddress', {
|
|
24274
|
+
rules: readOnly ? [] : [{
|
|
24275
|
+
required: true,
|
|
24276
|
+
message: '请选择省市区县'
|
|
24277
|
+
}]
|
|
24278
|
+
})(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyArrString$1, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Cascader, {
|
|
24279
|
+
style: {
|
|
24280
|
+
width: '100%'
|
|
24281
|
+
},
|
|
24282
|
+
options: props.addressOptions,
|
|
24283
|
+
fieldNames: props.fieldNames,
|
|
24284
|
+
placeholder: "\u8BF7\u9009\u62E9\u7701\u5E02\u533A\u53BF"
|
|
24285
|
+
})))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
24286
|
+
span: 6
|
|
24287
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
24288
|
+
label: "\u8BE6\u7EC6\u5730\u5740"
|
|
24289
|
+
}, getFieldDecorator('constructDetailAddress', {
|
|
24290
|
+
rules: readOnly ? [] : [{
|
|
24291
|
+
max: 200,
|
|
24292
|
+
message: '详细地址最多200个字符'
|
|
24293
|
+
}]
|
|
24294
|
+
})(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
|
|
24295
|
+
autoComplete: 'off',
|
|
24296
|
+
placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"
|
|
24297
|
+
})))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
24298
|
+
span: 6
|
|
24299
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
24300
|
+
label: "\u5EFA\u7B51\u9879\u76EE\u540D\u79F0"
|
|
24301
|
+
}, getFieldDecorator('constructName', {
|
|
24302
|
+
rules: readOnly ? [] : [{
|
|
24303
|
+
required: true,
|
|
24304
|
+
message: '请输入建筑项目名称'
|
|
24305
|
+
}, {
|
|
24306
|
+
max: 200,
|
|
24307
|
+
message: '建筑项目名称最多200个字符'
|
|
24308
|
+
}]
|
|
24309
|
+
})(readOnly ? /*#__PURE__*/React__default['default'].createElement(MyDiv$4, null) : /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
|
|
24310
|
+
autoComplete: 'off',
|
|
24311
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
24312
|
+
}))))));
|
|
24313
|
+
});
|
|
24314
|
+
|
|
24315
|
+
var MyDiv$4 = /*#__PURE__*/function (_React$Component) {
|
|
24316
|
+
_inherits(MyDiv, _React$Component);
|
|
24317
|
+
|
|
24318
|
+
var _super = _createSuper(MyDiv);
|
|
24319
|
+
|
|
24320
|
+
function MyDiv() {
|
|
24321
|
+
_classCallCheck(this, MyDiv);
|
|
24322
|
+
|
|
24323
|
+
return _super.apply(this, arguments);
|
|
24324
|
+
}
|
|
24325
|
+
|
|
24326
|
+
_createClass(MyDiv, [{
|
|
24327
|
+
key: "render",
|
|
24328
|
+
value: function render() {
|
|
24329
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24330
|
+
style: this.props.style
|
|
24331
|
+
}, this.props.value);
|
|
24332
|
+
}
|
|
24333
|
+
}]);
|
|
24334
|
+
|
|
24335
|
+
return MyDiv;
|
|
24336
|
+
}(React__default['default'].Component);
|
|
24337
|
+
|
|
24338
|
+
var MyArrString$1 = /*#__PURE__*/function (_React$Component2) {
|
|
24339
|
+
_inherits(MyArrString, _React$Component2);
|
|
24340
|
+
|
|
24341
|
+
var _super2 = _createSuper(MyArrString);
|
|
24342
|
+
|
|
24343
|
+
function MyArrString() {
|
|
24344
|
+
_classCallCheck(this, MyArrString);
|
|
24345
|
+
|
|
24346
|
+
return _super2.apply(this, arguments);
|
|
24347
|
+
}
|
|
24348
|
+
|
|
24349
|
+
_createClass(MyArrString, [{
|
|
24350
|
+
key: "render",
|
|
24351
|
+
value: function render() {
|
|
24352
|
+
var _this$props$value;
|
|
24353
|
+
|
|
24354
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24355
|
+
style: this.props.style
|
|
24356
|
+
}, (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (e) {
|
|
24357
|
+
return !!e;
|
|
24358
|
+
}).join(','));
|
|
24359
|
+
}
|
|
24360
|
+
}]);
|
|
24361
|
+
|
|
24362
|
+
return MyArrString;
|
|
24363
|
+
}(React__default['default'].Component);
|
|
24364
|
+
|
|
24365
|
+
var MyArrMoment$1 = /*#__PURE__*/function (_React$Component3) {
|
|
24366
|
+
_inherits(MyArrMoment, _React$Component3);
|
|
24367
|
+
|
|
24368
|
+
var _super3 = _createSuper(MyArrMoment);
|
|
24369
|
+
|
|
24370
|
+
function MyArrMoment() {
|
|
24371
|
+
_classCallCheck(this, MyArrMoment);
|
|
24372
|
+
|
|
24373
|
+
return _super3.apply(this, arguments);
|
|
24374
|
+
}
|
|
24375
|
+
|
|
24376
|
+
_createClass(MyArrMoment, [{
|
|
24377
|
+
key: "render",
|
|
24378
|
+
value: function render() {
|
|
24379
|
+
var _this$props$value2 = this.props.value,
|
|
24380
|
+
value = _this$props$value2 === void 0 ? [] : _this$props$value2;
|
|
24381
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24382
|
+
style: this.props.style
|
|
24383
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[0]) && value[0].format('YYYY-MM-DD')), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24384
|
+
style: {
|
|
24385
|
+
color: '#9F603D',
|
|
24386
|
+
fontWeight: 600
|
|
24387
|
+
}
|
|
24388
|
+
}, " - "), /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[1]) && value[0].format('YYYY-MM-DD')));
|
|
24389
|
+
}
|
|
24390
|
+
}]);
|
|
24391
|
+
|
|
24392
|
+
return MyArrMoment;
|
|
24393
|
+
}(React__default['default'].Component);
|
|
24394
|
+
|
|
24395
|
+
var MyNY$1 = /*#__PURE__*/function (_React$Component4) {
|
|
24396
|
+
_inherits(MyNY, _React$Component4);
|
|
24397
|
+
|
|
24398
|
+
var _super4 = _createSuper(MyNY);
|
|
24399
|
+
|
|
24400
|
+
function MyNY() {
|
|
24401
|
+
_classCallCheck(this, MyNY);
|
|
24402
|
+
|
|
24403
|
+
return _super4.apply(this, arguments);
|
|
24404
|
+
}
|
|
24405
|
+
|
|
24406
|
+
_createClass(MyNY, [{
|
|
24407
|
+
key: "render",
|
|
24408
|
+
value: function render() {
|
|
24409
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24410
|
+
style: this.props.style
|
|
24411
|
+
}, this.props.value === 'Y' ? '是' : '否');
|
|
24412
|
+
}
|
|
24413
|
+
}]);
|
|
24414
|
+
|
|
24415
|
+
return MyNY;
|
|
24416
|
+
}(React__default['default'].Component);
|
|
24417
|
+
|
|
24418
|
+
var css_248z$t = ".kts-invoice-operate-goods-table-virtual .ktsAntX-table-body {\n height: 280px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-header > table > thead > tr > th {\n padding: 0 10px;\n height: 32px;\n background: #f4f4f4;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table.ktsAntX-table-bordered > .ktsAntX-table-container > .ktsAntX-table-body > table > tbody > tr > td {\n padding: 0;\n height: 32px;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-body > table {\n position: absolute;\n left: 0;\n top: 0;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-table .ktsAntX-table-tbody {\n position: relative;\n}\n.kts-invoice-operate-goods-table-virtual .ktsAntX-checkbox-wrapper .ktsAntX-checkbox-inner {\n width: 16px;\n height: 16px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n top: 1px;\n}\n";
|
|
24419
|
+
styleInject(css_248z$t);
|
|
24420
|
+
|
|
24421
|
+
function TableVirtual$2 (props) {
|
|
24422
|
+
var _props$dataSource2;
|
|
24423
|
+
|
|
24424
|
+
var _React$useState = React__default['default'].useState(null),
|
|
24425
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24426
|
+
self = _React$useState2[0],
|
|
24427
|
+
setSelf = _React$useState2[1];
|
|
24428
|
+
|
|
24429
|
+
var tableBody = React__default['default'].useMemo(function () {
|
|
24430
|
+
if (!self) return;
|
|
24431
|
+
return self.querySelector('.ktsAntX-table-body');
|
|
24432
|
+
}, [self]);
|
|
24433
|
+
/** 显示指针 */
|
|
24434
|
+
|
|
24435
|
+
var _React$useState3 = React__default['default'].useState(0),
|
|
24436
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
24437
|
+
pointer = _React$useState4[0],
|
|
24438
|
+
setPointer = _React$useState4[1];
|
|
24439
|
+
/** 行高 */
|
|
24440
|
+
|
|
24441
|
+
|
|
24442
|
+
var rowHeight = React__default['default'].useMemo(function () {
|
|
24443
|
+
if (!self) return 50;
|
|
24444
|
+
var td = self.querySelector('.ktsAntX-table-tbody .ktsAntX-table-row');
|
|
24445
|
+
if (!td) return 50;
|
|
24446
|
+
return td.clientHeight;
|
|
24447
|
+
}, [self, props.dataSource]);
|
|
24448
|
+
/** 间隔容器 */
|
|
24449
|
+
|
|
24450
|
+
var placeholder = React__default['default'].useMemo(function () {
|
|
24451
|
+
if (!self || !tableBody) return;
|
|
24452
|
+
var placeholder = tableBody.querySelector('.table-virtual-placeholder');
|
|
24453
|
+
|
|
24454
|
+
if (!placeholder) {
|
|
24455
|
+
placeholder = document.createElement('div');
|
|
24456
|
+
placeholder.className = 'table-virtual-placeholder';
|
|
24457
|
+
tableBody.appendChild(placeholder);
|
|
24458
|
+
}
|
|
24459
|
+
|
|
24460
|
+
return placeholder;
|
|
24461
|
+
}, [self, tableBody]); // 设置占位dom的搞
|
|
24462
|
+
|
|
24463
|
+
var placeholderHeight = React__default['default'].useMemo(function () {
|
|
24464
|
+
if (!self || !rowHeight || !props.dataSource || !placeholder) return;
|
|
24465
|
+
var placeholderHeight = rowHeight * props.dataSource.length;
|
|
24466
|
+
placeholder.style.height = "".concat(placeholderHeight, "px");
|
|
24467
|
+
return placeholderHeight;
|
|
24468
|
+
}, [self, rowHeight, props.dataSource, placeholder]);
|
|
24469
|
+
/** 可以容纳的行数 */
|
|
24470
|
+
|
|
24471
|
+
var rowSize = React__default['default'].useMemo(function () {
|
|
24472
|
+
if (!tableBody || !rowHeight) return 0;
|
|
24473
|
+
return Math.ceil(tableBody.clientHeight / rowHeight);
|
|
24474
|
+
}, [tableBody, rowHeight, placeholderHeight]); // 计算渲染的行
|
|
24475
|
+
|
|
24476
|
+
var dataSource = React__default['default'].useMemo(function () {
|
|
24477
|
+
var _props$dataSource;
|
|
24478
|
+
|
|
24479
|
+
if (!props.dataSource) return [];
|
|
24480
|
+
if (props.dataSource.length < 10) return props.dataSource;
|
|
24481
|
+
if (!rowSize) return [props.dataSource[0]];
|
|
24482
|
+
return (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.slice(pointer, pointer + 2 * rowSize);
|
|
24483
|
+
}, [props.dataSource, pointer, rowSize]); // 监听滚动
|
|
24484
|
+
|
|
24485
|
+
React__default['default'].useEffect(function () {
|
|
24486
|
+
if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody || props.dataSource.length < 10) return;
|
|
24487
|
+
|
|
24488
|
+
var onScroll = function onScroll() {
|
|
24489
|
+
if (!props.dataSource || !tableBody) return;
|
|
24490
|
+
setPointer(Math.floor((props.dataSource.length - rowSize) * (tableBody.scrollTop / (placeholder.clientHeight - tableBody.clientHeight))));
|
|
24491
|
+
};
|
|
24492
|
+
|
|
24493
|
+
onScroll();
|
|
24494
|
+
tableBody.addEventListener('scroll', onScroll);
|
|
24495
|
+
return function () {
|
|
24496
|
+
tableBody.removeEventListener('scroll', onScroll);
|
|
24497
|
+
};
|
|
24498
|
+
}, [self, placeholder, props.dataSource, rowHeight, rowSize]); // 移动列表
|
|
24499
|
+
|
|
24500
|
+
React__default['default'].useEffect(function () {
|
|
24501
|
+
if (!self) return;
|
|
24502
|
+
var table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table');
|
|
24503
|
+
if (!table) return;
|
|
24504
|
+
table.style.top = "".concat(pointer * rowHeight, "px");
|
|
24505
|
+
}, [pointer, self, rowHeight]);
|
|
24506
|
+
React__default['default'].useEffect(function () {
|
|
24507
|
+
if (!self) return;
|
|
24508
|
+
var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
|
|
24509
|
+
if (!cont) return;
|
|
24510
|
+
cont.scrollTop = 0;
|
|
24511
|
+
}, [(_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.length]);
|
|
24512
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24513
|
+
className: "kts-invoice-operate-goods-table-virtual",
|
|
24514
|
+
ref: function ref(e) {
|
|
24515
|
+
setSelf(e);
|
|
24516
|
+
}
|
|
24517
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsXui.TableManual, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
24518
|
+
dataSource: dataSource,
|
|
24519
|
+
// 新版本Table会有输入框无法连续输入的问题,先兼容老版本
|
|
24520
|
+
tableComponent: ktsComponentsAntdX4V4.Table
|
|
24521
|
+
})));
|
|
24522
|
+
}
|
|
24523
|
+
|
|
24524
|
+
var AddRowButton$2 = (function () {
|
|
24525
|
+
var controller = Invoice.useInvoiceController();
|
|
24526
|
+
var model = controller.useMemo(function (s) {
|
|
24527
|
+
return s.model;
|
|
24528
|
+
}, []);
|
|
24529
|
+
var rootElement = controller.useMemo(function (s) {
|
|
24530
|
+
return s.rootElement;
|
|
24531
|
+
}, []);
|
|
24532
|
+
/** 产品数据量 */
|
|
24533
|
+
|
|
24534
|
+
var goodsNum = controller.useMemo(function (s) {
|
|
24535
|
+
return s.freightListState.goodsList.length;
|
|
24536
|
+
}, []);
|
|
24537
|
+
/** 搜索条件 */
|
|
24538
|
+
|
|
24539
|
+
var isAddRow = controller.useMemo(function (s) {
|
|
24540
|
+
return s.freightListState.isAddRow;
|
|
24541
|
+
}, []);
|
|
24542
|
+
/** 产品最大数 */
|
|
24543
|
+
|
|
24544
|
+
var goodMax = controller.useMemo(function (s) {
|
|
24545
|
+
return s.freightListState.goodMax;
|
|
24546
|
+
}, []);
|
|
24547
|
+
/** 按钮是否禁用 */
|
|
24548
|
+
|
|
24549
|
+
var disabled = React__default['default'].useMemo(function () {
|
|
24550
|
+
return typeof goodMax === 'number' ? goodsNum >= goodMax : false;
|
|
24551
|
+
}, [goodMax, goodsNum]);
|
|
24552
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
24553
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
24554
|
+
while (1) {
|
|
24555
|
+
switch (_context.prev = _context.next) {
|
|
24556
|
+
case 0:
|
|
24557
|
+
_context.next = 2;
|
|
24558
|
+
return addGood$3(controller);
|
|
24559
|
+
|
|
24560
|
+
case 2:
|
|
24561
|
+
_context.next = 4;
|
|
24562
|
+
return rollBottom$2(controller, rootElement);
|
|
24563
|
+
|
|
24564
|
+
case 4:
|
|
24565
|
+
case "end":
|
|
24566
|
+
return _context.stop();
|
|
24567
|
+
}
|
|
24568
|
+
}
|
|
24569
|
+
}, _callee);
|
|
24570
|
+
})), [controller, rootElement]);
|
|
24571
|
+
if (isAddRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
24572
|
+
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
24573
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
24574
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
24575
|
+
size: 'small',
|
|
24576
|
+
type: 'primary',
|
|
24577
|
+
onClick: onClick,
|
|
24578
|
+
disabled: disabled
|
|
24579
|
+
}, "\u589E\u884C");
|
|
24580
|
+
});
|
|
24581
|
+
/** 添加一个空货物 */
|
|
24582
|
+
|
|
24583
|
+
function addGood$3(_x) {
|
|
24584
|
+
return _addGood$2.apply(this, arguments);
|
|
24585
|
+
}
|
|
24586
|
+
/** 货物列表,滚动到底部 */
|
|
24587
|
+
|
|
24588
|
+
|
|
24589
|
+
function _addGood$2() {
|
|
24590
|
+
_addGood$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(controller) {
|
|
24591
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
24592
|
+
while (1) {
|
|
24593
|
+
switch (_context3.prev = _context3.next) {
|
|
24594
|
+
case 0:
|
|
24595
|
+
_context3.next = 2;
|
|
24596
|
+
return controller.saveEditFreight();
|
|
24597
|
+
|
|
24598
|
+
case 2:
|
|
24599
|
+
_context3.next = 4;
|
|
24600
|
+
return controller.wait();
|
|
24601
|
+
|
|
24602
|
+
case 4:
|
|
24603
|
+
_context3.next = 6;
|
|
24604
|
+
return controller.run( /*#__PURE__*/function () {
|
|
24605
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
24606
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
24607
|
+
while (1) {
|
|
24608
|
+
switch (_context2.prev = _context2.next) {
|
|
24609
|
+
case 0:
|
|
24610
|
+
if (!s.freightListState.editGood) {
|
|
24611
|
+
_context2.next = 3;
|
|
24612
|
+
break;
|
|
24613
|
+
}
|
|
24614
|
+
|
|
24615
|
+
ktsXui.message.error({
|
|
24616
|
+
content: '你正在编辑一个货物运输行',
|
|
24617
|
+
key: '你正在编辑一个货物运输行'
|
|
24618
|
+
});
|
|
24619
|
+
return _context2.abrupt("return");
|
|
24620
|
+
|
|
24621
|
+
case 3:
|
|
24622
|
+
_context2.next = 5;
|
|
24623
|
+
return controller.addFreight({});
|
|
24624
|
+
|
|
24625
|
+
case 5:
|
|
24626
|
+
s.freightListState.editGood = _context2.sent;
|
|
24627
|
+
|
|
24628
|
+
case 6:
|
|
24629
|
+
case "end":
|
|
24630
|
+
return _context2.stop();
|
|
24631
|
+
}
|
|
24632
|
+
}
|
|
24633
|
+
}, _callee2);
|
|
24634
|
+
}));
|
|
24635
|
+
|
|
24636
|
+
return function (_x4) {
|
|
24637
|
+
return _ref2.apply(this, arguments);
|
|
24638
|
+
};
|
|
24639
|
+
}());
|
|
24640
|
+
|
|
24641
|
+
case 6:
|
|
24642
|
+
case "end":
|
|
24643
|
+
return _context3.stop();
|
|
24644
|
+
}
|
|
24645
|
+
}
|
|
24646
|
+
}, _callee3);
|
|
24647
|
+
}));
|
|
24648
|
+
return _addGood$2.apply(this, arguments);
|
|
24649
|
+
}
|
|
24650
|
+
|
|
24651
|
+
function rollBottom$2(_x2, _x3) {
|
|
24652
|
+
return _rollBottom$2.apply(this, arguments);
|
|
24653
|
+
}
|
|
24654
|
+
|
|
24655
|
+
function _rollBottom$2() {
|
|
24656
|
+
_rollBottom$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller, rootElement) {
|
|
24657
|
+
var cont;
|
|
24658
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
24659
|
+
while (1) {
|
|
24660
|
+
switch (_context4.prev = _context4.next) {
|
|
24661
|
+
case 0:
|
|
24662
|
+
_context4.next = 2;
|
|
24663
|
+
return controller.wait();
|
|
24664
|
+
|
|
24665
|
+
case 2:
|
|
24666
|
+
cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
|
|
24667
|
+
|
|
24668
|
+
if (cont) {
|
|
24669
|
+
_context4.next = 5;
|
|
24670
|
+
break;
|
|
24671
|
+
}
|
|
24672
|
+
|
|
24673
|
+
return _context4.abrupt("return");
|
|
24674
|
+
|
|
24675
|
+
case 5:
|
|
24676
|
+
cont.scrollTop = cont.scrollHeight;
|
|
24677
|
+
|
|
24678
|
+
case 6:
|
|
24679
|
+
case "end":
|
|
24680
|
+
return _context4.stop();
|
|
24681
|
+
}
|
|
24682
|
+
}
|
|
24683
|
+
}, _callee4);
|
|
24684
|
+
}));
|
|
24685
|
+
return _rollBottom$2.apply(this, arguments);
|
|
24686
|
+
}
|
|
24687
|
+
|
|
24688
|
+
var css_248z$u = ".kts-invoice-operate-goods-list-itemName-drag-container-u {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-u::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 9999;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d {\n position: relative;\n}\n.kts-invoice-operate-goods-list-itemName-drag-container-d::after {\n content: \" \";\n width: 100%;\n height: 2px;\n background: #0074ff;\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 9999;\n}\n";
|
|
24689
|
+
styleInject(css_248z$u);
|
|
24690
|
+
|
|
24691
|
+
function TableRow$2(props) {
|
|
24692
|
+
var rowKey = props['data-row-key'];
|
|
24693
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
24694
|
+
className: classnames__default['default'](props.className)
|
|
24695
|
+
}));
|
|
24696
|
+
}
|
|
24697
|
+
|
|
24698
|
+
var Text$6 = ktsComponentsAntdX3.Typography.Text;
|
|
24699
|
+
var TitleText$2 = (function (props) {
|
|
24700
|
+
var rules = props.rules,
|
|
24701
|
+
children = props.children;
|
|
24702
|
+
var required = React__default['default'].useMemo(function () {
|
|
24703
|
+
return (rules === null || rules === void 0 ? void 0 : rules.some(function (e) {
|
|
24704
|
+
return !!e.required;
|
|
24705
|
+
})) || props.required;
|
|
24706
|
+
}, [rules, props.required]);
|
|
24707
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, required ? /*#__PURE__*/React__default['default'].createElement(Text$6, {
|
|
24708
|
+
type: "danger"
|
|
24709
|
+
}, "*") : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null), children);
|
|
24710
|
+
});
|
|
24711
|
+
|
|
24712
|
+
var useColumns$2 = (function (form) {
|
|
24713
|
+
var getFieldDecorator = form.getFieldDecorator;
|
|
24714
|
+
var controller = Invoice.useInvoiceController();
|
|
24715
|
+
var rootElement = controller.useMemo(function (s) {
|
|
24716
|
+
return s.rootElement;
|
|
24717
|
+
}, []);
|
|
24718
|
+
/** 组件模式 */
|
|
24719
|
+
|
|
24720
|
+
var model = controller.useMemo(function (e) {
|
|
24721
|
+
return e.model;
|
|
24722
|
+
}, []);
|
|
24723
|
+
/** 正在编辑的货物 */
|
|
24724
|
+
|
|
24725
|
+
var editGood = controller.useMemo(function (e) {
|
|
24726
|
+
return e.freightListState.editGood;
|
|
24727
|
+
}, []);
|
|
24728
|
+
/** 禁用字段 */
|
|
24729
|
+
|
|
24730
|
+
var disableds = controller.useMemo(function (e) {
|
|
24731
|
+
return e.stakeholder.disableds || [];
|
|
24732
|
+
}, []);
|
|
24733
|
+
/** 运输工具种类列表 */
|
|
24734
|
+
|
|
24735
|
+
var vehicleTypeList = controller.useMemo(function (e) {
|
|
24736
|
+
return e.freightListState.vehicleTypeList;
|
|
24737
|
+
}, []);
|
|
24738
|
+
var area = controller.useMemo(function (e) {
|
|
24739
|
+
return e.freightListState.area;
|
|
24740
|
+
}, []);
|
|
24741
|
+
var addressFieldNames = controller.useMemo(function (e) {
|
|
24742
|
+
return e.freightListState.addressFieldNames;
|
|
24743
|
+
}, []);
|
|
24744
|
+
var getVehicle = React__default['default'].useCallback(function (value) {
|
|
24745
|
+
if (vehicleTypeList && vehicleTypeList.length > 0) {
|
|
24746
|
+
var _vehicleTypeList$find;
|
|
24747
|
+
|
|
24748
|
+
return ((_vehicleTypeList$find = vehicleTypeList.find(function (e) {
|
|
24749
|
+
return e.value === value;
|
|
24750
|
+
})) === null || _vehicleTypeList$find === void 0 ? void 0 : _vehicleTypeList$find.label) || '';
|
|
24751
|
+
}
|
|
24752
|
+
}, [vehicleTypeList]);
|
|
24753
|
+
var splitArea = React__default['default'].useCallback(function (value) {
|
|
24754
|
+
if (value) {
|
|
24755
|
+
var _array = value.split(',');
|
|
24756
|
+
|
|
24757
|
+
return _array;
|
|
24758
|
+
} else {
|
|
24759
|
+
return [];
|
|
24760
|
+
}
|
|
24761
|
+
}, []);
|
|
24762
|
+
/** 表头 */
|
|
24763
|
+
|
|
24764
|
+
var columns = React__default['default'].useMemo(function () {
|
|
24765
|
+
return [{
|
|
24766
|
+
title: '序号',
|
|
24767
|
+
key: 'sortNumber',
|
|
24768
|
+
dataIndex: 'sortNumber',
|
|
24769
|
+
width: 50,
|
|
24770
|
+
render: function render(e) {
|
|
24771
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24772
|
+
style: {
|
|
24773
|
+
padding: '0 10px'
|
|
24774
|
+
}
|
|
24775
|
+
}, e);
|
|
24776
|
+
}
|
|
24777
|
+
}, {
|
|
24778
|
+
title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
|
|
24779
|
+
required: true
|
|
24780
|
+
}, "\u8FD0\u8F93\u5DE5\u5177\u79CD\u7C7B"),
|
|
24781
|
+
key: 'type',
|
|
24782
|
+
render: function render(_, record) {
|
|
24783
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('type') && !(model === 'prefab')) {
|
|
24784
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('type', {
|
|
24785
|
+
initialValue: editGood.type,
|
|
24786
|
+
rules: [{
|
|
24787
|
+
required: true,
|
|
24788
|
+
message: '请输入'
|
|
24789
|
+
}]
|
|
24790
|
+
})( /*#__PURE__*/React__default['default'].createElement(ktsXui.Select, {
|
|
24791
|
+
className: "kts-invoice-operate-goods-list-table-tax-rate",
|
|
24792
|
+
showArrow: false,
|
|
24793
|
+
style: {
|
|
24794
|
+
width: '100%'
|
|
24795
|
+
},
|
|
24796
|
+
getPopupContainer: function getPopupContainer() {
|
|
24797
|
+
return rootElement || document.body;
|
|
24798
|
+
},
|
|
24799
|
+
onChange: function () {
|
|
24800
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
|
24801
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
24802
|
+
while (1) {
|
|
24803
|
+
switch (_context.prev = _context.next) {
|
|
24804
|
+
case 0:
|
|
24805
|
+
_context.next = 2;
|
|
24806
|
+
return controller.wait();
|
|
24807
|
+
|
|
24808
|
+
case 2:
|
|
24809
|
+
controller.setEditFreight({
|
|
24810
|
+
type: value
|
|
24811
|
+
});
|
|
24812
|
+
|
|
24813
|
+
case 3:
|
|
24814
|
+
case "end":
|
|
24815
|
+
return _context.stop();
|
|
24816
|
+
}
|
|
24817
|
+
}
|
|
24818
|
+
}, _callee);
|
|
24819
|
+
}));
|
|
24820
|
+
|
|
24821
|
+
function onChange(_x) {
|
|
24822
|
+
return _onChange.apply(this, arguments);
|
|
24823
|
+
}
|
|
24824
|
+
|
|
24825
|
+
return onChange;
|
|
24826
|
+
}()
|
|
24827
|
+
}, (record.vehicleList || vehicleTypeList).map(function (e, i) {
|
|
24828
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Select.Option, {
|
|
24829
|
+
key: i,
|
|
24830
|
+
value: e.value
|
|
24831
|
+
}, e.label);
|
|
24832
|
+
}))));
|
|
24833
|
+
} else {
|
|
24834
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24835
|
+
style: {
|
|
24836
|
+
padding: '0 10px'
|
|
24837
|
+
}
|
|
24838
|
+
}, getVehicle(record.type));
|
|
24839
|
+
}
|
|
24840
|
+
}
|
|
24841
|
+
}, {
|
|
24842
|
+
title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
|
|
24843
|
+
required: true
|
|
24844
|
+
}, "\u8FD0\u8F93\u5DE5\u5177\u724C\u53F7"),
|
|
24845
|
+
key: 'licensePlate',
|
|
24846
|
+
width: 119,
|
|
24847
|
+
render: function render(_, record) {
|
|
24848
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('licensePlate') && model !== 'prefab') {
|
|
24849
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('licensePlate', {
|
|
24850
|
+
initialValue: editGood.licensePlate,
|
|
24851
|
+
rules: [{
|
|
24852
|
+
required: true,
|
|
24853
|
+
message: '请输入'
|
|
24854
|
+
}]
|
|
24855
|
+
})( /*#__PURE__*/React__default['default'].createElement(MyInput$4, {
|
|
24856
|
+
maxLength: 200,
|
|
24857
|
+
onChange: function () {
|
|
24858
|
+
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
24859
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
24860
|
+
while (1) {
|
|
24861
|
+
switch (_context2.prev = _context2.next) {
|
|
24862
|
+
case 0:
|
|
24863
|
+
_context2.next = 2;
|
|
24864
|
+
return controller.wait();
|
|
24865
|
+
|
|
24866
|
+
case 2:
|
|
24867
|
+
_context2.next = 4;
|
|
24868
|
+
return controller.setEditFreight({
|
|
24869
|
+
licensePlate: form.getFieldsValue().licensePlate
|
|
24870
|
+
});
|
|
24871
|
+
|
|
24872
|
+
case 4:
|
|
24873
|
+
case "end":
|
|
24874
|
+
return _context2.stop();
|
|
24875
|
+
}
|
|
24876
|
+
}
|
|
24877
|
+
}, _callee2);
|
|
24878
|
+
}));
|
|
24879
|
+
|
|
24880
|
+
function onChange() {
|
|
24881
|
+
return _onChange2.apply(this, arguments);
|
|
24882
|
+
}
|
|
24883
|
+
|
|
24884
|
+
return onChange;
|
|
24885
|
+
}()
|
|
24886
|
+
})));
|
|
24887
|
+
} else {
|
|
24888
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24889
|
+
style: {
|
|
24890
|
+
padding: '0 10px'
|
|
24891
|
+
}
|
|
24892
|
+
}, record.licensePlate);
|
|
24893
|
+
}
|
|
24894
|
+
}
|
|
24895
|
+
}, {
|
|
24896
|
+
title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
|
|
24897
|
+
required: true
|
|
24898
|
+
}, "\u8D77\u8FD0\u5730"),
|
|
24899
|
+
key: 'origin',
|
|
24900
|
+
width: 150,
|
|
24901
|
+
render: function render(_, record) {
|
|
24902
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('origin') && model !== 'prefab') {
|
|
24903
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('origin', {
|
|
24904
|
+
initialValue: editGood.origin,
|
|
24905
|
+
rules: [{
|
|
24906
|
+
required: true,
|
|
24907
|
+
message: '请输入'
|
|
24908
|
+
}]
|
|
24909
|
+
})( /*#__PURE__*/React__default['default'].createElement(ktsXui.Cascader, {
|
|
24910
|
+
style: {
|
|
24911
|
+
width: '100%'
|
|
24912
|
+
},
|
|
24913
|
+
options: area,
|
|
24914
|
+
fieldNames: addressFieldNames,
|
|
24915
|
+
onChange: function () {
|
|
24916
|
+
var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {
|
|
24917
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
24918
|
+
while (1) {
|
|
24919
|
+
switch (_context3.prev = _context3.next) {
|
|
24920
|
+
case 0:
|
|
24921
|
+
_context3.next = 2;
|
|
24922
|
+
return controller.setEditFreight({
|
|
24923
|
+
origin: value
|
|
24924
|
+
});
|
|
24925
|
+
|
|
24926
|
+
case 2:
|
|
24927
|
+
case "end":
|
|
24928
|
+
return _context3.stop();
|
|
24929
|
+
}
|
|
24930
|
+
}
|
|
24931
|
+
}, _callee3);
|
|
24932
|
+
}));
|
|
24933
|
+
|
|
24934
|
+
function onChange(_x2) {
|
|
24935
|
+
return _onChange3.apply(this, arguments);
|
|
24936
|
+
}
|
|
24937
|
+
|
|
24938
|
+
return onChange;
|
|
24939
|
+
}()
|
|
24940
|
+
})));
|
|
24941
|
+
} else {
|
|
24942
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24943
|
+
style: {
|
|
24944
|
+
padding: '0 10px'
|
|
24945
|
+
}
|
|
24946
|
+
}, record.origin);
|
|
24947
|
+
}
|
|
24948
|
+
}
|
|
24949
|
+
}, {
|
|
24950
|
+
title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
|
|
24951
|
+
required: true
|
|
24952
|
+
}, "\u5230\u8FBE\u5730"),
|
|
24953
|
+
dataIndex: 'destination',
|
|
24954
|
+
key: 'destination',
|
|
24955
|
+
width: 149,
|
|
24956
|
+
render: function render(_, record) {
|
|
24957
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('destination') && model !== 'prefab') {
|
|
24958
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('destination', {
|
|
24959
|
+
initialValue: editGood.destination,
|
|
24960
|
+
rules: [{
|
|
24961
|
+
required: true,
|
|
24962
|
+
message: '请输入'
|
|
24963
|
+
}]
|
|
24964
|
+
})( /*#__PURE__*/React__default['default'].createElement(ktsXui.Cascader, {
|
|
24965
|
+
options: area,
|
|
24966
|
+
fieldNames: addressFieldNames,
|
|
24967
|
+
style: {
|
|
24968
|
+
width: '100%'
|
|
24969
|
+
},
|
|
24970
|
+
onChange: function () {
|
|
24971
|
+
var _onChange4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(value) {
|
|
24972
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
24973
|
+
while (1) {
|
|
24974
|
+
switch (_context4.prev = _context4.next) {
|
|
24975
|
+
case 0:
|
|
24976
|
+
_context4.next = 2;
|
|
24977
|
+
return controller.setEditFreight({
|
|
24978
|
+
destination: value
|
|
24979
|
+
});
|
|
24980
|
+
|
|
24981
|
+
case 2:
|
|
24982
|
+
case "end":
|
|
24983
|
+
return _context4.stop();
|
|
24984
|
+
}
|
|
24985
|
+
}
|
|
24986
|
+
}, _callee4);
|
|
24987
|
+
}));
|
|
24988
|
+
|
|
24989
|
+
function onChange(_x3) {
|
|
24990
|
+
return _onChange4.apply(this, arguments);
|
|
24991
|
+
}
|
|
24992
|
+
|
|
24993
|
+
return onChange;
|
|
24994
|
+
}()
|
|
24995
|
+
})));
|
|
24996
|
+
} else {
|
|
24997
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24998
|
+
style: {
|
|
24999
|
+
padding: '0 10px'
|
|
25000
|
+
}
|
|
25001
|
+
}, record.destination);
|
|
25002
|
+
}
|
|
25003
|
+
}
|
|
25004
|
+
}, {
|
|
25005
|
+
title: /*#__PURE__*/React__default['default'].createElement(TitleText$2, {
|
|
25006
|
+
required: true
|
|
25007
|
+
}, "\u8FD0\u8F93\u8D27\u7269\u540D\u79F0"),
|
|
25008
|
+
dataIndex: 'itemName',
|
|
25009
|
+
key: 'itemName',
|
|
25010
|
+
width: 149,
|
|
25011
|
+
render: function render(_, record) {
|
|
25012
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('itemName') && model !== 'prefab') {
|
|
25013
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemName', {
|
|
25014
|
+
initialValue: editGood.itemName,
|
|
25015
|
+
rules: [{
|
|
25016
|
+
required: true,
|
|
25017
|
+
message: '请输入货物名称'
|
|
25018
|
+
}]
|
|
25019
|
+
})( /*#__PURE__*/React__default['default'].createElement(MyInput$4, {
|
|
25020
|
+
maxLength: 200,
|
|
25021
|
+
onChange: function () {
|
|
25022
|
+
var _onChange5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
25023
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
25024
|
+
while (1) {
|
|
25025
|
+
switch (_context5.prev = _context5.next) {
|
|
25026
|
+
case 0:
|
|
25027
|
+
_context5.next = 2;
|
|
25028
|
+
return controller.wait();
|
|
25029
|
+
|
|
25030
|
+
case 2:
|
|
25031
|
+
_context5.next = 4;
|
|
25032
|
+
return controller.setEditFreight({
|
|
25033
|
+
itemName: form.getFieldsValue().itemName
|
|
25034
|
+
});
|
|
25035
|
+
|
|
25036
|
+
case 4:
|
|
25037
|
+
case "end":
|
|
25038
|
+
return _context5.stop();
|
|
25039
|
+
}
|
|
25040
|
+
}
|
|
25041
|
+
}, _callee5);
|
|
25042
|
+
}));
|
|
25043
|
+
|
|
25044
|
+
function onChange() {
|
|
25045
|
+
return _onChange5.apply(this, arguments);
|
|
25046
|
+
}
|
|
25047
|
+
|
|
25048
|
+
return onChange;
|
|
25049
|
+
}()
|
|
25050
|
+
})));
|
|
25051
|
+
} else {
|
|
25052
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
25053
|
+
style: {
|
|
25054
|
+
padding: '0 10px'
|
|
25055
|
+
}
|
|
25056
|
+
}, record.itemName);
|
|
25057
|
+
}
|
|
25058
|
+
}
|
|
25059
|
+
}] // 只读
|
|
25060
|
+
.filter(function (e) {
|
|
25061
|
+
if (model === 'readOnly') {
|
|
25062
|
+
return e.key !== 'operating';
|
|
25063
|
+
} else {
|
|
25064
|
+
return true;
|
|
25065
|
+
}
|
|
25066
|
+
}).map(function (e) {
|
|
25067
|
+
return _objectSpread2(_objectSpread2({}, e), {}, {
|
|
25068
|
+
ellipsis: true
|
|
25069
|
+
});
|
|
25070
|
+
});
|
|
25071
|
+
}, [editGood, controller, model, getVehicle]);
|
|
25072
|
+
return columns;
|
|
25073
|
+
});
|
|
25074
|
+
|
|
25075
|
+
var MyInput$4 = /*#__PURE__*/function (_React$Component) {
|
|
25076
|
+
_inherits(MyInput, _React$Component);
|
|
25077
|
+
|
|
25078
|
+
var _super = _createSuper(MyInput);
|
|
25079
|
+
|
|
25080
|
+
function MyInput() {
|
|
25081
|
+
_classCallCheck(this, MyInput);
|
|
25082
|
+
|
|
25083
|
+
return _super.apply(this, arguments);
|
|
25084
|
+
}
|
|
25085
|
+
|
|
25086
|
+
_createClass(MyInput, [{
|
|
25087
|
+
key: "render",
|
|
25088
|
+
value: function render() {
|
|
25089
|
+
if (this.props.loading) {
|
|
25090
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Spin, {
|
|
25091
|
+
size: "small"
|
|
25092
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsXui.Input, _objectSpread2(_objectSpread2({}, this.props), {}, {
|
|
25093
|
+
autoComplete: "off"
|
|
25094
|
+
})));
|
|
25095
|
+
} else {
|
|
25096
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Input, _objectSpread2(_objectSpread2({}, this.props), {}, {
|
|
25097
|
+
autoComplete: "off"
|
|
25098
|
+
}));
|
|
25099
|
+
}
|
|
25100
|
+
}
|
|
25101
|
+
}]);
|
|
25102
|
+
|
|
25103
|
+
return MyInput;
|
|
25104
|
+
}(React__default['default'].Component);
|
|
25105
|
+
|
|
25106
|
+
var useOnRow$2 = (function () {
|
|
25107
|
+
/** 控制器 */
|
|
25108
|
+
var controller = Invoice.useInvoiceController();
|
|
25109
|
+
var model = controller.useMemo(function (s) {
|
|
25110
|
+
return s.model;
|
|
25111
|
+
}, []);
|
|
25112
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/function () {
|
|
25113
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record) {
|
|
25114
|
+
var editGood;
|
|
25115
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25116
|
+
while (1) {
|
|
25117
|
+
switch (_context2.prev = _context2.next) {
|
|
25118
|
+
case 0:
|
|
25119
|
+
if (!(model === 'readOnly')) {
|
|
25120
|
+
_context2.next = 2;
|
|
25121
|
+
break;
|
|
25122
|
+
}
|
|
25123
|
+
|
|
25124
|
+
return _context2.abrupt("return");
|
|
25125
|
+
|
|
25126
|
+
case 2:
|
|
25127
|
+
editGood = controller.state.freightListState.editGood;
|
|
25128
|
+
|
|
25129
|
+
if (!editGood) {
|
|
25130
|
+
_context2.next = 14;
|
|
25131
|
+
break;
|
|
25132
|
+
}
|
|
25133
|
+
|
|
25134
|
+
if (!(editGood.$index === record.$index)) {
|
|
25135
|
+
_context2.next = 6;
|
|
25136
|
+
break;
|
|
25137
|
+
}
|
|
25138
|
+
|
|
25139
|
+
return _context2.abrupt("return");
|
|
25140
|
+
|
|
25141
|
+
case 6:
|
|
25142
|
+
_context2.next = 8;
|
|
25143
|
+
return controller.saveEditFreight();
|
|
25144
|
+
|
|
25145
|
+
case 8:
|
|
25146
|
+
_context2.next = 10;
|
|
25147
|
+
return controller.wait();
|
|
25148
|
+
|
|
25149
|
+
case 10:
|
|
25150
|
+
_context2.next = 12;
|
|
25151
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
25152
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
25153
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
25154
|
+
while (1) {
|
|
25155
|
+
switch (_context.prev = _context.next) {
|
|
25156
|
+
case 0:
|
|
25157
|
+
_context.t0 = s.freightListState.editGood;
|
|
25158
|
+
|
|
25159
|
+
if (_context.t0) {
|
|
25160
|
+
_context.next = 4;
|
|
25161
|
+
break;
|
|
25162
|
+
}
|
|
25163
|
+
|
|
25164
|
+
_context.next = 4;
|
|
25165
|
+
return controller.setEditFreight(record);
|
|
25166
|
+
|
|
25167
|
+
case 4:
|
|
25168
|
+
case "end":
|
|
25169
|
+
return _context.stop();
|
|
25170
|
+
}
|
|
25171
|
+
}
|
|
25172
|
+
}, _callee);
|
|
25173
|
+
}));
|
|
25174
|
+
|
|
25175
|
+
return function (_x2) {
|
|
25176
|
+
return _ref2.apply(this, arguments);
|
|
25177
|
+
};
|
|
25178
|
+
}())();
|
|
25179
|
+
|
|
25180
|
+
case 12:
|
|
25181
|
+
_context2.next = 16;
|
|
25182
|
+
break;
|
|
25183
|
+
|
|
25184
|
+
case 14:
|
|
25185
|
+
_context2.next = 16;
|
|
25186
|
+
return controller.setEditFreight(record);
|
|
25187
|
+
|
|
25188
|
+
case 16:
|
|
25189
|
+
case "end":
|
|
25190
|
+
return _context2.stop();
|
|
25191
|
+
}
|
|
25192
|
+
}
|
|
25193
|
+
}, _callee2);
|
|
25194
|
+
}));
|
|
25195
|
+
|
|
25196
|
+
return function (_x) {
|
|
25197
|
+
return _ref.apply(this, arguments);
|
|
25198
|
+
};
|
|
25199
|
+
}(), [controller, model]);
|
|
25200
|
+
return {
|
|
25201
|
+
onClick: onClick
|
|
25202
|
+
};
|
|
25203
|
+
});
|
|
25204
|
+
|
|
25205
|
+
/**
|
|
25206
|
+
* 点击组件外部 保存正在编辑的货物
|
|
25207
|
+
*/
|
|
25208
|
+
/**
|
|
25209
|
+
* 点击组件外部 保存正在编辑的货物
|
|
25210
|
+
*/
|
|
25211
|
+
|
|
25212
|
+
function useWindowClick$2(controller) {
|
|
25213
|
+
/** 点击组件外部 保存正在编辑的货物 */
|
|
25214
|
+
React__default['default'].useEffect(function () {
|
|
25215
|
+
var click = function click() {
|
|
25216
|
+
setTimeout(controller.saveEditFreight);
|
|
25217
|
+
};
|
|
25218
|
+
|
|
25219
|
+
window.addEventListener('click', click);
|
|
25220
|
+
return function () {
|
|
25221
|
+
window.removeEventListener('click', click);
|
|
25222
|
+
};
|
|
25223
|
+
}, [controller]);
|
|
25224
|
+
}
|
|
25225
|
+
|
|
25226
|
+
var useRowSelection$2 = (function () {
|
|
25227
|
+
/** 控制器 */
|
|
25228
|
+
var controller = Invoice.useInvoiceController();
|
|
25229
|
+
/** 列表选中的货物索引列表 */
|
|
25230
|
+
|
|
25231
|
+
var selectedRowKeys = controller.useMemo(function (s) {
|
|
25232
|
+
return s.freightListState.selectedGoodIndex;
|
|
25233
|
+
}, []);
|
|
25234
|
+
/** 货物列表 */
|
|
25235
|
+
|
|
25236
|
+
var goodsList = controller.useMemo(function (s) {
|
|
25237
|
+
return s.freightListState.goodsList;
|
|
25238
|
+
}, []);
|
|
25239
|
+
/** 组件模式 */
|
|
25240
|
+
|
|
25241
|
+
var model = controller.useMemo(function (s) {
|
|
25242
|
+
return s.model;
|
|
25243
|
+
}, []);
|
|
25244
|
+
/** 搜索条件 */
|
|
25245
|
+
// const searchValue = controller.useMemo(s => s.goodsListState.searchValue, []);
|
|
25246
|
+
|
|
25247
|
+
/** 是否显示选择框 */
|
|
25248
|
+
|
|
25249
|
+
var isShow = React__default['default'].useMemo(function () {
|
|
25250
|
+
if (model === 'readOnly') return false;
|
|
25251
|
+
return true;
|
|
25252
|
+
}, [model]);
|
|
25253
|
+
/** 是否全选 */
|
|
25254
|
+
// const isAll = controller.useMemo(s => s.goodsListState.goodsList.length > 0 && s.goodsListState.selectedGoodIndex.length === s.goodsListState.goodsList.length, [])
|
|
25255
|
+
|
|
25256
|
+
var isAll = controller.useMemo(function (s) {
|
|
25257
|
+
if (s.freightListState.selectedGoodIndex.length <= 0) return false;
|
|
25258
|
+
var seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
|
|
25259
|
+
return e.$index;
|
|
25260
|
+
});
|
|
25261
|
+
var selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
|
|
25262
|
+
return seeGoodsIndex.some(function (t) {
|
|
25263
|
+
return e === t;
|
|
25264
|
+
});
|
|
25265
|
+
});
|
|
25266
|
+
return selectedGoodIndex.length === seeGoodsIndex.length;
|
|
25267
|
+
}, []);
|
|
25268
|
+
var indeterminate = controller.useMemo(function (s) {
|
|
25269
|
+
var seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
|
|
25270
|
+
return e.$index;
|
|
25271
|
+
});
|
|
25272
|
+
var selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
|
|
25273
|
+
return seeGoodsIndex.some(function (t) {
|
|
25274
|
+
return e === t;
|
|
25275
|
+
});
|
|
25276
|
+
});
|
|
25277
|
+
if (selectedGoodIndex.length === 0) return false;
|
|
25278
|
+
return selectedGoodIndex.length < seeGoodsIndex.length;
|
|
25279
|
+
}, []);
|
|
25280
|
+
/** 点击了全选 */
|
|
25281
|
+
|
|
25282
|
+
var onClickSelectAll = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
25283
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
25284
|
+
while (1) {
|
|
25285
|
+
switch (_context3.prev = _context3.next) {
|
|
25286
|
+
case 0:
|
|
25287
|
+
if (!isAll) {
|
|
25288
|
+
_context3.next = 5;
|
|
25289
|
+
break;
|
|
25290
|
+
}
|
|
25291
|
+
|
|
25292
|
+
_context3.next = 3;
|
|
25293
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
25294
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
25295
|
+
var seeGoodsIndex;
|
|
25296
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
25297
|
+
while (1) {
|
|
25298
|
+
switch (_context.prev = _context.next) {
|
|
25299
|
+
case 0:
|
|
25300
|
+
seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
|
|
25301
|
+
return e.$index;
|
|
25302
|
+
});
|
|
25303
|
+
s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
|
|
25304
|
+
return !seeGoodsIndex.some(function (t) {
|
|
25305
|
+
return e === t;
|
|
25306
|
+
});
|
|
25307
|
+
});
|
|
25308
|
+
|
|
25309
|
+
case 2:
|
|
25310
|
+
case "end":
|
|
25311
|
+
return _context.stop();
|
|
25312
|
+
}
|
|
25313
|
+
}
|
|
25314
|
+
}, _callee);
|
|
25315
|
+
}));
|
|
25316
|
+
|
|
25317
|
+
return function (_x) {
|
|
25318
|
+
return _ref2.apply(this, arguments);
|
|
25319
|
+
};
|
|
25320
|
+
}())();
|
|
25321
|
+
|
|
25322
|
+
case 3:
|
|
25323
|
+
_context3.next = 7;
|
|
25324
|
+
break;
|
|
25325
|
+
|
|
25326
|
+
case 5:
|
|
25327
|
+
_context3.next = 7;
|
|
25328
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
25329
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
25330
|
+
var seeGoodsIndex;
|
|
25331
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25332
|
+
while (1) {
|
|
25333
|
+
switch (_context2.prev = _context2.next) {
|
|
25334
|
+
case 0:
|
|
25335
|
+
seeGoodsIndex = s.freightListState.goodsList.map(function (e) {
|
|
25336
|
+
return e.$index;
|
|
25337
|
+
});
|
|
25338
|
+
s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), _toConsumableArray(seeGoodsIndex));
|
|
25339
|
+
s.freightListState.selectedGoodIndex = Array.from(new Set(s.freightListState.selectedGoodIndex));
|
|
25340
|
+
|
|
25341
|
+
case 3:
|
|
25342
|
+
case "end":
|
|
25343
|
+
return _context2.stop();
|
|
25344
|
+
}
|
|
25345
|
+
}
|
|
25346
|
+
}, _callee2);
|
|
25347
|
+
}));
|
|
25348
|
+
|
|
25349
|
+
return function (_x2) {
|
|
25350
|
+
return _ref3.apply(this, arguments);
|
|
25351
|
+
};
|
|
25352
|
+
}())();
|
|
25353
|
+
|
|
25354
|
+
case 7:
|
|
25355
|
+
case "end":
|
|
25356
|
+
return _context3.stop();
|
|
25357
|
+
}
|
|
25358
|
+
}
|
|
25359
|
+
}, _callee3);
|
|
25360
|
+
})), [controller, isAll]);
|
|
25361
|
+
var onSelect = React__default['default'].useCallback( /*#__PURE__*/function () {
|
|
25362
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(record, selected) {
|
|
25363
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
25364
|
+
while (1) {
|
|
25365
|
+
switch (_context6.prev = _context6.next) {
|
|
25366
|
+
case 0:
|
|
25367
|
+
if (!selected) {
|
|
25368
|
+
_context6.next = 5;
|
|
25369
|
+
break;
|
|
25370
|
+
}
|
|
25371
|
+
|
|
25372
|
+
_context6.next = 3;
|
|
25373
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
25374
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
25375
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
25376
|
+
while (1) {
|
|
25377
|
+
switch (_context4.prev = _context4.next) {
|
|
25378
|
+
case 0:
|
|
25379
|
+
s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), [record.$index]);
|
|
25380
|
+
s.freightListState = _objectSpread2({}, s.freightListState);
|
|
25381
|
+
|
|
25382
|
+
case 2:
|
|
25383
|
+
case "end":
|
|
25384
|
+
return _context4.stop();
|
|
25385
|
+
}
|
|
25386
|
+
}
|
|
25387
|
+
}, _callee4);
|
|
25388
|
+
}));
|
|
25389
|
+
|
|
25390
|
+
return function (_x5) {
|
|
25391
|
+
return _ref5.apply(this, arguments);
|
|
25392
|
+
};
|
|
25393
|
+
}())();
|
|
25394
|
+
|
|
25395
|
+
case 3:
|
|
25396
|
+
_context6.next = 7;
|
|
25397
|
+
break;
|
|
25398
|
+
|
|
25399
|
+
case 5:
|
|
25400
|
+
_context6.next = 7;
|
|
25401
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
25402
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
25403
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
25404
|
+
while (1) {
|
|
25405
|
+
switch (_context5.prev = _context5.next) {
|
|
25406
|
+
case 0:
|
|
25407
|
+
s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
|
|
25408
|
+
return e !== record.$index;
|
|
25409
|
+
});
|
|
25410
|
+
s.freightListState = _objectSpread2({}, s.freightListState);
|
|
25411
|
+
|
|
25412
|
+
case 2:
|
|
25413
|
+
case "end":
|
|
25414
|
+
return _context5.stop();
|
|
25415
|
+
}
|
|
25416
|
+
}
|
|
25417
|
+
}, _callee5);
|
|
25418
|
+
}));
|
|
25419
|
+
|
|
25420
|
+
return function (_x6) {
|
|
25421
|
+
return _ref6.apply(this, arguments);
|
|
25422
|
+
};
|
|
25423
|
+
}())();
|
|
25424
|
+
|
|
25425
|
+
case 7:
|
|
25426
|
+
case "end":
|
|
25427
|
+
return _context6.stop();
|
|
25428
|
+
}
|
|
25429
|
+
}
|
|
25430
|
+
}, _callee6);
|
|
25431
|
+
}));
|
|
25432
|
+
|
|
25433
|
+
return function (_x3, _x4) {
|
|
25434
|
+
return _ref4.apply(this, arguments);
|
|
25435
|
+
};
|
|
25436
|
+
}(), [controller]);
|
|
25437
|
+
var columnTitle = React__default['default'].useMemo(function () {
|
|
25438
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Checkbox, {
|
|
25439
|
+
onChange: onClickSelectAll,
|
|
25440
|
+
indeterminate: indeterminate,
|
|
25441
|
+
checked: isAll
|
|
25442
|
+
});
|
|
25443
|
+
}, [goodsList, selectedRowKeys, onClickSelectAll, isAll, indeterminate]);
|
|
25444
|
+
/** 选择了商品后 调整 折扣行 和 被折扣行 */
|
|
25445
|
+
|
|
25446
|
+
var sortOut = React__default['default'].useCallback( /*#__PURE__*/function () {
|
|
25447
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(selected) {
|
|
25448
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
25449
|
+
while (1) {
|
|
25450
|
+
switch (_context8.prev = _context8.next) {
|
|
25451
|
+
case 0:
|
|
25452
|
+
_context8.next = 2;
|
|
25453
|
+
return controller.wait();
|
|
25454
|
+
|
|
25455
|
+
case 2:
|
|
25456
|
+
_context8.next = 4;
|
|
25457
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
25458
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s) {
|
|
25459
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
25460
|
+
while (1) {
|
|
25461
|
+
switch (_context7.prev = _context7.next) {
|
|
25462
|
+
case 0:
|
|
25463
|
+
s.freightListState.selectedGoodIndex.forEach(function ($index) {
|
|
25464
|
+
var goods = s.freightListState.goodsMap.get($index);
|
|
25465
|
+
if (!goods) return; // 数组位置
|
|
25466
|
+
|
|
25467
|
+
var t = s.freightListState.goodsList.indexOf(goods); // goods.lineAttribute === LineAttributeType.折扣行 ? t : t++;
|
|
25468
|
+
|
|
25469
|
+
var i = s.goodsListState.goodsList[t].$index;
|
|
25470
|
+
|
|
25471
|
+
if (selected) {
|
|
25472
|
+
if (s.freightListState.selectedGoodIndex.indexOf(i) < 0) s.freightListState.selectedGoodIndex = [].concat(_toConsumableArray(s.freightListState.selectedGoodIndex), [i]);
|
|
25473
|
+
} else {
|
|
25474
|
+
if (s.freightListState.selectedGoodIndex.indexOf(i) < 0) s.freightListState.selectedGoodIndex = s.freightListState.selectedGoodIndex.filter(function (e) {
|
|
25475
|
+
return e !== $index;
|
|
25476
|
+
});
|
|
25477
|
+
}
|
|
25478
|
+
});
|
|
25479
|
+
|
|
25480
|
+
case 1:
|
|
25481
|
+
case "end":
|
|
25482
|
+
return _context7.stop();
|
|
25483
|
+
}
|
|
25484
|
+
}
|
|
25485
|
+
}, _callee7);
|
|
25486
|
+
}));
|
|
25487
|
+
|
|
25488
|
+
return function (_x8) {
|
|
25489
|
+
return _ref8.apply(this, arguments);
|
|
25490
|
+
};
|
|
25491
|
+
}())();
|
|
25492
|
+
|
|
25493
|
+
case 4:
|
|
25494
|
+
case "end":
|
|
25495
|
+
return _context8.stop();
|
|
25496
|
+
}
|
|
25497
|
+
}
|
|
25498
|
+
}, _callee8);
|
|
25499
|
+
}));
|
|
25500
|
+
|
|
25501
|
+
return function (_x7) {
|
|
25502
|
+
return _ref7.apply(this, arguments);
|
|
25503
|
+
};
|
|
25504
|
+
}(), [controller]); // React.useEffect(() => {
|
|
25505
|
+
// sortOut(true);
|
|
25506
|
+
// }, [sortOut, goodsList])
|
|
25507
|
+
|
|
25508
|
+
if (isShow === false) return undefined;
|
|
25509
|
+
return {
|
|
25510
|
+
columnWidth: 45,
|
|
25511
|
+
columnTitle: columnTitle,
|
|
25512
|
+
onSelect: onSelect,
|
|
25513
|
+
selectedRowKeys: selectedRowKeys
|
|
25514
|
+
};
|
|
25515
|
+
});
|
|
25516
|
+
|
|
25517
|
+
var useDelRowButton$2 = (function () {
|
|
25518
|
+
var controller = Invoice.useInvoiceController();
|
|
25519
|
+
var model = controller.useMemo(function (s) {
|
|
25520
|
+
return s.model;
|
|
25521
|
+
}, []);
|
|
25522
|
+
var isRemRow = controller.useMemo(function (s) {
|
|
25523
|
+
return s.freightListState.isRemRow;
|
|
25524
|
+
}, []);
|
|
25525
|
+
/** 是否禁用 */
|
|
25526
|
+
|
|
25527
|
+
var disabled = controller.useMemo(function (s) {
|
|
25528
|
+
if (s.freightListState.selectedGoodIndex.length <= 0) return true;
|
|
25529
|
+
return false;
|
|
25530
|
+
}, []);
|
|
25531
|
+
/** 点击了删除 */
|
|
25532
|
+
|
|
25533
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
25534
|
+
var selectedGoodIndex, i;
|
|
25535
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25536
|
+
while (1) {
|
|
25537
|
+
switch (_context2.prev = _context2.next) {
|
|
25538
|
+
case 0:
|
|
25539
|
+
selectedGoodIndex = controller.state.freightListState.selectedGoodIndex.slice();
|
|
25540
|
+
i = 0;
|
|
25541
|
+
|
|
25542
|
+
case 2:
|
|
25543
|
+
if (!(i < selectedGoodIndex.length)) {
|
|
25544
|
+
_context2.next = 8;
|
|
25545
|
+
break;
|
|
25546
|
+
}
|
|
25547
|
+
|
|
25548
|
+
_context2.next = 5;
|
|
25549
|
+
return controller.delFreight(selectedGoodIndex[i]);
|
|
25550
|
+
|
|
25551
|
+
case 5:
|
|
25552
|
+
i++;
|
|
25553
|
+
_context2.next = 2;
|
|
25554
|
+
break;
|
|
25555
|
+
|
|
25556
|
+
case 8:
|
|
25557
|
+
_context2.next = 10;
|
|
25558
|
+
return controller.run( /*#__PURE__*/function () {
|
|
25559
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
25560
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
25561
|
+
while (1) {
|
|
25562
|
+
switch (_context.prev = _context.next) {
|
|
25563
|
+
case 0:
|
|
25564
|
+
s.freightListState.selectedGoodIndex = [];
|
|
25565
|
+
|
|
25566
|
+
case 1:
|
|
25567
|
+
case "end":
|
|
25568
|
+
return _context.stop();
|
|
25569
|
+
}
|
|
25570
|
+
}
|
|
25571
|
+
}, _callee);
|
|
25572
|
+
}));
|
|
25573
|
+
|
|
25574
|
+
return function (_x) {
|
|
25575
|
+
return _ref2.apply(this, arguments);
|
|
25576
|
+
};
|
|
25577
|
+
}());
|
|
25578
|
+
|
|
25579
|
+
case 10:
|
|
25580
|
+
case "end":
|
|
25581
|
+
return _context2.stop();
|
|
25582
|
+
}
|
|
25583
|
+
}
|
|
25584
|
+
}, _callee2);
|
|
25585
|
+
})), []);
|
|
25586
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
25587
|
+
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
25588
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
25589
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Menu.Item, {
|
|
25590
|
+
key: "1",
|
|
25591
|
+
onClick: onClick,
|
|
25592
|
+
disabled: disabled
|
|
25593
|
+
}, " \u5220\u9664\u884C ");
|
|
25594
|
+
}, [model, onClick, disabled]);
|
|
25595
|
+
var button = React__default['default'].useMemo(function () {
|
|
25596
|
+
if (isRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
25597
|
+
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
25598
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
25599
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
25600
|
+
size: 'small',
|
|
25601
|
+
onClick: onClick,
|
|
25602
|
+
disabled: disabled
|
|
25603
|
+
}, "\u5220\u9664");
|
|
25604
|
+
}, [model, onClick, disabled, isRemRow]);
|
|
25605
|
+
return {
|
|
25606
|
+
button: button,
|
|
25607
|
+
menuItem: menuItem
|
|
25608
|
+
};
|
|
25609
|
+
});
|
|
25610
|
+
|
|
25611
|
+
var css_248z$v = ".kts-invoice-operate-freight {\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-freight .real-estate-info-digtal-label {\n padding: 20px 20px 0;\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-freight .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-goods-list-digtal .goods-list-digtal-discount-tag {\n display: inline-block;\n height: 20px;\n line-height: 20px;\n border: 1px solid;\n padding: 0 5px;\n border-radius: 4px;\n}\n.kts-invoice-operate-goods-list-digtal .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list-digtal .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 2px solid #9F613E;\n gap: 10px;\n align-items: center;\n height: 48px;\n}\n.kts-invoice-operate-goods-list-digtal .ktsAntX-table .ktsAntX-table-row.kts-invoice-operate-goods-be-discount .ktsAntX-table-cell {\n color: #f00;\n}\n.kts-invoice-operate-goods-list-table-digtal .ktsAnt3x-form-item-control.has-error {\n border: 1px solid #f00;\n}\n.kts-invoice-operate-goods-list-table-digtal .kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table-digtal .kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n";
|
|
25612
|
+
styleInject(css_248z$v);
|
|
25613
|
+
|
|
25614
|
+
var FreightList = /*#__PURE__*/function (_React$Component) {
|
|
25615
|
+
_inherits(FreightList, _React$Component);
|
|
25616
|
+
|
|
25617
|
+
var _super = _createSuper(FreightList);
|
|
25618
|
+
|
|
25619
|
+
function FreightList() {
|
|
25620
|
+
_classCallCheck(this, FreightList);
|
|
25621
|
+
|
|
25622
|
+
return _super.apply(this, arguments);
|
|
25623
|
+
}
|
|
25624
|
+
|
|
25625
|
+
_createClass(FreightList, [{
|
|
25626
|
+
key: "render",
|
|
25627
|
+
value: function render() {
|
|
25628
|
+
return /*#__PURE__*/React__default['default'].createElement(Main$4, _objectSpread2({}, this.props));
|
|
25629
|
+
}
|
|
25630
|
+
}]);
|
|
25631
|
+
|
|
25632
|
+
return FreightList;
|
|
25633
|
+
}(React__default['default'].Component);
|
|
25634
|
+
var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
25635
|
+
var form = props.form;
|
|
25636
|
+
/** 控制器 */
|
|
25637
|
+
|
|
25638
|
+
var controller = Invoice.useInvoiceController();
|
|
25639
|
+
var goodsList = controller.useMemo(function (s) {
|
|
25640
|
+
return s.freightListState.goodsList;
|
|
25641
|
+
}, []);
|
|
25642
|
+
/** 货物列表 */
|
|
25643
|
+
|
|
25644
|
+
var dataSource = controller.useMemo(function (s) {
|
|
25645
|
+
return s.freightListState.goodsList;
|
|
25646
|
+
}, []);
|
|
25647
|
+
/** 表格行事件 */
|
|
25648
|
+
|
|
25649
|
+
var _onRow = useOnRow$2();
|
|
25650
|
+
/** 批量删除 */
|
|
25651
|
+
|
|
25652
|
+
|
|
25653
|
+
var delRowButton = useDelRowButton$2();
|
|
25654
|
+
useWindowClick$2(controller); // 点击组件外部 保存正在编辑的货物
|
|
25655
|
+
|
|
25656
|
+
/** 注册 from 对象 */
|
|
25657
|
+
|
|
25658
|
+
React__default['default'].useEffect(function () {
|
|
25659
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
25660
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, form) {
|
|
25661
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
25662
|
+
while (1) {
|
|
25663
|
+
switch (_context.prev = _context.next) {
|
|
25664
|
+
case 0:
|
|
25665
|
+
s.freightListState = _objectSpread2(_objectSpread2({}, s.freightListState), {}, {
|
|
25666
|
+
form: form
|
|
25667
|
+
});
|
|
25668
|
+
|
|
25669
|
+
case 1:
|
|
25670
|
+
case "end":
|
|
25671
|
+
return _context.stop();
|
|
25672
|
+
}
|
|
25673
|
+
}
|
|
25674
|
+
}, _callee);
|
|
25675
|
+
}));
|
|
25676
|
+
|
|
25677
|
+
return function (_x, _x2) {
|
|
25678
|
+
return _ref.apply(this, arguments);
|
|
25679
|
+
};
|
|
25680
|
+
}())(props.form);
|
|
25681
|
+
}, [controller, props.form]); // 跟新 货物
|
|
25682
|
+
|
|
25683
|
+
React__default['default'].useEffect(function () {
|
|
25684
|
+
controller.run( /*#__PURE__*/function () {
|
|
25685
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
25686
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25687
|
+
while (1) {
|
|
25688
|
+
switch (_context2.prev = _context2.next) {
|
|
25689
|
+
case 0:
|
|
25690
|
+
s.freightListState.goodsMap = new Map();
|
|
25691
|
+
goodsList.forEach(function (e) {
|
|
25692
|
+
s.freightListState.goodsMap.set(e.$index, e);
|
|
25693
|
+
});
|
|
25694
|
+
|
|
25695
|
+
case 2:
|
|
25696
|
+
case "end":
|
|
25697
|
+
return _context2.stop();
|
|
25698
|
+
}
|
|
25699
|
+
}
|
|
25700
|
+
}, _callee2);
|
|
25701
|
+
}));
|
|
25702
|
+
|
|
25703
|
+
return function (_x3) {
|
|
25704
|
+
return _ref2.apply(this, arguments);
|
|
25705
|
+
};
|
|
25706
|
+
}());
|
|
25707
|
+
}, [controller, goodsList]);
|
|
25708
|
+
/** props 产品最大数 更新 */
|
|
25709
|
+
|
|
25710
|
+
React__default['default'].useEffect(function () {
|
|
25711
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
25712
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
25713
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
25714
|
+
while (1) {
|
|
25715
|
+
switch (_context3.prev = _context3.next) {
|
|
25716
|
+
case 0:
|
|
25717
|
+
s.freightListState.goodMax = props.goodMax;
|
|
25718
|
+
|
|
25719
|
+
case 1:
|
|
25720
|
+
case "end":
|
|
25721
|
+
return _context3.stop();
|
|
25722
|
+
}
|
|
25723
|
+
}
|
|
25724
|
+
}, _callee3);
|
|
25725
|
+
}));
|
|
25726
|
+
|
|
25727
|
+
return function (_x4) {
|
|
25728
|
+
return _ref3.apply(this, arguments);
|
|
25729
|
+
};
|
|
25730
|
+
}())();
|
|
25731
|
+
}, [controller, props.goodMax]); // 注册 form
|
|
25732
|
+
// controller.useForm('freightInfo', form);
|
|
25733
|
+
|
|
25734
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
25735
|
+
className: "kts-invoice-operate-freight"
|
|
25736
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
25737
|
+
className: 'real-estate-info-digtal-label'
|
|
25738
|
+
}, "\u7279\u6B8A\u4FE1\u606F-\u5EFA\u7B51\u670D\u52A1"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
25739
|
+
className: "kts-invoice-operate-goods-list-digtal",
|
|
25740
|
+
onClick: function onClick(e) {
|
|
25741
|
+
e.stopPropagation();
|
|
25742
|
+
}
|
|
25743
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
25744
|
+
className: "kts-invoice-operate-goods-list-able"
|
|
25745
|
+
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton$2, null), delRowButton.button, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
25746
|
+
style: {
|
|
25747
|
+
flex: 1
|
|
25748
|
+
}
|
|
25749
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
25750
|
+
className: classnames__default['default']('kts-invoice-operate-goods-list-table-digtal')
|
|
25751
|
+
}, /*#__PURE__*/React__default['default'].createElement(TableVirtual$2, {
|
|
25752
|
+
size: "small",
|
|
25753
|
+
rowKey: "$index",
|
|
25754
|
+
pagination: false,
|
|
25755
|
+
scroll: {
|
|
25756
|
+
y: 280
|
|
25757
|
+
},
|
|
25758
|
+
components: {
|
|
25759
|
+
body: {
|
|
25760
|
+
row: TableRow$2
|
|
25761
|
+
}
|
|
25762
|
+
},
|
|
25763
|
+
dataSource: dataSource,
|
|
25764
|
+
columns: useColumns$2(props.form),
|
|
25765
|
+
rowSelection: useRowSelection$2(),
|
|
25766
|
+
onRow: function onRow(record) {
|
|
25767
|
+
return {
|
|
25768
|
+
onClick: function onClick() {
|
|
25769
|
+
_onRow.onClick(record);
|
|
25770
|
+
}
|
|
25771
|
+
};
|
|
25772
|
+
}
|
|
25773
|
+
}))));
|
|
25774
|
+
});
|
|
25775
|
+
|
|
25776
|
+
var ImportBuyerDrawer = (function () {
|
|
25777
|
+
var controller = Invoice.useInvoiceController();
|
|
25778
|
+
var visible = controller.useMemo(function (s) {
|
|
25779
|
+
return s.buyerState.isVisibleDrawer;
|
|
25780
|
+
}, []);
|
|
25781
|
+
var topExpand = controller.useMemo(function (s) {
|
|
25782
|
+
return s.buyerState.topExpand;
|
|
25783
|
+
}, []); // controller.pipeline(async s=>s.goodsListState.isTaxIncluded = true)()
|
|
25784
|
+
|
|
25785
|
+
var onClose = React__default['default'].useCallback(function () {
|
|
23937
25786
|
controller.pipeline( /*#__PURE__*/function () {
|
|
23938
25787
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
23939
25788
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -24300,8 +26149,8 @@ var getItemCode = function getItemCode(record, editGood) {
|
|
|
24300
26149
|
return record.productCode;
|
|
24301
26150
|
};
|
|
24302
26151
|
|
|
24303
|
-
var css_248z$
|
|
24304
|
-
styleInject(css_248z$
|
|
26152
|
+
var css_248z$w = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
|
|
26153
|
+
styleInject(css_248z$w);
|
|
24305
26154
|
|
|
24306
26155
|
var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
|
|
24307
26156
|
var confirm = ktsComponentsAntdX3.Modal.confirm;
|
|
@@ -24941,15 +26790,14 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
24941
26790
|
// s.value = info.node.taxRate
|
|
24942
26791
|
// }
|
|
24943
26792
|
// });
|
|
24944
|
-
var node = info.node || info;
|
|
24945
26793
|
actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
|
|
24946
26794
|
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
|
|
24947
26795
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
24948
26796
|
while (1) {
|
|
24949
26797
|
switch (_context12.prev = _context12.next) {
|
|
24950
26798
|
case 0:
|
|
24951
|
-
if (
|
|
24952
|
-
s.value =
|
|
26799
|
+
if (info.taxCategoryCode) {
|
|
26800
|
+
s.value = info.taxCategoryCode;
|
|
24953
26801
|
}
|
|
24954
26802
|
|
|
24955
26803
|
case 1:
|
|
@@ -24970,8 +26818,8 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
24970
26818
|
while (1) {
|
|
24971
26819
|
switch (_context13.prev = _context13.next) {
|
|
24972
26820
|
case 0:
|
|
24973
|
-
if (
|
|
24974
|
-
s.value =
|
|
26821
|
+
if (info.shorthand) {
|
|
26822
|
+
s.value = info.shorthand;
|
|
24975
26823
|
}
|
|
24976
26824
|
|
|
24977
26825
|
case 1:
|
|
@@ -24989,26 +26837,24 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
24989
26837
|
setOpen(false);
|
|
24990
26838
|
}, [controller, actions]);
|
|
24991
26839
|
var onSelect = React__default['default'].useCallback(function (key, info) {
|
|
24992
|
-
var node = info.node || info;
|
|
24993
|
-
|
|
24994
26840
|
if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
|
|
24995
|
-
var
|
|
26841
|
+
var _info$node$taxRateLis;
|
|
24996
26842
|
|
|
24997
|
-
if ((
|
|
24998
|
-
setGoodsTaxRateList(node.taxRateList);
|
|
26843
|
+
if ((_info$node$taxRateLis = info.node.taxRateList) === null || _info$node$taxRateLis === void 0 ? void 0 : _info$node$taxRateLis.length) {
|
|
26844
|
+
setGoodsTaxRateList(info.node.taxRateList);
|
|
24999
26845
|
}
|
|
25000
26846
|
|
|
25001
26847
|
if (!readOnlyTaxRate) {
|
|
25002
26848
|
actions.setFieldState('taxRate', /*#__PURE__*/function () {
|
|
25003
26849
|
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
|
|
25004
|
-
var
|
|
26850
|
+
var _info$node$taxRateLis2;
|
|
25005
26851
|
|
|
25006
26852
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
25007
26853
|
while (1) {
|
|
25008
26854
|
switch (_context14.prev = _context14.next) {
|
|
25009
26855
|
case 0:
|
|
25010
|
-
if (node.taxRateList && ((
|
|
25011
|
-
s.value = node.taxRateList[0];
|
|
26856
|
+
if (info.node.taxRateList && ((_info$node$taxRateLis2 = info.node.taxRateList) === null || _info$node$taxRateLis2 === void 0 ? void 0 : _info$node$taxRateLis2.length) === 1) {
|
|
26857
|
+
s.value = info.node.taxRateList[0];
|
|
25012
26858
|
} else {
|
|
25013
26859
|
s.value = undefined;
|
|
25014
26860
|
}
|
|
@@ -25077,7 +26923,6 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
25077
26923
|
onSubmit: onSubmit1,
|
|
25078
26924
|
onCancel: function onCancel() {
|
|
25079
26925
|
setOpen(false);
|
|
25080
|
-
setInfo({});
|
|
25081
26926
|
},
|
|
25082
26927
|
onSearch: onSearch,
|
|
25083
26928
|
onLoad: onLoad
|
|
@@ -25537,6 +27382,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
25537
27382
|
|
|
25538
27383
|
/** 特殊信息-不动产经营租赁服务(数电) */
|
|
25539
27384
|
|
|
27385
|
+
/** 特殊信息-建筑服务(数电) */
|
|
27386
|
+
|
|
25540
27387
|
/** 货物列表(数电) */
|
|
25541
27388
|
|
|
25542
27389
|
/** 货物索引生成器 */
|
|
@@ -25550,7 +27397,7 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
25550
27397
|
if (this.props.invoiceType === 'digtal') {
|
|
25551
27398
|
return /*#__PURE__*/React__default['default'].createElement(Digtal, _objectSpread2({}, this.props));
|
|
25552
27399
|
} else {
|
|
25553
|
-
return /*#__PURE__*/React__default['default'].createElement(Main$
|
|
27400
|
+
return /*#__PURE__*/React__default['default'].createElement(Main$5, _objectSpread2({}, this.props));
|
|
25554
27401
|
}
|
|
25555
27402
|
}
|
|
25556
27403
|
}]);
|
|
@@ -25571,6 +27418,8 @@ Invoice.Stakeholder = Stakeholder$1;
|
|
|
25571
27418
|
Invoice.StakeFarmerholder = StakeFarmerholder;
|
|
25572
27419
|
Invoice.SignDigtal = SignDigtal;
|
|
25573
27420
|
Invoice.RealEstateInfo = RealEstateInfo;
|
|
27421
|
+
Invoice.Architecture = Architecture;
|
|
27422
|
+
Invoice.FreightList = FreightList;
|
|
25574
27423
|
Invoice.GoodsListDigtal = GoodsList$1;
|
|
25575
27424
|
Invoice.idGenerator = idGenerator;
|
|
25576
27425
|
Invoice.calculator = calculator;
|
|
@@ -25580,7 +27429,7 @@ Invoice.useInvoiceController = function () {
|
|
|
25580
27429
|
return React__default['default'].useContext(InvoiceContext);
|
|
25581
27430
|
};
|
|
25582
27431
|
|
|
25583
|
-
var Main$
|
|
27432
|
+
var Main$5 = function Main(props) {
|
|
25584
27433
|
var controller = React__default['default'].useMemo(function () {
|
|
25585
27434
|
return props.controller || new InvoiceController();
|
|
25586
27435
|
}, [props.controller]);
|
|
@@ -25688,11 +27537,11 @@ var Digtal = function Digtal(props) {
|
|
|
25688
27537
|
), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null));
|
|
25689
27538
|
};
|
|
25690
27539
|
|
|
25691
|
-
var css_248z$
|
|
25692
|
-
styleInject(css_248z$
|
|
27540
|
+
var css_248z$x = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n}\n";
|
|
27541
|
+
styleInject(css_248z$x);
|
|
25693
27542
|
|
|
25694
27543
|
function TaxClassificationModal(props) {
|
|
25695
|
-
var _props$
|
|
27544
|
+
var _props$info2, _props$info3;
|
|
25696
27545
|
|
|
25697
27546
|
var _Form$useForm = ktsXui.Form.useForm(),
|
|
25698
27547
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
@@ -25772,16 +27621,6 @@ function TaxClassificationModal(props) {
|
|
|
25772
27621
|
});
|
|
25773
27622
|
};
|
|
25774
27623
|
|
|
25775
|
-
React__default['default'].useEffect(function () {
|
|
25776
|
-
var _props$info2, _props$info3, _props$info4, _props$info5;
|
|
25777
|
-
|
|
25778
|
-
form.setFieldsValue(_objectSpread2(_objectSpread2({}, form.getFieldsValue()), {}, {
|
|
25779
|
-
taxCategoryCode: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.taxCategoryCode,
|
|
25780
|
-
productName: props === null || props === void 0 ? void 0 : (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.productName,
|
|
25781
|
-
shorthand: props === null || props === void 0 ? void 0 : (_props$info4 = props.info) === null || _props$info4 === void 0 ? void 0 : _props$info4.shorthand,
|
|
25782
|
-
taxDesc: props === null || props === void 0 ? void 0 : (_props$info5 = props.info) === null || _props$info5 === void 0 ? void 0 : _props$info5.taxDesc
|
|
25783
|
-
}));
|
|
25784
|
-
}, [props === null || props === void 0 ? void 0 : (_props$info6 = props.info) === null || _props$info6 === void 0 ? void 0 : _props$info6.key]);
|
|
25785
27624
|
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Drawer, {
|
|
25786
27625
|
title: "\u5546\u54C1\u548C\u670D\u52A1\u7A0E\u6536\u5206\u7C7B\u7F16\u7801",
|
|
25787
27626
|
placement: "right",
|
|
@@ -25827,10 +27666,16 @@ function TaxClassificationModal(props) {
|
|
|
25827
27666
|
}))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Card, {
|
|
25828
27667
|
className: "taxrightbox"
|
|
25829
27668
|
}, /*#__PURE__*/React__default['default'].createElement(ktsXui.Form, _objectSpread2(_objectSpread2({
|
|
25830
|
-
form: form
|
|
27669
|
+
form: form,
|
|
27670
|
+
key: props === null || props === void 0 ? void 0 : (_props$info2 = props.info) === null || _props$info2 === void 0 ? void 0 : _props$info2.key
|
|
25831
27671
|
}, layout), {}, {
|
|
25832
27672
|
initialValues: props.info
|
|
25833
27673
|
}), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
|
|
27674
|
+
rules: [{
|
|
27675
|
+
required: true,
|
|
27676
|
+
message: '请勾选税收分类编码'
|
|
27677
|
+
}],
|
|
27678
|
+
initialValue: (_props$info3 = props.info) === null || _props$info3 === void 0 ? void 0 : _props$info3.taxCategoryCode,
|
|
25834
27679
|
name: "taxCategoryCode",
|
|
25835
27680
|
label: "\u7F16\u7801"
|
|
25836
27681
|
}, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null)), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
|
|
@@ -25840,8 +27685,7 @@ function TaxClassificationModal(props) {
|
|
|
25840
27685
|
name: "shorthand",
|
|
25841
27686
|
label: "\u7B80\u79F0"
|
|
25842
27687
|
}, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null)), /*#__PURE__*/React__default['default'].createElement(ktsXui.Form.Item, {
|
|
25843
|
-
name: "
|
|
25844
|
-
className: "taxdesc",
|
|
27688
|
+
name: "desc",
|
|
25845
27689
|
label: "\u8BF4\u660E"
|
|
25846
27690
|
}, /*#__PURE__*/React__default['default'].createElement(ktsXui.FormReadOnly, null))))));
|
|
25847
27691
|
}
|