jufubao-admin-library 1.0.0-beta1

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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -0
  3. package/library/gulpfile.js/const.js +51 -0
  4. package/library/gulpfile.js/index.js +237 -0
  5. package/library/gulpfile.js/util.js +114 -0
  6. package/library/viewModules/config.js +75 -0
  7. package/library/viewModules/viewStat/router/supplierStat.js +33 -0
  8. package/library/viewModules/viewStat/schemas/supplier.stat.js +70 -0
  9. package/library/viewModules/viewStat/schemas.js +18 -0
  10. package/library/viewModules/viewStat/viewsStat/index/components/stat-all.vue +233 -0
  11. package/library/viewModules/viewStat/viewsStat/index/components/stat-product.vue +129 -0
  12. package/library/viewModules/viewStat/viewsStat/index/components/stat-supplier.vue +124 -0
  13. package/library/viewModules/viewStat/viewsStat/index/components/table-category.vue +309 -0
  14. package/library/viewModules/viewStat/viewsStat/index/components/table-product.vue +316 -0
  15. package/library/viewModules/viewStat/viewsStat/index/components/table-supplier.vue +276 -0
  16. package/library/viewModules/viewStat/viewsStat/index/index.vue +117 -0
  17. package/library/viewModules/viewTask/router/tasks.js +34 -0
  18. package/library/viewModules/viewTask/schemas/tasks.js +52 -0
  19. package/library/viewModules/viewTask/viewTask/list.vue +195 -0
  20. package/library/viewModules/viewsEnterpriseBuy/router/enterprise_buy.js +91 -0
  21. package/library/viewModules/viewsEnterpriseBuy/schemas/enterprise_buy.js +420 -0
  22. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/OrderInfoButton.vue +550 -0
  23. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/cardList.vue +119 -0
  24. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/expressCopy.vue +259 -0
  25. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/operateHistory.vue +164 -0
  26. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/send_list.vue +395 -0
  27. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/storeList.vue +100 -0
  28. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/workHistory.vue +163 -0
  29. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/detail.vue +503 -0
  30. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/list.vue +635 -0
  31. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/order_detail.vue +860 -0
  32. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/set_create.vue +219 -0
  33. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/set_list.vue +237 -0
  34. package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/table-card.vue +180 -0
  35. package/library/viewModules/viewsFinance/router/balance.js +75 -0
  36. package/library/viewModules/viewsFinance/router/finance.js +30 -0
  37. package/library/viewModules/viewsFinance/schemas/trade.record.js +153 -0
  38. package/library/viewModules/viewsFinance/schemas/wallet.js +116 -0
  39. package/library/viewModules/viewsFinance/viewsFinance/balance/components/listChannel.vue +220 -0
  40. package/library/viewModules/viewsFinance/viewsFinance/balance/components/listOpenapi.vue +260 -0
  41. package/library/viewModules/viewsFinance/viewsFinance/balance/components/listPartner.vue +217 -0
  42. package/library/viewModules/viewsFinance/viewsFinance/balance/components/listSupplier.vue +229 -0
  43. package/library/viewModules/viewsFinance/viewsFinance/balance/detail_channel.vue +401 -0
  44. package/library/viewModules/viewsFinance/viewsFinance/balance/detail_openapi.vue +364 -0
  45. package/library/viewModules/viewsFinance/viewsFinance/balance/detail_partner.vue +633 -0
  46. package/library/viewModules/viewsFinance/viewsFinance/balance/detail_supplier.vue +417 -0
  47. package/library/viewModules/viewsFinance/viewsFinance/balance/list.vue +75 -0
  48. package/library/viewModules/viewsFinance/viewsFinance/index.vue +191 -0
  49. package/library/viewModules/viewsLimit/router/buyLimit/buyLimit.js +31 -0
  50. package/library/viewModules/viewsLimit/schemas/buyLimit.js +22 -0
  51. package/library/viewModules/viewsLimit/viewsLimit/index.vue +211 -0
  52. package/package.json +114 -0
@@ -0,0 +1,503 @@
1
+ <template>
2
+ <div class="app-container">
3
+ <el-card class="app-container__list">
4
+ <div class="app-container__list-name">
5
+ <div>{{baseData.main_order.purchase_name}} ({{baseData.main_order.order_status_name}})</div>
6
+ <div>
7
+ <order-button
8
+ v-if="isOperate"
9
+ :events="buttonData"
10
+ :purchase_main_order_id="id"
11
+ @refresh="handeleRefresh"
12
+ @confirmPrice="handleConfirmPrice"
13
+ ></order-button>
14
+ </div>
15
+ </div>
16
+ </el-card>
17
+ <el-card class="app-container__list">
18
+ <table-card :orderData="baseData" :key="baseKey"></table-card>
19
+ </el-card>
20
+ <el-card class="app-container__list">
21
+ <div class="mb-10">商品({{product_num}}个)</div>
22
+ <div class="mb-10">配送至 <i class="el-icon-location-information"></i>{{baseData.main_order.receipt_province_name}}{{baseData.main_order.receipt_city_name}}{{baseData.main_order.receipt_area_name}}{{baseData.main_order.receipt_street_name}}{{baseData.main_order.receipt_address_detail}}</div>
23
+ <div class="app-container__list-table">
24
+ <xd-table
25
+ :default-select="['12987122','12987126']"
26
+ :get-link="getLink"
27
+ :headers="orderHeaders"
28
+ :key="tableKey"
29
+ :list="tables"
30
+ :hasExpand="true"
31
+ :stripe="false"
32
+ default-expand-all
33
+ >
34
+ <template slot="expand" slot-scope="scope1">
35
+ <xd-table
36
+ is-border
37
+ :stripe="false"
38
+ :show-header="false"
39
+ :key="childKey"
40
+ :get-link="getLinkChild"
41
+ :headers="orderHeadersIn"
42
+ :list="scope1.row.order_products"
43
+ default-expand-all
44
+ :custom-function="item=>handleInCustom(item,scope1.row)"
45
+ >
46
+ <template slot="info" slot-scope="scope">
47
+ <xd-store-product
48
+ :key="tableRefresh"
49
+ :list="getProductInfo(scope.row)"
50
+ width="60"
51
+ height="60"
52
+ ></xd-store-product>
53
+ </template>
54
+ <template slot="sale_price_slot" slot-scope="scope">
55
+ <div style="font-size:14px">
56
+ <span class="red">¥{{scope.row.sale_price}}</span><i style="margin-left:5px;cursor:pointer" v-if="scope.row.is_can_edit_amount===1" @click="changeSalePrice(scope.row,scope.$index,scope)" class="el-icon-edit-outline"></i>
57
+ </div>
58
+ </template>
59
+ <template slot="supplier_settlement_amount" slot-scope="scope">
60
+ <div v-if="scope.row.is_can_edit_amount===1">
61
+ <el-input v-model="scope.row.supplier_settlement_amount" type="number" @change="handleChangeAmount(scope.row.supplier_settlement_amount,scope1)" placeholder="请输入清单结算金额"></el-input>
62
+ <span class="red">结算金额为最终支付金额</span>
63
+ </div>
64
+ <div v-else>
65
+ <span class="red">{{scope.row.supplier_settlement_amount}}</span>元
66
+ </div>
67
+ </template>
68
+ </xd-table>
69
+ </template>
70
+ </xd-table>
71
+ </div>
72
+ <div style="padding-left: 150px">
73
+ <el-button @click="goBack" type="primary">返回</el-button>
74
+ </div>
75
+ </el-card>
76
+ <xd-dialog
77
+ title="单价"
78
+ v-if="dialogVisiblePrice"
79
+ :show.sync="dialogVisiblePrice"
80
+ width="40%"
81
+ @onConfirm="handlePrice"
82
+ @onClose="dialogVisiblePrice = false"
83
+ @onCancel="dialogVisiblePrice = false"
84
+ >
85
+ <xd-base-dynamic-field
86
+ ref="rule"
87
+ v-if="listFormPrice.length > 0"
88
+ v-model="listValuePrice"
89
+ :key="renderFormPriceKey"
90
+ :list="listFormPrice"
91
+ label-width="140px"
92
+ ></xd-base-dynamic-field>
93
+ </xd-dialog>
94
+ </div>
95
+ </template>
96
+
97
+
98
+ <script>
99
+ import XdBaseDynamicField from "@/components/XdBaseDynamicField"
100
+ import { getOptions } from "@/utils/options"
101
+ import { Loading } from 'element-ui'
102
+ import checkPermission from "@/utils/permission"
103
+ import XdSelectList from "@/components/XdSelectList"
104
+ import XdSelectRemote from "@/components/XdSelectRemote"
105
+ import XdTable from "@/components/XdTable"
106
+ import TableCard from "./table-card"
107
+ import XdStoreProduct from "@/components/XdStoreProduct"
108
+ import orderButton from "./compontents/OrderInfoButton"
109
+ import XdDialog from "@/components/XdDialog"
110
+ import permissions from "@/constant/permissions"
111
+ import {
112
+ mapActions,
113
+ mapState,
114
+ } from 'vuex'
115
+
116
+ export default {
117
+ name: "userPondDetail",
118
+ components: {
119
+ XdBaseDynamicField,
120
+ XdSelectList,
121
+ XdSelectRemote,
122
+ TableCard,
123
+ XdTable,
124
+ XdStoreProduct,
125
+ orderButton,
126
+ XdDialog
127
+ },
128
+ data () {
129
+ TableCard
130
+ return {
131
+ formList: null,
132
+ formParams: {},
133
+ id: null,
134
+ renderFormKey: Date.now(),
135
+ customForm: {
136
+ company_id: '',
137
+ department_id: '',
138
+ },
139
+ customRules: {},
140
+ orderHeaders:[
141
+ // { type: 'selection' },
142
+ { type: 'expand', hide: true },
143
+ { "type": "normal", "prop": "base", "align": "center","minWidth": 300, "label": "商品信息" },
144
+ { "type": "normal", "prop": "brand_name", "width": 150, "align": "center", "label": "品牌" },
145
+ // #ifdef partner-wholesale
146
+ { "type": "price", "prop": "sale_price", "align": "center", "label": "单价(元)" },
147
+ { "type": "price", "prop": "min_sale_price", "align": "center","width": 150, "label": "最低售价(元)" },
148
+ // #endif
149
+ // #ifdef admin oa-finance
150
+ { "type": "price", "prop": "dist_price", "align": "center", "label": "分销价(元)" },
151
+ // #endif
152
+ { "type": "normal", "prop": "product_num", "align": "center", "label": "数量" },
153
+ // #ifdef partner-wholesale
154
+ { "type": "price", "prop": "sale_amount1", "align": "center", "label": "小计" },
155
+ // #endif
156
+ // #ifdef admin oa-finance
157
+ { "type": "price", "prop": "dist_amount1", "align": "center", "label": "小计" },
158
+ // #endif
159
+ { "type": "price", "prop": "total_amount1", "align": "center", "label": "订单金额" },
160
+ { "type": "normal", "prop": "supplier_name1", "align": "center", "label": "供应商" },
161
+ // #ifdef admin
162
+ { "type": "normal", "prop": "supplier_settlement_amount1", "align": "center","width":170, "label": "供应商结算金额" },
163
+ // #endif
164
+ // #ifdef oa-finance
165
+ { "type": "price", "prop": "supplier_settlement_amount1", "align": "center","width":170, "label": "实际结算货款" },
166
+ // #endif
167
+ ],
168
+ orderHeadersIn:[
169
+ { "type": "normal", "prop": "info", "align": "center","minWidth": 300, "label": "商品信息" },
170
+ { "type": "normal", "prop": "brand_name", "width": 150, "align": "center", "label": "品牌" },
171
+ // #ifdef partner-wholesale
172
+ { "type": "normal", "prop": "sale_price_slot", "align": "center", "label": "单价(元)" },
173
+ { "type": "price", "prop": "min_sale_price", "align": "center","width": 150, "label": "最低售价(元)" },
174
+ // #endif
175
+ // #ifdef admin oa-finance
176
+ { "type": "price", "prop": "dist_price", "align": "center", "label": "分销价(元)" },
177
+ // #endif
178
+ { "type": "normal", "prop": "product_num", "align": "center", "label": "数量" },
179
+ // #ifdef partner-wholesale
180
+ { "type": "price", "prop": "sale_amount", "align": "center", "label": "小计" },
181
+ // #endif
182
+ // #ifdef admin oa-finance
183
+ { "type": "price", "prop": "dist_amount", "align": "center", "label": "小计" },
184
+ // #endif
185
+ // #ifdef oa-finance admin
186
+ { "type": "price", "prop": "sub_dist_amount", "align": "center", "label": "订单金额" },
187
+ // #endif
188
+ // #ifdef partner-wholesale
189
+ { "type": "price", "prop": "total_amount", "align": "center", "label": "订单金额" },
190
+ // #endif
191
+ { "type": "normal", "prop": "supplier_name", "align": "center", "label": "供应商" },
192
+ // #ifdef admin
193
+ { "type": "normal", "prop": "supplier_settlement_amount", "align": "center","width":170, "label": "供应商结算金额" },
194
+ // #endif
195
+ // #ifdef oa-finance
196
+ { "type": "price", "prop": "actual_settlement_amount", "align": "center","width":170, "label": "实际结算货款" },
197
+ // #endif
198
+ ],
199
+ tables:[],
200
+ renderTableKey:'renderTableKey',
201
+ isJump:false,
202
+ baseData:null,
203
+ tableKey:'tableKey',
204
+ baseKey:'baseKey',
205
+ childKey:'childKey',
206
+ tableRefresh:'tableRefresh',
207
+ buttonData: [],
208
+ //修改商品价格
209
+ dialogVisiblePrice:false,
210
+ listFormPrice:[],
211
+ listValuePrice:{},
212
+ renderFormPriceKey:'renderFormPriceKey',
213
+ changeIndex:'',
214
+ changeRow:null,
215
+ product_num:0,
216
+ }
217
+ },
218
+ computed: {
219
+ isOperate(){
220
+ return checkPermission([permissions.enterprise_buy.purchaseDetailOperate])
221
+ },
222
+ },
223
+ created () {
224
+ this.id = this.$route.params.id
225
+ if (this.id) {
226
+ this.getOrderDetail();
227
+ }
228
+ },
229
+
230
+ methods: {
231
+ ...mapActions('enterprise_buy', [
232
+ 'purchaseMainOrderInfo',
233
+ 'userSettlementPrice',
234
+ 'supplierSettlementAmountBatch'
235
+ ]),
236
+ getOrderDetail(){
237
+ let params = {
238
+ purchase_main_order_id: this.id
239
+ }
240
+ this.purchaseMainOrderInfo(params).then(res => {
241
+ this.baseData = res.data.order
242
+ this.tables = res.data.order.sub_orders
243
+ this.buttonData = res['data']['order']['buttons']
244
+ let product_num = 0;
245
+ this.tables.map(item=>{
246
+ item.supplier_settlement_amount = this.$xdHelper.divisionFloatNumber(item.supplier_settlement_amount,100)
247
+ product_num+=item.order_products.length
248
+ item.order_products.map(ls=>{
249
+ ls.supplier_name = item.supplier_name
250
+ ls.total_amount = item.total_amount
251
+ ls.sale_price = this.$xdHelper.divisionFloatNumber(ls.sale_price, 100)
252
+ ls.purchase_sub_order_id = item.purchase_sub_order_id
253
+ ls.supplier_settlement_amount = item.supplier_settlement_amount
254
+ ls.supplier_settlement_amount_finace = item.supplier_settlement_amount
255
+ ls.actual_settlement_amount = item.actual_settlement_amount
256
+ if(item.dist_amount){
257
+ ls.sub_dist_amount = item.dist_amount
258
+ }
259
+ if(item.is_can_edit_amount||item.is_can_edit_amount===0){
260
+ ls.is_can_edit_amount = item.is_can_edit_amount
261
+ }
262
+ })
263
+ })
264
+ this.product_num = product_num;
265
+ console.log(this.tables,product_num,'this.tables')
266
+ this.baseKey = Date.now()
267
+ }).catch(err => {
268
+ console.log(err, 'err')
269
+ })
270
+ },
271
+ /**
272
+ * @description 预设获取页面跳转地址方法
273
+ * @param item
274
+ */
275
+ getLink (item) {
276
+ return '/users/detail/1'
277
+ },
278
+ getLinkChild(){
279
+ return '/users/detail/1'
280
+ },
281
+ handleTableClick ({ row, value, index, rowIndex }) {
282
+
283
+ },
284
+ //修改商品价格
285
+ changeSalePrice(row,index,aa){
286
+ console.log(row,index,aa,'rrrrr')
287
+ this.changeRow = row
288
+ this.changeIndex = index
289
+ this.initFormPrice(row)
290
+ },
291
+ //设置结算金额form初始化
292
+ initFormPrice (row) {
293
+ this.listFormPrice = [
294
+ {
295
+ label: '商品名称:', //label
296
+ ele: 'el-input', //package 名称
297
+ type: 'text',
298
+ valueKey: 'product_name', //form[valueKey]
299
+ value: row.product_name, //v-model
300
+ placeholder: '输入商品名称',
301
+ classNmae: 'input40',
302
+ disabled:true,
303
+ rules: [
304
+ {
305
+ required: true,
306
+ message: '请输入商品名称',
307
+ trigger: 'blur'
308
+ },
309
+ ]
310
+ },
311
+ {
312
+ label: '单价(元):', //label
313
+ ele: 'el-input', //package 名称
314
+ type: 'text',
315
+ valueKey: 'sale_price', //form[valueKey]
316
+ value: row.sale_price, //v-model
317
+ placeholder: '输入单价',
318
+ classNmae: 'input40',
319
+ rules: [
320
+ {
321
+ required: true,
322
+ message: '请输入单价',
323
+ trigger: 'blur'
324
+ },
325
+ ]
326
+ },
327
+ ]
328
+
329
+ this.renderFormPriceKey = Date.now()
330
+ this.dialogVisiblePrice = true
331
+ },
332
+ //修改价格确认
333
+ handlePrice(){
334
+ console.log(this.changeRow,'ddddd')
335
+ let data = {
336
+ purchase_main_order_id:this.id,
337
+ items:[
338
+ {
339
+ purchase_sub_order_id:this.changeRow.purchase_sub_order_id,
340
+ items:[
341
+ {
342
+ product_id:this.changeRow.product_id,
343
+ product_sku_id:this.changeRow.product_sku_id,
344
+ amount:this.$xdHelper.multiplyFloatNumber(this.listValuePrice.sale_price,100),
345
+ }
346
+ ]
347
+ }
348
+ ]
349
+ }
350
+ this.userSettlementPrice(data).then(res=>{
351
+ this.listValuePrice = {}
352
+ this.dialogVisiblePrice = false
353
+ this.$message({
354
+ message: '修改价格成功',
355
+ type: 'success'
356
+ })
357
+ this.getOrderDetail()
358
+ console.log(res,'sss')
359
+ }).catch(err=>{
360
+ console.log(err,'eeee')
361
+ })
362
+ },
363
+ getProductInfo (value) {
364
+ return {
365
+ id: value.product_id,
366
+ title: value.product_name,
367
+ thumb: this.getImageFullPath(value.product_thumb),
368
+ specific: value.product_sku_name, params: { width: 150, height: 150 },
369
+ }
370
+ },
371
+
372
+ handleInCustom ({ action, data }, row) {
373
+ if (action === 'merge') {
374
+ let mergeRow = 1
375
+ let maxRow = 100 //需要合并的最大行数
376
+ let { row, column, rowIndex, columnIndex } = data
377
+ let mergeColumns = [];
378
+ //rowIndex,columnIndex的值是从0开始
379
+ // #ifdef admin oa-finance
380
+ mergeColumns = [5,6,7] //第4列需要合并行,并且合并到数组最大值,
381
+ // #endif
382
+ // #ifdef partner-wholesale
383
+ mergeColumns = [6,7,8] //第4列需要合并行,并且合并到数组最大值,
384
+ // #endif
385
+ const check = (i) => {
386
+ return mergeColumns.filter(key => {
387
+ return key === i
388
+ }).length > 0
389
+ }
390
+
391
+ if (rowIndex === 0) {
392
+ if (check(columnIndex)) {
393
+ return [maxRow, 1]
394
+ } else return [1, 1]
395
+ } else {
396
+ if (check(columnIndex)) {
397
+ return [0, 0]
398
+ } else return [1, 1]
399
+ }
400
+ }
401
+ },
402
+ //确定价格(超管)
403
+ handleConfirmPrice(e){
404
+ console.log(this.tables,'dddddd')
405
+ let copyData = this.$xdHelper.cloneDeep(this.tables)
406
+ let reg = /^\d+.?\d{0,2}$/
407
+ for(var i=0;i<copyData.length;i++){
408
+ if(!copyData[i]['supplier_settlement_amount']){
409
+ this.$message.error('请输入供应商结算金额且数值需大于0')
410
+ return
411
+ }
412
+ if(!reg.test(Number(copyData[i]['supplier_settlement_amount']))){
413
+ this.$message.error('小数点后最多保留两位小数')
414
+ return
415
+ }
416
+ if(copyData[i]['supplier_settlement_amount']){
417
+ copyData[i]['amount'] = this.$xdHelper.multiplyFloatNumber(Number(copyData[i]['supplier_settlement_amount']),100)
418
+ }
419
+ }
420
+ console.log(copyData,'ccc')
421
+ let data = {
422
+ purchase_main_order_id:this.id,
423
+ items:copyData
424
+ }
425
+ this.supplierSettlementAmountBatch(data)
426
+ .then(res=>{
427
+ this.$message({
428
+ message: '确认价格成功',
429
+ type: 'success'
430
+ })
431
+ this.getOrderDetail();
432
+ }).catch(err=>{
433
+ console.log(err,'err')
434
+ })
435
+ },
436
+ //结算金额改变
437
+ handleChangeAmount(value,scope1){
438
+ this.$set(this.tables[scope1['index']],'supplier_settlement_amount',value)
439
+ console.log(this.tables,value,scope1,2222)
440
+ },
441
+ goBack () {
442
+ this.$router.go(-1)
443
+ },
444
+ handeleRefresh(){
445
+ this.getOrderDetail();
446
+ },
447
+ }
448
+ }
449
+
450
+ </script>
451
+
452
+ <style scoped lang="scss">
453
+ .header-item {
454
+ padding: 0 20px;
455
+ font-size: 14px;
456
+ }
457
+
458
+ .show {
459
+ padding: 0 0 10px 0;
460
+ margin-bottom: 10px;
461
+ border-bottom: 1px solid #e5e5e5;
462
+ display: flex;
463
+ justify-content: flex-end;
464
+ }
465
+
466
+ .app-container {
467
+ &__link {
468
+ display: flex;
469
+
470
+ &-use {
471
+ display: flex;
472
+ flex-direction: column;
473
+ width: 150px;
474
+ padding: 20px;
475
+ background: #f7f7f7;
476
+ margin-right: 20px;
477
+
478
+ .el-button + .el-button {
479
+ margin-left: 0px;
480
+ margin-top: 30px;
481
+ }
482
+ }
483
+
484
+ &-tabs {
485
+ flex: 1;
486
+ }
487
+ }
488
+ .mb-10{
489
+ margin-bottom: 10px;
490
+ }
491
+ &__list{
492
+ margin-bottom: 10px;
493
+ &-name{
494
+ display: flex;
495
+ justify-content: space-between;
496
+ }
497
+ }
498
+ }
499
+ .red{
500
+ color: red!important;
501
+ }
502
+ </style>
503
+