Commit 47d53c852ae9bee3cae49e81a782b86505f38618

Authored by Dunfa Jiang
1 parent 17722d4d

fix;修改部分逻辑

@@ -4,9 +4,13 @@ @@ -4,9 +4,13 @@
4 <el-descriptions-item label="任务ID:">{{ 4 <el-descriptions-item label="任务ID:">{{
5 detailData.id 5 detailData.id
6 }}</el-descriptions-item> 6 }}</el-descriptions-item>
7 - <el-descriptions-item label="任务名称:">{{  
8 - detailData.name  
9 - }}</el-descriptions-item> 7 + <el-descriptions-item label="任务名称:">
  8 + <el-input
  9 + style="width: 200px"
  10 + v-model="taskName"
  11 + placeholder="请输入任务名称"
  12 + />
  13 + </el-descriptions-item>
10 <el-descriptions-item label="对应营业厅:">{{ 14 <el-descriptions-item label="对应营业厅:">{{
11 detailData.businessName 15 detailData.businessName
12 }}</el-descriptions-item> 16 }}</el-descriptions-item>
@@ -358,6 +362,7 @@ const { queryParams, form, rules } = toRefs(data); @@ -358,6 +362,7 @@ const { queryParams, form, rules } = toRefs(data);
358 const open = ref(false); 362 const open = ref(false);
359 const title = ref(""); 363 const title = ref("");
360 const deviceTypeList = ref([]); 364 const deviceTypeList = ref([]);
  365 +const taskName = ref([]);
361 366
362 const getDeviceTypeList = () => { 367 const getDeviceTypeList = () => {
363 deviceTypeQueryList( 368 deviceTypeQueryList(
@@ -484,7 +489,7 @@ const scanCodeCallback = (callback) => { @@ -484,7 +489,7 @@ const scanCodeCallback = (callback) => {
484 reset(); 489 reset();
485 open.value = true; 490 open.value = true;
486 title.value = "扫码录入"; 491 title.value = "扫码录入";
487 - form.value.name = "name" + new Date().getTime(); 492 + form.value.name = taskName.value;
488 form.value.businessId = data.businessId; 493 form.value.businessId = data.businessId;
489 form.value.businessName = data.businessName; 494 form.value.businessName = data.businessName;
490 form.value.barcode = data.barcode; 495 form.value.barcode = data.barcode;
@@ -527,7 +532,7 @@ const confirmAddTask = () => { @@ -527,7 +532,7 @@ const confirmAddTask = () => {
527 return; 532 return;
528 } 533 }
529 const data = { 534 const data = {
530 - name: "任务" + new Date().getTime(), 535 + name: taskName.value,
531 businessId: dataList.value[0].businessId, 536 businessId: dataList.value[0].businessId,
532 specList: localStoreTableData.map((item) => ({ 537 specList: localStoreTableData.map((item) => ({
533 businessId: item.businessId, 538 businessId: item.businessId,
@@ -538,15 +543,20 @@ const confirmAddTask = () => { @@ -538,15 +543,20 @@ const confirmAddTask = () => {
538 }; 543 };
539 if (proxy.$route.query.scanTaskId) { 544 if (proxy.$route.query.scanTaskId) {
540 data.id = detailData.value.id; 545 data.id = detailData.value.id;
541 - data.name = detailData.value.name; 546 + data.name = taskName.value;
542 data.businessId = detailData.value.businessId; 547 data.businessId = detailData.value.businessId;
543 data.specList = data.specList.concat( 548 data.specList = data.specList.concat(
544 - dataList.value.map((item) => ({  
545 - businessId: item.businessId,  
546 - deviceTypeId: item.deviceTypeId,  
547 - barcode: item.barcode,  
548 - quantity: item.quantity,  
549 - })) 549 + dataList.value
  550 + .filter(
  551 + (filterItem) => localStoreTableData.map(local=>local.id).indexOf(filterItem.id) == -1
  552 + )
  553 + .map((item) => ({
  554 + id:item.id,
  555 + businessId: item.businessId,
  556 + deviceTypeId: item.deviceTypeId,
  557 + barcode: item.barcode,
  558 + quantity: item.quantity,
  559 + }))
550 ); 560 );
551 taskLoading.value = true; 561 taskLoading.value = true;
552 editScanTask(data) 562 editScanTask(data)
@@ -643,6 +653,7 @@ const detailData = ref({}); @@ -643,6 +653,7 @@ const detailData = ref({});
643 const getDetail = () => { 653 const getDetail = () => {
644 scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => { 654 scanTaskdetal(proxy.$route.query.scanTaskId).then((res) => {
645 detailData.value = res.data; 655 detailData.value = res.data;
  656 + taskName.value = detailData.value.name;
646 }); 657 });
647 }; 658 };
648 659
@@ -661,9 +672,7 @@ const handleDelete = (row) => { @@ -661,9 +672,7 @@ const handleDelete = (row) => {
661 let localStoreTableData = localStorage.getItem("localStoreTableData") 672 let localStoreTableData = localStorage.getItem("localStoreTableData")
662 ? JSON.parse(localStorage.getItem("localStoreTableData")) 673 ? JSON.parse(localStorage.getItem("localStoreTableData"))
663 : []; 674 : [];
664 - const target = localStoreTableData.find(  
665 - (item) => item.id === row.id  
666 - ); 675 + const target = localStoreTableData.find((item) => item.id === row.id);
667 if (!proxy.$route.query.scanTaskId || target) { 676 if (!proxy.$route.query.scanTaskId || target) {
668 localStoreTableData = localStoreTableData.filter( 677 localStoreTableData = localStoreTableData.filter(
669 (item) => item.id !== row.id 678 (item) => item.id !== row.id
Please register or login to post a comment