ソースを参照

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

+ 4 - 0
pages/publicClue/index.vue

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

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

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

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

@@ -1,36 +1,41 @@
1
 <template>
1
 <template>
2
     <view class="more-info-wrapper">
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
                 </view>
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
                 </view>
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
         </u-modal>
39
         </u-modal>
35
     </view>
40
     </view>
36
 </template>
41
 </template>
@@ -42,8 +47,17 @@ export default {
42
         moreOptions: {
47
         moreOptions: {
43
             type: Object,
48
             type: Object,
44
             default: () => { }
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
     data() {
61
     data() {
48
         return {
62
         return {
49
             show: false,
63
             show: false,
@@ -53,14 +67,31 @@ export default {
53
         showMoreInfo() {
67
         showMoreInfo() {
54
             this.show = true;
68
             this.show = true;
55
         },
69
         },
56
-        closeModal() {
70
+        confirmModal() {
71
+            this.$emit('confirm', this.moreOptions);
72
+        },
73
+        closeModal(){
57
             this.show = false;
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
     height: 0;
104
     height: 0;
74
     overflow: hidden;
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
 </style>
117
 </style>

+ 4 - 1
pages/wareHouse/index.vue

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