Commit 99a9040f8ddb93a9d2ace2ab491b2c307a8d6d6a

Authored by 舒述军
1 parent f460ca23

fix 零售台数输入

src/pages/order3/RetailTask/component/Modal.tsx
... ... @@ -22,10 +22,10 @@ export default function EModal({ setVisible, visible, current = {}, index, setLi
22 22 //改变整体外层数据
23 23 const data = JSON.parse(JSON.stringify(list));
24 24 const currentData = JSON.parse(JSON.stringify(current));
25   - if (!isNil(index) && e) {
26   - data.shopTaskList![index].staffTaskList![innerIndex].taskCount = e;
  25 + if (!isNil(index)) {
  26 + data.shopTaskList![index].staffTaskList![innerIndex].taskCount = e || 0;
27 27 data.shopTaskList![index].staffTaskList![innerIndex].clueDealTaskCount = Math.ceil((data.shopTaskList![index].clueDealTaskRate || 0)/100 *(e || 0));
28   - currentData.staffTaskList![innerIndex].taskCount = e;
  28 + currentData.staffTaskList![innerIndex].taskCount = e || 0;
29 29 currentData.staffTaskList![innerIndex].clueDealTaskCount = Math.ceil((data.shopTaskList![index].clueDealTaskRate || 0)/100 *(e || 0));
30 30 }
31 31 setList({ ...data });
... ... @@ -46,10 +46,9 @@ export default function EModal({ setVisible, visible, current = {}, index, setLi
46 46 message.error("线索到店零售台数不能大于零售任务!");
47 47 return;
48 48 }
49   - if (!isNil(index) && e) {
50   - console.log("=====");
51   - data.shopTaskList![index].staffTaskList![innerIndex].clueDealTaskCount = e;
52   - currentData.staffTaskList![innerIndex].clueDealTaskCount = e;
  49 + if (!isNil(index)) {
  50 + data.shopTaskList![index].staffTaskList![innerIndex].clueDealTaskCount = e || 0;
  51 + currentData.staffTaskList![innerIndex].clueDealTaskCount = e || 0;
53 52 }
54 53 setList({ ...data });
55 54 //回显改变数据
... ...
src/pages/order3/RetailTask/index.tsx
... ... @@ -76,7 +76,7 @@ export default function TacklingCarModels() {
76 76 message.error("线索到店零售台数不能大于零售任务!");
77 77 return;
78 78 }
79   - data.shopTaskList![index].clueDealTaskCount = e;
  79 + data.shopTaskList![index].clueDealTaskCount = e || 0;
80 80 setList({ ...data });
81 81 }
82 82 //保存
... ...