Преглед на файлове

feat:一键复制、二次提示 其他优化

zhangxin преди 1 месец
родител
ревизия
8e2df9e51f
променени са 5 файла, в които са добавени 115 реда и са изтрити 43 реда
  1. 2 2
      manifest.json
  2. 4 0
      pages/publicClue/index.vue
  3. 28 4
      pages/wareHouse/components/edit.vue
  4. 77 36
      pages/wareHouse/components/moreInfo.vue
  5. 4 1
      pages/wareHouse/index.vue

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
2 2
     "name" : "小葫芦",
3 3
     "appid" : "__UNI__DDAE2E0",
4 4
     "description" : "",
5
-    "versionName" : "1.3.0",
6
-    "versionCode" : 130,
5
+    "versionName" : "1.3.1",
6
+    "versionCode" : 131,
7 7
     "transformPx" : false,
8 8
     "app-plus" : {
9 9
         "webView" : {

+ 4 - 0
pages/publicClue/index.vue

@@ -57,6 +57,8 @@
57 57
 					<qiun-data-charts type="line" :chartData="chartData" canvasId="trendChart" :opts="opts" :ontouch="true" tooltipFormat="tooltipFormatPrice"
58 58
 						width="700rpx" height="500rpx" backgroundColor="#ffffff" @getIndex="handleChartClick" />
59 59
 				</view>
60
+				<u--text v-if="tableData.length > 0" :text="'日期:' + date"></u--text>
61
+				<Table ref="customTable" v-if="tableData.length > 0" :tableData="tableData" height="100px" :columns="columns" stripe></Table>
60 62
 			</view>
61 63
 		</u-modal>
62 64
 		
@@ -75,6 +77,7 @@
75 77
 	import post from "@/pages/clue/post/index.vue";
76 78
 	import sort from "@/pages/clue/components/sort.vue";
77 79
 	import filterQuery from "@/pages/clue/components/filterQuery.vue";
80
+	import Table from '@/components/custom-table/index.vue'
78 81
 	export default {
79 82
 		onPullDownRefresh() {
80 83
 			uni.stopPullDownRefresh();
@@ -84,6 +87,7 @@
84 87
 			post,
85 88
 			sort,
86 89
 			filterQuery,
90
+			Table,
87 91
 		},
88 92
 		mixins: [clue],
89 93
 		onLoad() {

+ 28 - 4
pages/wareHouse/components/edit.vue

@@ -257,9 +257,10 @@
257 257
             </view>
258 258
         </view>
259 259
         <view :class="['btn_group', {'col-2': formData.stockStatus == '1'}]">
260
-            <u-button plain type="primary" @click="submitForm('onlyIn')">保存</u-button>
261
-            <u-button type="primary" @click="submitForm('inAndUp')" v-if="formData.stockStatus == '1'">入库并上架</u-button>
260
+            <u-button plain type="primary" @click="openInfoModal('onlyIn')">保存</u-button>
261
+            <u-button type="primary" @click="openInfoModal('inAndUp')" v-if="formData.stockStatus == '1'">入库并上架</u-button>
262 262
         </view>
263
+        <moreInfo ref="moreInfoRef" :moreOptions="moreOptions" @confirm="handleMoreInfoConfirm" :isCopy="true" :showCancelButton="true"></moreInfo>
263 264
     </view>
264 265
 </template>
265 266
 <script>
@@ -269,6 +270,7 @@ import BrandList from '@/components/brand-list/index.vue'
269 270
 import ImgsRowScroll from '@/components/imgs-row-scroll/index.vue'
270 271
 import PersonPicker from '@/components/person-picker/index.vue'
271 272
 import { permissionCheck,getRoles } from '@/utils/util.js'
273
+import moreInfo from './moreInfo.vue'
272 274
 import { productConditionList,productAttributeList,stockStatusList,recycleTypeList,labelList,paymentTabList } from '../js/public.js'
273 275
 export default {
274 276
     components: {
@@ -276,7 +278,8 @@ export default {
276 278
         Cell,
277 279
         BrandList,
278 280
         ImgsRowScroll,
279
-        PersonPicker
281
+        PersonPicker,
282
+        moreInfo
280 283
     },
281 284
     data() {
282 285
         return {
@@ -392,6 +395,8 @@ export default {
392 395
             recycleTypeList: recycleTypeList,
393 396
             labelList: labelList,
394 397
             paymentTabList: paymentTabList,
398
+            moreOptions: {},
399
+            
395 400
         }
396 401
     },
397 402
     onLoad(options) {
@@ -463,9 +468,27 @@ export default {
463 468
                 this.typeList = res
464 469
             })
465 470
         },
471
+        openInfoModal(submitType) {
472
+            this.$refs.addForm.validate().then(() => {
473
+                this.submitType = submitType
474
+                this.moreOptions = {
475
+                    dictLabel: this.formData.dictLabel || '',
476
+                    origin: this.formData.origin || '',
477
+                    actualPrice: this.formData.actualPrice || '',
478
+                    model: this.formData.model || '',
479
+                    indentifyCode: this.formData.indentifyCode || '',
480
+                    cardYear: this.formData.cardYear || '',
481
+                    productDesc: this.formData.productDesc || '',
482
+                }
483
+                this.$refs.moreInfoRef.showMoreInfo();
484
+            })
485
+        },
486
+        handleMoreInfoConfirm() {
487
+            if(!permissionCheck('WAREHOUSER')) return false
488
+            this.submitForm(this.submitType)
489
+        },
466 490
         // 提交表单
467 491
         submitForm(submitType) {
468
-            if(!permissionCheck('WAREHOUSER')) return false
469 492
             this.$refs.addForm.validate().then((valid) => {
470 493
                 if (valid) {
471 494
                     if (this.formData.title == '') {
@@ -477,6 +500,7 @@ export default {
477 500
                         submitType: submitType, //提交类型 onlyIn:仅入库/暂存入库 inAndUp:入库并上架
478 501
                         continuousWarehousing: this.continuousWarehousing[0] || '0',//是否连续入库 1:是 0:否
479 502
                     }
503
+                    this.$refs.moreInfoRef.closeModal();
480 504
                     if(this.formType == 'add'){
481 505
                         uni.$u.api.wareHouseAdd(data).then(res => {
482 506
                             uni.$u.toast('操作成功');

+ 77 - 36
pages/wareHouse/components/moreInfo.vue

@@ -1,36 +1,41 @@
1 1
 <template>
2 2
     <view class="more-info-wrapper">
3
-        <u-modal :show="show" @confirm="closeModal">
4
-            <div class="more-info">
5
-                <view class="modal-item">
6
-                    <text>品牌:</text>
7
-                    <text>{{ moreOptions.dictLabel || '-' }}</text>
3
+        <u-modal :show="show" @confirm="confirmModal" :showCancelButton="showCancelButton" @cancel="closeModal" @close="closeModal">
4
+            <view class="modal-content">
5
+                <view class="more-info">
6
+                    <view class="modal-item">
7
+                        <text>品牌:</text>
8
+                        <text>{{ moreOptions.dictLabel || '-' }}</text>
9
+                    </view>
10
+                    <view class="modal-item">
11
+                        <text>来源:</text>
12
+                        <text>{{ moreOptions.origin || '-' }}</text>
13
+                    </view>
14
+                    <view class="modal-item">
15
+                        <text>实价:</text>
16
+                        <text>¥{{ moreOptions.actualPrice || '-' }}</text>
17
+                    </view>
18
+                    <view class="modal-item">
19
+                        <text>型号:</text>
20
+                        <text>{{ moreOptions.model || '-' }}</text>
21
+                    </view>
22
+                    <view class="modal-item">
23
+                        <text>编码:</text>
24
+                        <text>{{ moreOptions.indentifyCode || '-' }}</text>
25
+                    </view>
26
+                    <view class="modal-item">
27
+                        <text>日期:</text>
28
+                        <text>{{ moreOptions.cardYear || '-' }}</text>
29
+                    </view>
30
+                    <view class="modal-item">
31
+                        <text>备注:</text>
32
+                        <text>{{ moreOptions.productDesc || '-' }}</text>
33
+                    </view>
8 34
                 </view>
9
-                <view class="modal-item">
10
-                    <text>来源:</text>
11
-                    <text>{{ moreOptions.origin || '-' }}</text>
35
+                <view v-if="isCopy">
36
+                    <u-button type="primary" text="一键复制" size="small" @click="copy"></u-button>
12 37
                 </view>
13
-                <view class="modal-item">
14
-                    <text>实价:</text>
15
-                    <text>¥{{ moreOptions.costPrice || '-' }}</text>
16
-                </view>
17
-                <view class="modal-item">
18
-                    <text>型号:</text>
19
-                    <text>{{ moreOptions.model || '-' }}</text>
20
-                </view>
21
-                <view class="modal-item">
22
-                    <text>编码:</text>
23
-                    <text>{{ moreOptions.indentifyCode || '-' }}</text>
24
-                </view>
25
-                <view class="modal-item">
26
-                    <text>日期:</text>
27
-                    <text>{{ recycleTimeFormatter(moreOptions.recycleTime) || '-' }}</text>
28
-                </view>
29
-                <view class="modal-item">
30
-                    <text>备注:</text>
31
-                    <text>{{ moreOptions.productDesc || '-' }}</text>
32
-                </view>
33
-            </div>
38
+            </view>
34 39
         </u-modal>
35 40
     </view>
36 41
 </template>
@@ -42,8 +47,17 @@ export default {
42 47
         moreOptions: {
43 48
             type: Object,
44 49
             default: () => { }
45
-        }
50
+        },
51
+        isCopy: {
52
+            type: Boolean,
53
+            default: false
54
+        },
55
+        showCancelButton: {
56
+            type: Boolean,
57
+            default: false
58
+        },
46 59
     },
60
+    emits: ['confirm'],
47 61
     data() {
48 62
         return {
49 63
             show: false,
@@ -53,14 +67,31 @@ export default {
53 67
         showMoreInfo() {
54 68
             this.show = true;
55 69
         },
56
-        closeModal() {
70
+        confirmModal() {
71
+            this.$emit('confirm', this.moreOptions);
72
+        },
73
+        closeModal(){
57 74
             this.show = false;
58 75
         },
59
-        recycleTimeFormatter(val) {
60
-            if (val) {
61
-                return this.$dayjs(val).format('YYYY-MM-DD HH:mm:ss')
62
-            }
63
-            return '-'
76
+        copy() {
77
+            const { dictLabel, origin, actualPrice, model, indentifyCode, cardYear, productDesc } = this.moreOptions;
78
+            const copyText = `品牌:${dictLabel || '-'}\n来源:${origin || '-'}\n实价:¥${actualPrice || '-'}\n型号:${model || '-'}\n编码:${indentifyCode || '-'}\n日期:${cardYear || '-'}\n备注:${productDesc || '-'}`;
79
+            
80
+            uni.setClipboardData({
81
+                data: copyText,
82
+                success: () => {
83
+                    uni.showToast({
84
+                        title: '复制成功',
85
+                        icon: 'none'
86
+                    })
87
+                },
88
+                fail: () => {
89
+                    uni.showToast({
90
+                        title: '复制失败',
91
+                        icon: 'none'
92
+                    })
93
+                }
94
+            })
64 95
         }
65 96
     }
66 97
 }
@@ -73,4 +104,14 @@ export default {
73 104
     height: 0;
74 105
     overflow: hidden;
75 106
 }
107
+::v-deep .modal-content{
108
+    width:90%;
109
+}
110
+::v-deep .u-modal__content{
111
+    padding:24rpx 0;
112
+}
113
+.modal-content{
114
+    display: flex;
115
+    justify-content: space-between;
116
+}
76 117
 </style>

+ 4 - 1
pages/wareHouse/index.vue

@@ -148,7 +148,7 @@
148 148
 		<view class="add-button" @click="handleEdit">
149 149
 			<u-icon name="plus" size="36" color="#ffffff"></u-icon>
150 150
 		</view>
151
-		<moreInfo ref="moreInfoRef" :moreOptions="moreOptions"></moreInfo>
151
+		<moreInfo ref="moreInfoRef" :moreOptions="moreOptions" @confirm="handleMoreInfoConfirm"></moreInfo>
152 152
 	</view>
153 153
 </template>
154 154
 <script>
@@ -250,6 +250,9 @@ export default {
250 250
 			this.moreOptions = goods;
251 251
 			this.$refs.moreInfoRef.showMoreInfo();
252 252
 		},
253
+		handleMoreInfoConfirm() {
254
+			this.$refs.moreInfoRef.closeModal();
255
+		},
253 256
 		getTypeList() {
254 257
 			this.$getDicts("crm_form_category").then(res => {
255 258
 				this.tabList = [...res]