| | |
| | | <el-tab-pane label="å°±å°å¯å" name="local"> |
| | | <div class="price-tip">æ ¹æ®è¡æå°ºå¯¸ä»¥ååæ¾å¤©æ°æ¶è´¹ï¼ä¸è¶³ä¸å¤©æä¸å¤©è®¡ä»·ï¼</div> |
| | | <div class="price-items"> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸å¤§ä»¶è¡ææ¯å¤©æ¶è´¹</span> |
| | | <el-input style="width: 200px;" v-model="form.bigPriceDay" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">å
</span> |
| | | </div> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸ä¸ä»¶è¡ææ¯å¤©æ¶è´¹</span> |
| | | <el-input style="width: 200px;" v-model="form.mediumPriceDay" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">å
</span> |
| | | </div> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸å°ä»¶è¡ææ¯å¤©æ¶è´¹</span> |
| | | <el-input style="width: 200px;" v-model="form.smallPriceDay" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <div class="price-item" v-for="(item, index) in jiudiTableData" :key="index"> |
| | | <span class="price-label">å
¶ä¸{{item.categoryName}}æ¯å¤©æ¶è´¹</span> |
| | | <el-input style="width: 200px;" v-model="item.unitPrice" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">å
</span> |
| | | </div> |
| | | </div> |
| | |
| | | <span class="remote-tip">æ ¹æ®è¡æå°ºå¯¸ãé
ééç¨åé
éä»·æ ¼æ¶åè´¹ç¨ï¼ä¸è¶³1å
¬éæ1å
¬é计价ï¼</span> |
| | | </div> |
| | | <el-table :data="remoteTableData" border stripe> |
| | | <el-table-column prop="baggageSize" label="è¡æå°ºå¯¸" min-width="100px"></el-table-column> |
| | | <el-table-column prop="deliveryDistance" label="èµ·ééç¨(å
Ž)" min-width="120px"> |
| | | <el-table-column prop="categoryName" label="è¡æå°ºå¯¸"></el-table-column> |
| | | <el-table-column label="èµ·ééç¨(å
Ž)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.deliveryDistance" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.startDistance" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deliveryPrice" label="èµ·éä»·æ ¼(å
)" min-width="140px"> |
| | | <el-table-column label="èµ·éä»·æ ¼(å
)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.deliveryPrice" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.startPrice" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="sortnum" label="ç»ééç¨(å
Ž)" min-width="80px"> |
| | | <el-table-column label="ç»ééç¨(å
Ž)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.sortnum" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.extraDistance" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="sortnum" label="ç»éä»·æ ¼(å
)" min-width="80px"> |
| | | <el-table-column label="ç»éä»·æ ¼(å
)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.sortnum" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.extraPrice" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <span class="remote-tip">æ ¹æ®é
ééç¨é¢è®¡é
éæ¶é¿å¹¶å±ç¤ºå¨å°ç¨åºä¸å页é¢</span> |
| | | </div> |
| | | <el-table :data="timeTableData" border stripe> |
| | | <el-table-column prop="deliveryDistance" label="èµ·ééç¨(å
Ž)" min-width="120px"> |
| | | <el-table-column label="èµ·ééç¨(å
Ž)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.deliveryDistance" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.startDistance" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deliveryHours" label="èµ·éæ¶é¿(å°æ¶)" min-width="120px"> |
| | | <el-table-column label="èµ·éæ¶é¿(å°æ¶)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.deliveryHours" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.startTime" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="sortnum" label="ç»ééç¨(å
Ž)" min-width="80px"> |
| | | <el-table-column label="ç»ééç¨(å
Ž)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.sortnum" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.continueDistance" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="sortnum" label="ç»éæ¶é¿(å°æ¶)" min-width="80px"> |
| | | <el-table-column label="ç»éæ¶é¿(å°æ¶)"> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.sortnum" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <el-input v-model="row.continueTime" type="number" placeholder="请è¾å
¥"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-tab-pane label="é¨åºæ³¨åæ¼é" name="deposit"> |
| | | <div class="price-tip">æ ¹æ®æå¨åå¸ä»¥å注åç±»åä¸åï¼å¹³å°æ¶åä¸åæ°é¢æ¼éãæ¼éä¼å¨é¨åºéç½å线ä¸åé¢éè¿ï¼é¨åºçº¿ä¸å¾®ä¿¡æ¯ä»çæ¼éå å¾®ä¿¡å®æ¹è¦æ±å
·ææ¶ææ§ï¼</div> |
| | | <div class="price-items"> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸ä¼ä¸æ¶åæ¼é</span> |
| | | <el-input style="width: 200px;" v-model="form.corporateDepositAmount" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">å
</span> |
| | | </div> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸ä¸ªäººæ¶åæ¼é</span> |
| | | <el-input style="width: 200px;" v-model="form.personalDepositAmount" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <div class="price-item" v-for="(item, index) in storeDepositData" :key="index"> |
| | | <span class="price-label">å
¶ä¸{{item.fieldTypeName}}æ¶åæ¼é</span> |
| | | <el-input style="width: 200px;" v-model="item.depositAmount" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">å
</span> |
| | | </div> |
| | | </div> |
| | |
| | | <el-tab-pane label="åææ¯ä¾" name="share"> |
| | | <div class="price-tip">æ ¹æ®è®¢åä¸ä¸åè¿è¥è§è²èç¬ç«é
ç½®ä¸ååææ¯ä¾</div> |
| | | <div class="price-items"> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸é¨åºç±»å为ä¼ä¸å¹¶å¨è®¢åä¸ä½ä¸ºå¯ä»¶ç¹æ¶ï¼åææ¯ä¾ä¸º</span> |
| | | <el-input style="width: 100px;" v-model="form.corporateSenderRatio" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">%</span> |
| | | </div> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸é¨åºç±»å为个人并å¨è®¢åä¸ä½ä¸ºå¯ä»¶ç¹æ¶ï¼åææ¯ä¾ä¸º</span> |
| | | <el-input style="width: 100px;" v-model="form.personalSenderRatio" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">%</span> |
| | | </div> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸é¨åºç±»å为ä¼ä¸å¹¶å¨è®¢åä¸ä½ä¸ºæ¶ä»¶ç¹æ¶ï¼åææ¯ä¾ä¸º</span> |
| | | <el-input style="width: 100px;" v-model="form.corporateReceiverRatio" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">%</span> |
| | | </div> |
| | | <div class="price-item"> |
| | | <span class="price-label">å
¶ä¸é¨åºç±»å为个人并å¨è®¢åä¸ä½ä¸ºæ¶ä»¶ç¹æ¶ï¼åææ¯ä¾ä¸º</span> |
| | | <el-input style="width: 100px;" v-model="form.personalReceiverRatio" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">%</span> |
| | | </div> |
| | | <div class="price-item"> |
| | | <span class="price-label">å¨è®¢åä¸ä½ä¸ºé
éåæ¶ï¼åææ¯ä¾ä¸º</span> |
| | | <el-input style="width: 100px;" v-model="form.deliverRatio" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <div class="price-item" v-for="(item, index) in shareTableData" :key="index"> |
| | | <span class="price-label">{{item.fieldType === 4 ? 'å¨è®¢åä¸ä½ä¸ºé
éåæ¶ï¼' : 'å
¶ä¸é¨åºç±»å为'}}{{item.fieldTypeName}}åææ¯ä¾ä¸º</span> |
| | | <el-input style="width: 100px;" v-model="item.ratio" type="number" placeholder="请è¾å
¥"></el-input> |
| | | <span class="price-unit">%</span> |
| | | </div> |
| | | </div> |
| | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { fetchPriceRule } from '@/api/business/areas' |
| | | import { |
| | | localStorage, |
| | | remoteDelivery, |
| | | estimatedDelivery, |
| | | storeDeposit, |
| | | revenueShare, |
| | | batchSave, |
| | | batchSaveRemoteDelivery, |
| | | batchSaveEstimatedDelivery, |
| | | batchSaveStoreDeposit, |
| | | batchSaveRevenueShare |
| | | } from '@/api/business/pricingRule' |
| | | export default { |
| | | name: 'OperaCityPriceRuleWindow', |
| | | extends: BaseOpera, |
| | |
| | | data () { |
| | | return { |
| | | activeTab: 'local', |
| | | remoteTableData: [ |
| | | { size: 1, a: '', b: '', c: '', d: '' } |
| | | ], |
| | | remotePageIndex: 1, |
| | | remotePageSize: 5, |
| | | remoteTotal: 0, |
| | | |
| | | jiudiTableData: [], |
| | | remoteTableData: [], |
| | | timeTableData: [], |
| | | timePageIndex: 1, |
| | | timePageSize: 5, |
| | | timeTotal: 0, |
| | | storeDepositData: [], |
| | | shareTableData: [], |
| | | |
| | | form: { |
| | | id: null, |
| | | cityName: '', |
| | | bigPrice: '大件', |
| | | bigPriceDay: null, |
| | | mediumPrice: 'ä¸ä»¶', |
| | | mediumPriceDay: null, |
| | | smallPrice: 'å°ä»¶', |
| | | smallPriceDay: null, |
| | | remoteBigPrice: '大件', |
| | | remoteBigPriceDay: null, |
| | | remoteMediumPrice: 'ä¸ä»¶', |
| | | remoteMediumPriceDay: null, |
| | | remoteSmallPrice: 'å°ä»¶', |
| | | remoteSmallPriceDay: null, |
| | | timeLimit: '', |
| | | corporateDeposit: 'ä¼ä¸', |
| | | corporateDepositAmount: null, |
| | | personalDeposit: '个人', |
| | | personalDepositAmount: null, |
| | | corporateType: 'ä¼ä¸', |
| | | corporateSenderRatio: null, |
| | | corporateReceiverRatio: null, |
| | | personalType: '个人', |
| | | personalSenderRatio: null, |
| | | personalReceiverRatio: null, |
| | | deliverType: 'é
éå', |
| | | deliverRatio: null |
| | | cityId: null |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/area', |
| | | api: '/business/pricingRule', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | |
| | | this.title = title |
| | | this.visible = true |
| | | this.activeTab = 'local' |
| | | this.jiudiTableData = [] |
| | | this.remoteTableData = [] |
| | | this.remotePageIndex = 1 |
| | | this.remoteTotal = 0 |
| | | this.timeTableData = [{ |
| | | deliveryDistance: null, |
| | | deliveryHours: null, |
| | | sortnum: null |
| | | }] |
| | | this.timePageIndex = 1 |
| | | this.timeTotal = 0 |
| | | this.timeTableData = [] |
| | | this.storeDepositData = [] |
| | | this.shareTableData = [] |
| | | this.form = { |
| | | id: target.id, |
| | | cityName: target.name, |
| | | bigPrice: '大件', |
| | | bigPriceDay: null, |
| | | mediumPrice: 'ä¸ä»¶', |
| | | mediumPriceDay: null, |
| | | smallPrice: 'å°ä»¶', |
| | | smallPriceDay: null, |
| | | remoteBigPrice: '大件', |
| | | remoteBigPriceDay: null, |
| | | remoteMediumPrice: 'ä¸ä»¶', |
| | | remoteMediumPriceDay: null, |
| | | remoteSmallPrice: 'å°ä»¶', |
| | | remoteSmallPriceDay: null, |
| | | timeLimit: '', |
| | | corporateDeposit: 'ä¼ä¸', |
| | | corporateDepositAmount: null, |
| | | personalDeposit: '个人', |
| | | personalDepositAmount: null, |
| | | corporateType: 'ä¼ä¸', |
| | | corporateSenderRatio: null, |
| | | corporateReceiverRatio: null, |
| | | personalType: '个人', |
| | | personalSenderRatio: null, |
| | | personalReceiverRatio: null, |
| | | deliverType: 'é
éå', |
| | | deliverRatio: null |
| | | cityId: target |
| | | } |
| | | this.loadPriceRule(target.id) |
| | | this.fetchPriceRule() |
| | | this.fetchRemoteDelivery() |
| | | this.fetchEstimatedDelivery() |
| | | this.fetchStoreDeposit() |
| | | this.fetchRevenueShare() |
| | | }, |
| | | loadPriceRule (cityId) { |
| | | fetchPriceRule({ cityId }).then(res => { |
| | | if (res) { |
| | | try { |
| | | const data = typeof res === 'string' ? JSON.parse(res) : res |
| | | if (data.remoteList && Array.isArray(data.remoteList)) { |
| | | this.remoteTableData = data.remoteList |
| | | this.remoteTotal = data.remoteList.length |
| | | } |
| | | if (data.timeList && Array.isArray(data.timeList)) { |
| | | this.timeTableData = data.timeList |
| | | this.timeTotal = data.timeList.length |
| | | } |
| | | Object.assign(this.form, data) |
| | | } catch (e) { |
| | | console.error('Parse price rule failed', e) |
| | | } |
| | | } |
| | | }).catch(e => { |
| | | // æ¥è¯¢å°±å°ååè§åå表 |
| | | fetchPriceRule () { |
| | | localStorage(this.form.cityId) |
| | | .then(data => { |
| | | this.jiudiTableData = data |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | // æ¥è¯¢å¼å°å¯éè§åå表 |
| | | fetchRemoteDelivery () { |
| | | remoteDelivery(this.form.cityId) |
| | | .then(data => { |
| | | this.remoteTableData = data |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | // æ¥è¯¢å¼å°å¯éè§åå表 |
| | | fetchEstimatedDelivery () { |
| | | estimatedDelivery(this.form.cityId) |
| | | .then(data => { |
| | | this.timeTableData = [ |
| | | data |
| | | ] |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | // æ¥è¯¢é¨åºæ³¨åæ¼éè§åå表 |
| | | fetchStoreDeposit () { |
| | | storeDeposit(this.form.cityId) |
| | | .then(data => { |
| | | this.storeDepositData = data |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | // æ¥è¯¢åææ¯ä¾è§åå表 |
| | | fetchRevenueShare () { |
| | | revenueShare(this.form.cityId) |
| | | .then(data => { |
| | | this.shareTableData = data |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | // ä¿åææè§å |
| | | confirm () { |
| | | const submitData = { |
| | | ...this.form, |
| | | remoteList: this.remoteTableData, |
| | | timeList: this.timeTableData |
| | | } |
| | | if (!this.validateLocalStorage()) return |
| | | if (!this.validateRemoteDelivery()) return |
| | | if (!this.validateEstimatedDelivery()) return |
| | | if (!this.validateStoreDeposit()) return |
| | | if (!this.validateRevenueShare()) return |
| | | |
| | | this.isWorking = true |
| | | this.api.updateById(submitData) |
| | | Promise.all([ |
| | | batchSave({ cityId: this.form.cityId, items: this.jiudiTableData }), |
| | | batchSaveRemoteDelivery({ cityId: this.form.cityId, items: this.remoteTableData }), |
| | | batchSaveEstimatedDelivery({ cityId: this.form.cityId, ...this.timeTableData[0] }), |
| | | batchSaveStoreDeposit({ cityId: this.form.cityId, items: this.storeDepositData }), |
| | | batchSaveRevenueShare({ cityId: this.form.cityId, items: this.shareTableData }) |
| | | ]) |
| | | .then(() => { |
| | | this.$tip.apiSuccess('ä¿åæå') |
| | | this.visible = false |
| | | this.$tip.apiSuccess('ä¿åæå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | |
| | | this.isWorking = false |
| | | }) |
| | | }, |
| | | handleAddRemote () { |
| | | this.$prompt('请è¾å
¥è¡æå°ºå¯¸', 'æ°å¢å¼å°å¯åé
ç½®', { |
| | | inputValue: '', |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value }) => { |
| | | if (!value) { |
| | | this.$message.warning('è¡æå°ºå¯¸ä¸è½ä¸ºç©º') |
| | | return |
| | | // æ ¡éªå°±å°å¯å |
| | | validateLocalStorage () { |
| | | for (const item of this.jiudiTableData) { |
| | | if (item.unitPrice === null || item.unitPrice === undefined || item.unitPrice === '') { |
| | | this.$message.error('è¯·å¡«åææå°±å°å¯åçæ¶è´¹éé¢') |
| | | return false |
| | | } |
| | | this.remoteTableData.push({ |
| | | id: null, |
| | | baggageSize: value, |
| | | deliveryDistance: null, |
| | | deliveryPrice: null, |
| | | sortnum: this.remoteTableData.length + 1 |
| | | }) |
| | | this.remoteTotal = this.remoteTableData.length |
| | | }).catch(() => {}) |
| | | }, |
| | | handleEditRemote (row, index) { |
| | | this.$prompt('请è¾å
¥è¡æå°ºå¯¸', 'ç¼è¾å¼å°å¯åé
ç½®', { |
| | | inputValue: row.baggageSize, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value }) => { |
| | | if (!value) { |
| | | this.$message.warning('è¡æå°ºå¯¸ä¸è½ä¸ºç©º') |
| | | return |
| | | } |
| | | this.$prompt('请è¾å
¥é
ééç¨ï¼å
¬éï¼', 'ç¼è¾é
ééç¨', { |
| | | inputValue: row.deliveryDistance, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value: distance }) => { |
| | | this.$prompt('请è¾å
¥é
éä»·æ ¼ï¼æ¯å
¬é/å
ï¼', 'ç¼è¾é
éä»·æ ¼', { |
| | | inputValue: row.deliveryPrice, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value: price }) => { |
| | | this.$prompt('请è¾å
¥æåº', 'ç¼è¾æåº', { |
| | | inputValue: row.sortnum, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value: sortnum }) => { |
| | | this.$prompt('请è¾å
¥è¡æå°ºå¯¸', 'ç¼è¾å¼å°å¯åé
ç½®', { |
| | | inputValue: row.baggageSize |
| | | }) |
| | | this.remoteTableData.splice(index, 1, { |
| | | ...row, |
| | | baggageSize: value, |
| | | deliveryDistance: distance ? Number(distance) : null, |
| | | deliveryPrice: price ? Number(price) : null, |
| | | sortnum: sortnum ? Number(sortnum) : this.remoteTableData.length + 1 |
| | | }) |
| | | }).catch(() => {}) |
| | | }).catch(() => {}) |
| | | }).catch(() => {}) |
| | | }).catch(() => {}) |
| | | return true |
| | | }, |
| | | handleDeleteRemote (row, index) { |
| | | this.$confirm('确认å é¤è¯¥å¼å°å¯åé
ç½®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.remoteTableData.splice(index, 1) |
| | | this.remoteTotal = this.remoteTableData.length |
| | | }).catch(() => {}) |
| | | }, |
| | | handleAddTime () { |
| | | this.$refs.operaTimeRuleWindow.open('æ°å»ºé¢è®¡æ¶æè§å', null) |
| | | }, |
| | | handleTimeRuleSuccess (data) { |
| | | if (data) { |
| | | this.timeTableData.push(data) |
| | | this.timeTotal = this.timeTableData.length |
| | | // æ ¡éªå¼å°å¯å |
| | | validateRemoteDelivery () { |
| | | for (const item of this.remoteTableData) { |
| | | if (item.startDistance === null || item.startDistance === undefined || item.startDistance === '' || |
| | | item.startPrice === null || item.startPrice === undefined || item.startPrice === '' || |
| | | item.extraDistance === null || item.extraDistance === undefined || item.extraDistance === '' || |
| | | item.extraPrice === null || item.extraPrice === undefined || item.extraPrice === '') { |
| | | this.$message.error('è¯·å¡«åææå¼å°å¯éçé
置信æ¯') |
| | | return false |
| | | } |
| | | } |
| | | return true |
| | | }, |
| | | handleEditTime (row, index) { |
| | | this.$prompt('请è¾å
¥é
ééç¨ï¼å
¬éï¼', 'ç¼è¾é¢è®¡æ¶æé
ç½®', { |
| | | inputValue: row.deliveryDistance, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value }) => { |
| | | this.$prompt('请è¾å
¥é
éæ¶é¿ï¼å°æ¶ï¼', 'ç¼è¾é¢è®¡æ¶æé
ç½®', { |
| | | inputValue: row.deliveryHours, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value: hours }) => { |
| | | this.$prompt('请è¾å
¥æåº', 'ç¼è¾é¢è®¡æ¶æé
ç½®', { |
| | | inputValue: row.sortnum, |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶' |
| | | }).then(({ value: sortnum }) => { |
| | | this.timeTableData.splice(index, 1, { |
| | | ...row, |
| | | deliveryDistance: value ? Number(value) : null, |
| | | deliveryHours: hours ? Number(hours) : null, |
| | | sortnum: sortnum ? Number(sortnum) : this.timeTableData.length + 1 |
| | | }) |
| | | }).catch(() => {}) |
| | | }).catch(() => {}) |
| | | }).catch(() => {}) |
| | | // æ ¡éªé¢è®¡æ¶æ |
| | | validateEstimatedDelivery () { |
| | | const item = this.timeTableData[0] |
| | | if (!item || item.startDistance === null || item.startDistance === undefined || item.startDistance === '' || |
| | | item.startTime === null || item.startTime === undefined || item.startTime === '' || |
| | | item.continueDistance === null || item.continueDistance === undefined || item.continueDistance === '' || |
| | | item.continueTime === null || item.continueTime === undefined || item.continueTime === '') { |
| | | this.$message.error('请填åé¢è®¡æ¶æçææé
置信æ¯') |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | handleDeleteTime (row, index) { |
| | | this.$confirm('确认å é¤è¯¥é¢è®¡æ¶æé
ç½®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.timeTableData.splice(index, 1) |
| | | this.timeTotal = this.timeTableData.length |
| | | }).catch(() => {}) |
| | | // æ ¡éªé¨åºæ³¨åæ¼é |
| | | validateStoreDeposit () { |
| | | for (const item of this.storeDepositData) { |
| | | if (item.depositAmount === null || item.depositAmount === undefined || item.depositAmount === '') { |
| | | this.$message.error('è¯·å¡«åææé¨åºæ³¨åæ¼éçéé¢') |
| | | return false |
| | | } |
| | | } |
| | | return true |
| | | }, |
| | | handleTimePageChange (page) { |
| | | this.timePageIndex = page |
| | | }, |
| | | handleRemotePageChange (page) { |
| | | this.remotePageIndex = page |
| | | // æ ¡éªåææ¯ä¾ |
| | | validateRevenueShare () { |
| | | for (const item of this.shareTableData) { |
| | | if (item.ratio === null || item.ratio === undefined || item.ratio === '') { |
| | | this.$message.error('è¯·å¡«åææåææ¯ä¾') |
| | | return false |
| | | } |
| | | } |
| | | return true |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | .dialog-footer { |
| | | text-align: right; |
| | | padding: 10px 20px; |
| | | padding: 0 20px; |
| | | box-sizing: border-box; |
| | | border-top: 1px solid #eee; |
| | | } |
| | | .remote-config-title { |