From 2909406f4e67616aa8f618013534d43aae566f0c Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期二, 19 七月 2022 17:21:39 +0800
Subject: [PATCH] v1
---
pages/new-application-form-data/new-application-form-data.vue | 1394 ++++++++++++++++++++++++++++++++++++++++++++-------
static/menuIcon/menu-shipment.png | 0
pages/home/home.vue | 4
utils/request.js | 7
utils/index.js | 17
utils/api.js | 39 +
pages/new-application/new-application.vue | 8
components/common/popup-menu/popup-menu.vue | 2
pages/my-application/my-application.vue | 97 +++
9 files changed, 1,350 insertions(+), 218 deletions(-)
diff --git a/components/common/popup-menu/popup-menu.vue b/components/common/popup-menu/popup-menu.vue
index 6ac376e..66d5be3 100644
--- a/components/common/popup-menu/popup-menu.vue
+++ b/components/common/popup-menu/popup-menu.vue
@@ -37,7 +37,7 @@
isLink
url="/pages/jihua/jihua" style="color:blue"
>
- <image src="@/static/menuIcon/menu-home.png" slot="icon" size="32" name="search"/>
+ <image src="@/static/menuIcon/menu-shipment.png" slot="icon" size="32" name="search"/>
</u-cell>
</u-cell-group>
<u-button text="閫�鍑�" type="primary" @click="menuPopupClick"></u-button>
diff --git a/pages/home/home.vue b/pages/home/home.vue
index cbd0679..8e5e406 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -264,9 +264,9 @@
return {
// menuShow:false,// 鑿滃崟鏄剧ず
status: ['鑽夌', '澶勭悊涓�', '宸茬粨鏉�', '宸叉挙鍥�'],
- statusColor: ['#DDDDDD', '#FF9900', '#007AFF', '#06BE00'],
+ statusColor: ['#dd8b8c', '#FF9900', '#007AFF', '#06BE00'],
result: ['鏈彁浜�', '澶勭悊涓�', '閫氳繃', '椹冲洖'],
- resultColor: ['#DDDDDD', '#FF9900', '#06BE00', '#be2b2d'],
+ resultColor: ['#dd8b8c', '#FF9900', '#06BE00', '#be2b2d'],
list3: ['https://cdn.uviewui.com/uview/swiper/swiper3.png', 'https://cdn.uviewui.com/uview/swiper/swiper2.png', 'https://cdn.uviewui.com/uview/swiper/swiper1.png'],
// 鎾ゅ洖妯℃�佹
withDrawShow: false,
diff --git a/pages/my-application/my-application.vue b/pages/my-application/my-application.vue
index 3046d03..9088476 100644
--- a/pages/my-application/my-application.vue
+++ b/pages/my-application/my-application.vue
@@ -2,7 +2,6 @@
<!-- 鎴戠殑鐢宠 -->
<view class="my-application">
<!-- 鎼滅储鍖哄煙 -->
-
<view class="searchBox">
<view class="topRow">
<view class="search">
@@ -80,12 +79,12 @@
<image src="@/static/home/biaodan.png" mode=""></image>
<view>琛ㄥ崟鏁版嵁</view>
</view>
- <view v-if="item.status == 3">
- <image src="@/static/home/history.png" mode="" ></image>
+ <view v-if="item.status == 3" @click="apply(item)">
+ <image src="@/static/home/history.png" mode=""></image>
<view>閲嶆柊鐢宠</view>
</view>
<view v-if="item.status == 3">
- <image src="@/static/home/history.png" mode="" ></image>
+ <image src="@/static/home/history.png" mode=""></image>
<view>缂栬緫</view>
</view>
<view @click="approvalHistoryClick" v-if="item.status == 2 || item.status == 3">
@@ -144,9 +143,9 @@
data() {
return {
status: ['鑽夌', '澶勭悊涓�', '宸茬粨鏉�', '宸叉挙鍥�'],
- statusColor: ['#bbbbbb', '#FF9900', '#007AFF', '#06BE00'],
+ statusColor: ['#dd8b8c', '#FF9900', '#007AFF', '#06BE00'],
result: ['鏈彁浜�', '澶勭悊涓�', '閫氳繃', '椹冲洖'],
- resultColor: ['#bbbbbb', '#FF9900', '#06BE00', '#be2b2d'],
+ resultColor: ['#dd8b8c', '#FF9900', '#06BE00', '#be2b2d'],
// 鎼滅储鍖哄煙
selectText: '',
// 閫夋嫨鍣�
@@ -163,6 +162,19 @@
id: '', // 鎾ゅ洖鐢宠ID
procInstId: ''
},
+ // 閲嶆柊鐢宠
+ form: {
+ sendMessage: true,
+ sendSms: true,
+ sendEmail: true,
+ procDefId: '',
+ assignees: [],
+ priority: '0'
+ },
+ assigneeList: [],
+ showAssign: false,
+ isGateway: false,
+ isCustom: false,
// 鎵归噺鍒犻櫎鐢宠
batchDeleteModalShow: false,
// 澶嶉�夋
@@ -311,7 +323,7 @@
this.withDrawData.procInstId = i.procInstId;
}
});
- this.$reqPost('withDraw', this.withDrawData).then(res => {
+ this.$reqPost('withDraw', this.withDrawData, 'form').then(res => {
console.log('res', res);
if (res.code == 0) {
uni.showToast({
@@ -339,6 +351,77 @@
withDrawCancel() {
this.withDrawShow = false;
},
+ apply(v) {
+ if (!v.procDefId || v.procDefId == 'null') {
+ this.$u.toast('娴佺▼瀹氫箟涓虹┖');
+ return;
+ }
+ this.form.id = v.id;
+ this.form.procDefId = v.procDefId;
+ this.form.title = v.title;
+ // 鍔犺浇瀹℃壒浜�
+ // this.userLoading = true;
+ uni.showLoading({
+ title: '瀹℃壒浜哄姞杞戒腑'
+ });
+ // getFirstNode(v.procDefId).then((res) => {
+ this.$reqGet('getFirstNode', {}, v.procDefId).then(res => {
+ // this.userLoading = false;
+ console.log('瀹℃壒浜�', res);
+ uni.hideLoading();
+ if (res.data) {
+ this.error = '';
+ if (res.data.type == 3 || res.data.type == 4) {
+ this.isGateway = true;
+ this.form.firstGateway = true;
+ this.showAssign = false;
+ this.isCustom = false;
+ return;
+ }
+ if (res.data.type == 5) {
+ this.isCustom = true;
+ this.isGateway = false;
+ this.form.firstGateway = false;
+ this.showAssign = false;
+ return;
+ }
+ if (res.data.type == 1) {
+ this.showAssign = true;
+ this.isGateway = false;
+ this.form.firstGateway = false;
+ this.isCustom = false;
+ if (res.data.users && res.data.users.length > 0) {
+ this.assigneeList = res.data.users;
+ // 榛樿鍕鹃��
+ let ids = [];
+ res.data.users.forEach(e => {
+ ids.push(e.userId);
+ });
+ this.form.assignees = ids;
+ this.showAssign = true;
+ // 鑾峰彇琛ㄥ崟鍐呭锛岄噸鏂板垱寤虹敵璇�
+ this.$reqPost('apply',this.form).then(res=>{
+ console.log('閲嶆柊鎻愪氦鐢宠',res);
+ if(res.code == 0){
+ uni.showToast({
+ title:res.data,
+ icon:'success',
+ duration:2000
+ });
+ }
+ })
+ } else {
+ this.form.assignees = [];
+ this.showAssign = true;
+ this.error = '璇疯繘鍏�"娴佺▼绠$悊"涓哄鎵硅妭鐐瑰垎閰嶅�欓�夊鎵逛汉鍛�';
+ }
+ }
+ }
+ console.log(this.form);
+ });
+
+ this.modalVisible = true;
+ },
// 鎵归噺鍒犻櫎妯℃�佹
batchDeleteClick() {
this.batchDeleteModalShow = true;
diff --git a/pages/new-application-form-data/new-application-form-data.vue b/pages/new-application-form-data/new-application-form-data.vue
index aad11f4..fe61c3d 100644
--- a/pages/new-application-form-data/new-application-form-data.vue
+++ b/pages/new-application-form-data/new-application-form-data.vue
@@ -4,22 +4,27 @@
<!-- page-mete鐨刾age-style灞炴�х浉褰撲簬HTML鐨刡ody灞炴�� -->
<!-- <page-meta :page-style="spanStyle"></page-meta> -->
<!-- 琛ㄥ崟 -->
+
<combination-title class="newApplicationTitle" title="鏂板"></combination-title>
<!-- 娉ㄦ剰锛屽鏋滈渶瑕佸吋瀹瑰井淇″皬绋嬪簭锛屾渶濂介�氳繃setRules鏂规硶璁剧疆rules瑙勫垯 -->
+ <!-- <u-notify :message="accountMsg" :show="trueMsg" :type="accountMsgType"></u-notify> -->
+ <!-- <u-alert :title="accountMsg" :type="accountMsgType" :description="accountMsgType"></u-alert> -->
<view class="formDataContaniner">
<u--form labelPosition="left" :model="newFormData" :rules="rules" ref="formRef">
- <u-form-item labelWidth="20%" label="缁撶畻瀹㈡埛" borderBottom ref="customerNameRef" @click="selectCustomer">
+ <u-form-item @click="selectCustomer" labelWidth="20%" label="缁撶畻瀹㈡埛" prop="customerName" borderBottom ref="customerNameRef">
<u--input v-model="newFormData.customerName" border="none"></u--input>
</u-form-item>
- <u-form-item labelWidth="20%" label="鍚堝悓缂栧彿" borderBottom ref="contractNumRef" @click="selectContract">
+ <u-form-item @click="selectContract" labelWidth="20%" label="鍚堝悓缂栧彿" prop="contractNum" borderBottom ref="contractNumRef">
<u--input v-model="newFormData.contractNum" border="none"></u--input>
</u-form-item>
- <u-form-item labelWidth="20%" label="鍚堝悓鍚嶇О" borderBottom ref="contractNameRef"><u--input v-model="newFormData.contractName" border="none"></u--input></u-form-item>
- <u-form-item labelWidth="20%" label="浠樻鏂瑰紡" borderBottom @click="showPayType = true" ref="payTypeRef">
+ <u-form-item labelWidth="20%" label="鍚堝悓鍚嶇О" borderBottom ref="contractNameRef">
+ <u--input disabled disabledColor="#ffffff" v-model="newFormData.contractName" border="none"></u--input>
+ </u-form-item>
+ <u-form-item @click="showPayType = true" prop="payType" labelWidth="20%" label="浠樻鏂瑰紡" borderBottom ref="payTypeRef">
<u--input v-model="selectValue" disabled disabledColor="#ffffff" placeholder="璇烽�夋嫨浠樻鏂瑰紡" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
- <u-form-item @click="timeShow = true" labelWidth="20%" label="鏃ユ湡" borderBottom ref="timeDataRef">
+ <u-form-item @click="timeShow = true" prop="startDate" labelWidth="20%" label="鏃ユ湡" borderBottom ref="timeDataRef">
<u--input v-model="timeDataStr" border="none" placeholder="璇烽�夋嫨鑼冨洿鏃ユ湡"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
@@ -63,50 +68,28 @@
</view>
<!-- 瀹㈡埛鍒楄〃 -->
<view class="searchResultList">
- <view class="balanceNo" v-if="accountDetails.balanceTotal < 0">
- <text>瀹㈡埛璐︽埛褰撳墠澶勪簬娆犳鐘舵��</text>
- </view>
- <u-collapse accordion>
- <u-collapse-item :title="item.customerFullName" v-for="(item, index) in customerData">
- <view class="customerDetails">
- <view class="table-head">
- <text class="titleText">{{ item.customerNumber }}</text>
- <template>
- <button
- class="mini-btn"
- type="default"
- size="mini"
- style="background: #007aff;
- color: #ffffff;
- margin: auto 0;
- height: 20px;
- line-height:20px;
- width: 86px;
- font-size: 10px;
- padding: 0;"
- @click="selectCustomerOkClick(item.id)"
- >
- 閫夋嫨璇ョ敤鎴�
- </button>
- </template>
- </view>
- <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁" style="min-width:420px;">
- <uni-tr>
- <uni-th align="center">绾у埆</uni-th>
- <uni-td align="center">{{ item.level }}</uni-td>
- </uni-tr>
- <uni-tr>
- <uni-th align="center">鎵�灞為儴闂ㄥ悕绉�</uni-th>
- <uni-td align="center">{{ item.compNames }}</uni-td>
- </uni-tr>
- <uni-tr>
- <uni-th align="center">鐢佃瘽鍙风爜</uni-th>
- <uni-td align="center">{{ item.customerPhoneNumber }}</uni-td>
- </uni-tr>
- </uni-table>
- </view>
- </u-collapse-item>
- </u-collapse>
+ <u-cell-group :right-icon="false">
+ <u-cell v-for="(item, index) in customerData" :title="item.customerFullName" :arrow="false">
+ <text slot="value" class="u-slot-value">
+ <button
+ class="mini-btn"
+ type="default"
+ size="mini"
+ style="background: #007aff;
+ color: #ffffff;
+ margin: auto 0;
+ height: 20px;
+ line-height:20px;
+ width: 43px;
+ font-size: 10px;
+ padding: 0;"
+ @click="selectCustomerOkClick(item.id)"
+ >
+ 閫夋嫨
+ </button>
+ </text>
+ </u-cell>
+ </u-cell-group>
</view>
<!-- 閫夋嫨鐢ㄦ埛鑿滃崟椤� -->
@@ -181,7 +164,6 @@
<uni-th width="70" align="center">鐘舵��</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in contractData" :key="index">
-
<uni-td align="center">
<view :style="tdStyle">{{ item.compName }}</view>
</uni-td>
@@ -221,6 +203,7 @@
<uni-tr><uni-th align="center">鎿嶄綔</uni-th></uni-tr>
<uni-tr v-for="(item, index) in contractData" :key="index">
<uni-td align="center">
+ <!-- 閫夋嫨鍚堝悓 -->
<view class="TableUtilBtnContainer"><u-button type="primary" @click="selectContractClick(item)" icon="checkbox-mark" size="mini"></u-button></view>
</uni-td>
</uni-tr>
@@ -255,19 +238,355 @@
</u-popup>
</view>
+ <!-- 娣诲姞鍚堝悓瀛愰」 -->
+ <view class="addContractContainer">
+ <u-popup :show="addContractShow" @close="addContractClose" @open="addContractOpen" mode="bottom" round="22">
+ <scroll-view scroll-y="true" style="height:100%;">
+ <combination-title class="addContractFormTitle" title="娣诲姞璁㈠崟"></combination-title>
+ <!-- 娣诲姞鐢ㄦ埛琛ㄥ崟 -->
+ <view class="addContractForm">
+ <u--form labelPosition="left" :model="addContractFormdata" :rules="addContractRules" ref="form1">
+ <view class="formUpCard">
+ <u-form-item label="鐭垮巶" labelWidth="20%" ref="item1">
+ <u--input v-model="addContractFormdata.filedName" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-form-item @click="coalFiledSelectShow = true" label="鐓ゅ巶" labelWidth="20%" ref="item1">
+ <u--input v-model="addContractFormdata.compName" disabled disabledColor="#ffffff"></u--input>
+ </u-form-item>
+ <u-form-item label="鏀惰揣浜�" labelWidth="20%" ref="item1" @click="addContractConsignee">
+ <u--input v-model="addContractFormdata.customerName" disabled disabledColor="#ffffff"></u--input>
+ </u-form-item>
+ <u-form-item @click="addContractCoalShow = true" label="鍝佺" labelWidth="20%" ref="item1">
+ <u--input v-model="addContractFormdata.coalName" disabled disabledColor="#ffffff"></u--input>
+ </u-form-item>
+ <template>
+ <!-- 浠锋牸鍗$墖 -->
+ <view class="priceList" v-if="showPrice && favouredpolicyListcomputed">
+ <view class="currentPriceContainer">
+ <u-divider text="褰撳墠浠锋牸"></u-divider>
+ <view class="currentPriceBox">
+ <u--form :model="currentCoal" labelPosition="left">
+ <u-form-item label="鐓ょ" labelWidth="35%">
+ <u--input v-model="currentCoal.coalName" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-form-item :label="currentCoal.type == 1 ? '閽㈠巶闀垮崗' : '鍩哄噯浠�'" labelWidth="35%">
+ <u--input v-model="currentCoal.steelMillPrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-form-item :label="currentCoal.type == 1 ? '鐒﹀寲闀垮崗' : '鐢靛巶鍩哄噯'" labelWidth="35%">
+ <u--input v-model="currentCoal.cokingPrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-form-item :label="currentCoal.type == 1 ? '闈為暱鍗�' : '鍖哄煙澶栫數鍘備环'" labelWidth="35%">
+ <u--input v-model="currentCoal.noImportantPrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-form-item label="鎸傜墝浠�" labelWidth="35%">
+ <u--input v-model="currentCoal.quotePrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ </u--form>
+ </view>
+ </view>
+ <view class="selectPriceContainer">
+ <u-divider text="閫夋嫨浠锋牸"></u-divider>
+ <view class="selectPricebox">
+ <u--form labelPosition="left">
+ <u-form-item label="鐓ょ" labelWidth="35%">
+ <u--input v-model="currentCoal.coalName" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-radio-group v-model="addContractFormdata.priceMode" placement="column" @change="groupChange">
+ <view class="selectPriceboxItem">
+ <u-form-item :label="currentCoal.type == 1 ? '閽㈠巶闀垮崗' : '鍩哄噯浠�'" labelWidth="35%">
+ <u--input v-model="afterPrice.steelMillPrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="0" @change="changePriceMode"></u-radio>
+ </view>
+ <view class="selectPriceboxItem">
+ <u-form-item :label="currentCoal.type == 1 ? '鐒﹀寲闀垮崗' : '鐢靛巶鍩哄噯'" labelWidth="35%">
+ <u--input v-model="afterPrice.cokingPrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="1" @change="changePriceMode"></u-radio>
+ </view>
+ <view class="selectPriceboxItem">
+ <u-form-item :label="currentCoal.type == 1 ? '闈為暱鍗�' : '鍖哄煙澶栫數鍘備环'" labelWidth="35%">
+ <u--input v-model="afterPrice.noImportantPrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="2" @change="changePriceMode"></u-radio>
+ </view>
+ <view class="selectPriceboxItem">
+ <u-form-item label="鎸傜墝浠�" labelWidth="35%">
+ <u--input v-model="afterPrice.quotePrice" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="3" @change="changePriceMode"></u-radio>
+ </view>
+ </u-radio-group>
+ </u--form>
+ </view>
+ </view>
+ <view class="selectFavouredPolicy">
+ <u-divider text="閫夋嫨浼樻儬鏀跨瓥"></u-divider>
+ <view class="selectFavouredPolicyBox">
+ <uni-table ref="priceTableRef" :loading="loading" border stripe type="selection" emptyText="鏆傛棤鏇村鏁版嵁" @selection-change="selectionChange">
+ <uni-tr>
+ <uni-th width="150" align="center">浼樻儬鏂瑰紡</uni-th>
+ <uni-th width="60" align="center">绗﹀彿</uni-th>
+ <uni-th width="60" align="center">鍊�</uni-th>
+ <uni-th width="60" align="center">浠锋牸浼樻儬</uni-th>
+ </uni-tr>
+ <uni-tr v-for="(item, index) in favouredpolicyList" :key="index">
+ <uni-td>{{ item.type }}</uni-td>
+ <uni-td align="center">{{ operator[item.method].label }}</uni-td>
+ <uni-td align="center">{{ item.val }}</uni-td>
+ <uni-td align="center">{{ item.price }}</uni-td>
+ </uni-tr>
+ </uni-table>
+ </view>
+ </view>
+ </view>
+ </template>
+ <u-form-item @click="addContractTransportShow = true" label="杩愯緭" labelWidth="20%" ref="item1"><u--input v-model="addContractTransport"></u--input></u-form-item>
+ </view>
+ <view class="formDownCard">
+ <u-form-item label="鍗曚环" labelWidth="20%" ref="item1">
+ <u--input v-model="addContractFormdata.price" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ <u-form-item label="璁㈠崟閲戦" labelWidth="20%" ref="item1"><u--input v-show="currentRowComputed" v-model="addContractFormdata.amount"></u--input></u-form-item>
+ <u-form-item label="璁㈠崟鏁伴噺" labelWidth="20%" ref="item1">
+ <u--input v-model="addContractFormdata.quant" disabled disabledColor="#ffffff" border="none"></u--input>
+ </u-form-item>
+ </view>
+
+ <!-- <u-form-item label="鍙戠珯" labelWidth="18%" borderBottom ref="item1"><u--input v-model="addContractFormdata.fromStation" border="none"></u--input></u-form-item>
+ <u-form-item label="鍒扮珯" labelWidth="18%" borderBottom ref="item1"><u--input v-model="addContractFormdata.toStation" border="none"></u--input></u-form-item>
+ <u-form-item label="杩愯垂" labelWidth="18%" borderBottom ref="item1"><u--input v-model="addContractFormdata.cost1" border="none"></u--input></u-form-item>
+ <u-form-item label="鎶戝皹璐�" labelWidth="18%" borderBottom ref="item1"><u--input v-model="addContractFormdata.cost2" border="none"></u--input></u-form-item> -->
+ </u--form>
+
+ <view class="addContractConfirm"><u-button text="娣诲姞" type="primary" @click="addContractSanConfirm"></u-button></view>
+ </view>
+
+ <!-- 閫夋嫨鐓ゅ巶 -->
+ <view class="coalFiledSelectPopup">
+ <u-popup :show="coalFiledSelectShow" @close="coalFiledSelectClose" @open="coalFiledSelectOpen" mode="bottom" round="22">
+ <scroll-view scroll-y="true" style="height:100%;">
+ <combination-title class="selectCustomerTitle" title="閫夋嫨鐓ゅ巶"></combination-title>
+ <view class="coalFiledSelectSearch"></view>
+ <view class="coalFiledTable">
+ <view class="tableBody">
+ <uni-table border emptyText="鏆傛棤鏇村鏁版嵁">
+ <uni-tr>
+ <uni-th width="120" align="center">鐓ゅ巶鍚嶇О</uni-th>
+ <uni-th width="120" align="center">鐓ゅ巶缂栧彿</uni-th>
+ <uni-th width="120" align="center">鎵�灞炵熆</uni-th>
+ <uni-th width="120" align="center">澶囨敞</uni-th>
+ </uni-tr>
+ <uni-tr v-for="(item, index) in coalfiledData" :key="index">
+ <uni-td align="center">
+ <view :style="tdStyle">{{ item.name }}</view>
+ </uni-td>
+ <uni-td align="center">
+ <view :style="tdStyle">{{ item.num }}</view>
+ </uni-td>
+ <uni-td align="center">
+ <view :style="tdStyle">{{ item.compName }}</view>
+ </uni-td>
+ <uni-td align="left">
+ <view :style="tdStyle">{{ item.remark }}</view>
+ </uni-td>
+ </uni-tr>
+ </uni-table>
+ </view>
+
+ <view class="TableUtilBtn">
+ <uni-table border emptyText="鏆傛棤鏇村鏁版嵁">
+ <uni-tr><uni-th align="center">鎿嶄綔</uni-th></uni-tr>
+ <uni-tr v-for="(item, index) in coalfiledData" :key="index">
+ <uni-td align="center">
+ <!-- 閫夋嫨鍚堝悓 -->
+ <view class="TableUtilBtnContainer"><u-button type="primary" @click="coalFiledSelectClick(item)" icon="checkbox-mark" size="mini"></u-button></view>
+ </uni-td>
+ </uni-tr>
+ </uni-table>
+ </view>
+ </view>
+ </scroll-view>
+ </u-popup>
+ </view>
+
+ <!-- 閫夋嫨鏀惰揣浜� -->
+ <view class="selectCustomerPopup">
+ <u-popup :show="addContractConsigneeShow" @close="addContractConsigneeClose" @open="addContractConsigneeOpen" mode="bottom" round="22">
+ <scroll-view scroll-y="true" style="height:100%;">
+ <combination-title class="selectCustomerTitle" title="閫夋嫨鏀惰揣浜�"></combination-title>
+ <view class="selectCustomerContainer">
+ <view class="searchContainer">
+ <u--form labelPosition="left" :model="searchCustomerForm" ref="selectformRef">
+ <u-form-item labelWidth="12%" label="鍗曚綅" borderBottom ref="compRef">
+ <u--input @focus="selectCustomerCompShow = true" v-model="searchCustomerForm.compName" placeholder="鐐瑰嚮閫夋嫨鍗曚綅" border="none"></u--input>
+ <u-icon slot="right" name="close-circle-fill" v-show="searchCustomerForm.compName != ''" @click="searchCustomerForm.compName = ''"></u-icon>
+ </u-form-item>
+ <u-form-item labelWidth="20%" label="瀹㈡埛鍚嶇О" borderBottom ref="timeDataRef">
+ <u--input v-model="selectCustomerData.customerName" border="none" placeholder="杈撳叆瀹㈡埛鍚嶇О"></u--input>
+ <u-icon slot="right" name="close-circle-fill" v-show="selectCustomerData.customerName != ''" @click="selectCustomerData.customerName = ''"></u-icon>
+ </u-form-item>
+ <u-form-item labelWidth="20%" label="瀹㈡埛绾у埆" borderBottom>
+ <u--input @focus="selectLevelShow = true" border="none" v-model="searchCustomerForm.levelText" placeholder="鐐瑰嚮閫夋嫨绾у埆"></u--input>
+ <u-icon slot="right" name="close-circle-fill" v-show="searchCustomerForm.levelText != ''" @click="searchCustomerForm.levelText = ''"></u-icon>
+ </u-form-item>
+ </u--form>
+ </view>
+ <view class="searchCustomerBtn">
+ <u-button text="鎼滅储" type="primary" @click="selectCustomer()"></u-button>
+ <u-button text="娓呯┖" @click="selectCustomerResetFields"></u-button>
+ </view>
+ <!-- 瀹㈡埛鍒楄〃 -->
+ <view class="searchResultList">
+ <u-cell-group :right-icon="false">
+ <u-cell v-for="(item, index) in customerData" :title="item.customerFullName" :arrow="false">
+ <text slot="value" class="u-slot-value">
+ <button
+ class="mini-btn"
+ type="default"
+ size="mini"
+ style="background: #007aff;
+ color: #ffffff;
+ margin: auto 0;
+ height: 20px;
+ line-height:20px;
+ width: 43px;
+ font-size: 10px;
+ padding: 0;"
+ @click="addContractConsigneeConfirm(item)"
+ >
+ 閫夋嫨
+ </button>
+ </text>
+ </u-cell>
+ </u-cell-group>
+ </view>
+ <!-- 閫夋嫨鐢ㄦ埛鑿滃崟椤� -->
+ <view class="selectCustomerCompSheet">
+ <u-action-sheet
+ :show="selectCustomerCompShow"
+ :actions="selectCustomerActions"
+ title="璇烽�夋嫨鍗曚綅"
+ @close="selectCustomerCompShow = false"
+ @select="selectCustomerSelect"
+ ></u-action-sheet>
+ </view>
+ <!-- 绾у埆鑿滃崟椤� -->
+ <view class="selectLevelSheet">
+ <u-action-sheet :show="selectLevelShow" :actions="levelList" title="璇烽�夋嫨绾у埆" @close="selectLevelShow = false" @select="selectLevelSelect"></u-action-sheet>
+ </view>
+ </view>
+ </scroll-view>
+ </u-popup>
+ </view>
+
+ <!-- 鍝佺閫夋嫨鍣� -->
+ <view class="addContractCoalPicker">
+ <u-picker
+ :show="addContractCoalShow"
+ :columns="addContractCoalData"
+ @close="addContractCoalClose"
+ @cancel="addContractCoalShow = false"
+ @confirm="addContractCoalConfirm"
+ :closeOnClickOverlay="true"
+ keyName="label"
+ ></u-picker>
+ </view>
+
+ <!-- 杩愯緭閫夋嫨鍣� -->
+ <view class="addContractCoalPicker">
+ <u-picker
+ :show="addContractTransportShow"
+ :columns="addContractTransportData"
+ @close="addContractTransportClose"
+ @cancel="addContractTransportShow = false"
+ @confirm="addContractTransportConfirm"
+ :closeOnClickOverlay="true"
+ keyName="label"
+ ></u-picker>
+ </view>
+ </scroll-view>
+ </u-popup>
+ </view>
+
<!-- 鐢宠琛ㄦ牸 -->
+
<view class="newApplicationTable">
- <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁">
- <!-- 琛ㄦ牸鏁版嵁琛� -->
- <uni-tr v-for="(item, index) in 8" :key="index">
+ <!-- <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁">
+ <uni-tr v-for="(item, index) in 12" :key="index">
<uni-th align="center">瀛楁鏍囬</uni-th>
<uni-td>
<view class="text">杈撳叆/閫夋嫨鍐呭</view>
<view class="icon"><image src="@/static/icon/select.png" mode=""></image></view>
</uni-td>
</uni-tr>
- </uni-table>
+ <uni-tr>
+ <uni-th align="center">鎿嶄綔</uni-th>
+ <uni-td>
+ <view class="newApplicationTableUtil">
+ <u-button type="primary" text="淇敼" size="mini"></u-button>
+ <u-button type="error" text="鍒犻櫎" size="mini"></u-button>
+ </view>
+ </uni-td>
+ </uni-tr>
+ </uni-table> -->
+ <view class="balanceNo" v-if="accountDetails.balanceTotal < 0"><text style="color:red;">瀹㈡埛璐︽埛褰撳墠澶勪簬娆犳鐘舵��</text></view>
+
+ <view class="messageCustomerBalance" v-if="accountDetails.balanceTotal >= 0">
+ <text style="color: #FFA500;;">瀹㈡埛璐︽埛鐜版眹浣欓:{{ accountDetails.balanceTotal }},鎵垮厬浣欓锛歿{ accountDetails.balance2 == null ? 0 : customerChengdui }}</text>
+ </view>
+ <u-swipe-action>
+ <u-swipe-action-item @click="deleteContractCardClick" :options="options1" v-for="(item, index) in this.newFormData.contractOrders" :key="index">
+ <view class="cardList">
+ <view class="cardList-container">
+ <view class="cardList_item">
+ 鏀惰揣浜猴細
+ <text>{{ item.customerName }}</text>
+ </view>
+ <view class="cardList_item">
+ <view class="">
+ 鐭垮巶锛�
+ <text>{{ item.filedName }}</text>
+ </view>
+ <view class="">
+ 鐓ゅ巶锛�
+ <text>{{ item.compName }}</text>
+ </view>
+ </view>
+
+ <view class="cardList_item">
+ <view class="">
+ 鍝佺锛�
+ <text>{{ item.coalName }}</text>
+ </view>
+ <view class="">
+ 杩愯緭锛�
+ <text>{{ item.trainType == 1 ? '璺繍' : '鍦伴攢' }}</text>
+ </view>
+ </view>
+ <view class="cardList_item">
+ <view class="">
+ 鍗曚环锛�
+ <text>{{ item.price }}</text>
+ </view>
+ <view class="">
+ 璁㈠崟閲戦锛�
+ <text>{{ item.amount }}</text>
+ </view>
+ <!-- <view class="">
+ 璁㈠崟鏁伴噺锛�<text>218.899</text>
+ </view> -->
+ </view>
+ </view>
+ </view>
+ </u-swipe-action-item>
+ </u-swipe-action>
+
+ <view class="addCard" @click="addContractClick">
+ <view class="addCard-icon"><u-icon name="plus" size="100"></u-icon></view>
+ </view>
</view>
+
<view class="new-application-button">
<u-button text="鍙栨秷" :plain="true" type="primary" @click="backPage"></u-button>
<u-button text="纭畾" type="primary" @click="newApplicationFormDataClick"></u-button>
@@ -291,31 +610,32 @@
export default {
data() {
return {
+ // accountMsgType: 'error',
tdStyle: 'max-height: 30px;overflow: scroll;',
spanStyle: 'overflow:auto',
newFormData: {
- amount: 0,
+ amount: null,
coalId: '',
coalName: '',
contractId: 169,
- contractName: '鍥芥嘲娲椾腑鐓ゅ悎鍚�',
+ contractName: '',
contractNum: '',
contractOrders: [],
customerAddressId: '',
customerId: 236,
- customerName: '閭㈠彴鍥芥嘲鍙戠數鏈夐檺璐d换鍏徃',
- endDate: '2022-07-12',
- executiveQuant: 0,
- id: 0,
+ customerName: '',
+ endDate: '',
+ executiveQuant: null,
+ id: null,
number: '',
- payType: '0',
- price: 0,
- quant: 0,
+ payType: '',
+ price: null,
+ quant: null,
remark: '',
- startDate: '2022-07-05',
+ startDate: '',
type: '澶栭攢'
},
- accountDetails:0,
+ accountDetails: {},
// 鏃堕棿
timeDataStr: '',
menuShow: false,
@@ -326,24 +646,39 @@
actions: [],
selectValue: '',
rules: {
- 'newData.name': {
- type: 'string',
- required: true,
- message: '璇峰~鍐欏鎴峰悕绉�',
- trigger: ['blur', 'change']
- },
- 'newData.num': {
- type: 'string',
- max: 2,
- required: true,
- message: '璇烽�夋嫨鍚堝悓缂栧彿',
- trigger: ['blur', 'change']
- }
+ customerName: [
+ {
+ required: true,
+ message: '璇烽�夋嫨缁撶畻瀹㈡埛',
+ trigger: ['blur', 'change']
+ }
+ ],
+ contractNum: [
+ {
+ required: true,
+ message: '璇烽�夋嫨鍚堝悓缂栧彿',
+ trigger: ['blur', 'change']
+ }
+ ],
+ payType: [
+ {
+ required: true,
+ message: '璇烽�夋嫨浠樻鏂瑰紡',
+ trigger: ['blur', 'change']
+ }
+ ],
+ startDate: [
+ {
+ required: true,
+ message: '璇烽�夋嫨鏃堕棿',
+ trigger: ['blur', 'change']
+ }
+ ]
},
// 鏃堕棿
timeShow: false,
mode: 'range',
- maxDate: `${year}-${month}-${date + 10}`,
+ maxDate: `${year}-${month}-${date + 80}`,
// 閫夋嫨瀹㈡埛
selectCustomerData: {
compIds: '',
@@ -352,6 +687,7 @@
current: 1,
size: 10
},
+ account: null, //瀹㈡埛璐︽埛淇℃伅
// 鎼滅储瀛楁
selectCompsData: [],
selectCustomerLevel: [],
@@ -366,7 +702,6 @@
// 绾у埆
selectLevelShow: false,
levelList: [{ name: '涓�鏄熺骇', value: 'A' }, { name: '浜屾槦绾�', value: 'B' }, { name: '涓夋槦绾�', value: 'C' }, { name: '鍥涙槦绾�', value: 'D' }, { name: '浜旀槦绾�', value: 'E' }],
-
// 閫夋嫨鍚堝悓
selectContractShow: false,
searchContractForm: {
@@ -386,7 +721,100 @@
// 鏃堕棿
selectContractTimeMode: 'single',
selectContractStartTimeShow: false,
- selectContractEndTimeShow: false
+ selectContractEndTimeShow: false,
+ // 娣诲姞鍚堝悓
+ addContractShow: false,
+ // 娣诲姞鍚堝悓琛ㄥ崟
+ addContractRules: {},
+ addContractFormdata: {
+ // amount: null,
+ // coalId: null,
+ // coalName: '',
+ // compId: null,
+ // compName: '',
+ // cost1: '',
+ // cost2: '',
+ // customerId: null,
+ // customerName: '',
+ // edit: true,
+ // favouredpolicyIds: '',
+ // filedId: null,
+ // filedName: '',
+ // fromStation: '',
+ // modifyId: null,
+ // modifyInfoId: null,
+ // customerAddressId: null,
+ // price: null,
+ // priceMode: '0',
+ // quant: '',
+ // toStation: '',
+ // trainType: 1,
+ // type: ''
+ },
+ contractDetails: [], // 閫夋嫨鐨勫悎鍚岃鎯�
+ // 閫夋嫨鐓ゅ巶
+ coalFiledSelectShow: false,
+ coalfiledData: [],
+ coalfiledParams: { current: 1, size: 10 },
+ selectCoalFiledData: {},
+ // 閫夋嫨鏀惰揣浜�
+ addContractConsigneeShow: false,
+ // 鍝佺閫夋嫨鍣�
+ addContractCoalShow: false,
+ addContractCoalData: [[]],
+ // 杩愯緭绫诲瀷
+
+ // 浼樻儬
+ favouredpolicyListAll: [], //浼樻儬鏀跨瓥鍒楄〃鎵�鏈夌殑
+ favouredpolicyList: [], // 浼樻儬鏀跨瓥鍒楄〃
+ multipleSelection: [], //閫変腑鐨勪紭鎯犳斂绛�
+ // 鍗曢�夋
+ addContractTransport: '鍦伴攢',
+ // 鍝佺浠锋牸琛ㄦ牸
+ loading: false,
+ // 浠锋牸璇锋眰鍙傛暟
+ getNewPriceData: {
+ compId: 133,
+ compName: '閭㈠彴鐭�',
+ customerAddressName: '閭㈠彴鍥芥嘲鍙戠數鏈夐檺璐d换鍏徃',
+ customerAddressId: 236,
+ coalId: 45,
+ coalName: '',
+ trainType: 1,
+ fromStation: '灏忓悍搴�',
+ toStation: '灏忓悍搴�',
+ quant: '',
+ price: '',
+ amount: '',
+ priceMode: null,
+ filedName: '閭㈠彴鐭夸富鐓ゅ満',
+ filedId: 4,
+ type: '',
+ cost1: '',
+ cost2: '',
+ edit: true
+ },
+ dust: null, // 鎶戝皹璐�
+ trainfreight: {}, //璺繍杩愯垂
+ // 杩愯緭绫诲瀷
+ addContractTransportShow: false,
+ addContractTransportData: [[{ label: '鍦伴攢', value: 1 }, { label: '璺繍', value: 2 }]],
+ currentCoal: {
+ coalName: '',
+ cokingPrice: null,
+ modifyId: null,
+ modifyInfoId: null,
+ noImportantPrice: null,
+ quotePrice: null,
+ steelMillPrice: null,
+ type: null
+ },
+ // 婊戝姩鍗曞厓鏍�
+ options1: [
+ {
+ text: '鍒犻櫎'
+ }
+ ]
};
},
onShow() {
@@ -399,6 +827,120 @@
onNavigationBarButtonTap(e) {
// console.log(e);
this.$refs.menuRef.menuClick();
+ },
+ computed: {
+ afterPrice() {
+ let temp = Object.assign({}, this.currentCoal);
+ let favouredpolicyIds = '';
+ if (this.favouredpolicyList.length > 0) {
+ this.multipleSelection.forEach(e => {
+ if (favouredpolicyIds.length > 0) {
+ favouredpolicyIds += ',';
+ }
+ favouredpolicyIds += e.id;
+ temp.steelMillPrice -= e.price;
+ temp.cokingPrice -= e.price;
+ temp.noImportantPrice -= e.price;
+ temp.quotePrice -= e.price;
+ });
+ if (this.multipleSelection.length > 0) {
+ this.addContractFormdata.favouredpolicyIds = favouredpolicyIds;
+ }
+ }
+
+ return temp;
+ },
+ showPrice() {
+ if (this.addContractFormdata) {
+ let row = this.addContractFormdata;
+ if (row.compId && row.customerAddressId && row.coalId) {
+ // console.log('鐪嬭浠锋牸', this.showPrice);
+ // this.rowClik(this.currentRow);
+ return true;
+ }
+ }
+ return false;
+ },
+ //浼樻儬鏀跨瓥
+ favouredpolicyListcomputed() {
+ let list = [];
+ this.favouredpolicyListAll.forEach(e => {
+ //鏀粯鏂瑰紡
+ if (e.type.indexOf('B') != -1 && e.coalIds) {
+ if (e.coalIds.indexOf(this.addContractFormdata.coalId) != -1) {
+ list.push(e);
+ }
+ }
+ //杩愯窛
+ if (this.addContractFormdata.trainType == 2) {
+ if (e.type.indexOf('A') != -1) {
+ //鏍规嵁鍙戠珯鍒扮珯鑾峰彇杩愯窛
+ list.push(e);
+ }
+ }
+ });
+ this.favouredpolicyList = list;
+
+ return true;
+ },
+ async currentRowComputed() {
+ //鍙樹环鏍肩敤鐨�
+ this.changePriceMode(this.addContractFormdata.priceMode);
+
+ //鍙樿鍗曢噺
+ if (this.addContractFormdata.amount > 0 && this.addContractFormdata.price > 0) {
+ let price = this.addContractFormdata.price;
+ if (this.addContractFormdata.trainType == 2) {
+ //濡傛灉璺繍浠锋牸澧炲姞鎶戝皹璐瑰拰杩愯垂
+ let cost1Price = await this.getFreight(this.addContractFormdata.fromStation, this.addContractFormdata.toStation, this.addContractFormdata.customerAddressId); //璺繍杩愯垂
+ price += cost1Price;
+ price += this.dust;
+ }
+ let q = this.addContractFormdata.amount / price;
+ this.addContractFormdata.quant = q.toFixed(2);
+ if (this.addContractFormdata.trainType == 2) {
+ let cost1Price = await this.getFreight(this.addContractFormdata.fromStation, this.addContractFormdata.toStation, this.addContractFormdata.customerAddressId); //璺繍杩愯垂
+ this.addContractFormdata.cost1 = (this.addContractFormdata.quant * cost1Price).toFixed(2); //杩愯垂
+ this.addContractFormdata.cost2 = (this.addContractFormdata.quant * this.dust).toFixed(2); //鎶戝皹璐�
+ console.log('杩愯垂锛屾姂灏樿垂锛�', this.addContractFormdata.cost1, this.addContractFormdata.cost2);
+ } else {
+ this.addContractFormdata.cost1 = null; //杩愯垂
+ this.addContractFormdata.cost2 = null; //鎶戝皹璐�
+ }
+ } else {
+ this.addContractFormdata.quant = null;
+ }
+ // if (this.currentRow.quant > 0 && this.currentRow.price > 0) {
+ // this.currentRow.amount = this.currentRow.quant * this.currentRow.price;
+ // return true;
+ // }
+ return true;
+ }
+ // accountMsg() {
+ // this.accountMsgType = 'error';
+ // if (this.accountDetails) {
+ // if (this.accountDetails.balanceType == '璐�') {
+ // return '瀹㈡埛璐︽埛浣欓褰撳墠澶勪簬娆犳鐘舵�侊紒';
+ // } else {
+ // let amount = 0;
+ // this.newFormData.contractOrders.forEach(e => {
+ // amount += Number(e.amount);
+ // });
+ // if (this.newFormData.payType == '0') {
+ // if (this.accountDetails.balance < amount) {
+ // return '瀹㈡埛璐︽埛鐜版眹浣欓涓嶈冻锛岀幇姹囦綑棰�:' + this.accountDetails.balance;
+ // }
+ // } else {
+ // if (this.accountDetails.balance2 < amount) {
+ // return '瀹㈡埛璐︽埛鎵垮厬浣欓涓嶈冻锛屾壙鍏戜綑棰�:' + this.accountDetails.balance2;
+ // }
+ // }
+ // }
+ // this.accountMsgType = 'warning';
+ // return '瀹㈡埛璐︽埛鐜版眹浣欓:' + this.accountDetails.balance + '锛屾壙鍏戜綑棰�:' + (this.accountDetails.balance2 ? this.accountDetails.balance2 : 0);
+ // }
+ // return null;
+ // }
},
watch: {
// 绔嬪嵆澶勭悊 杩涘叆椤甸潰灏辫Е鍙� // immediate: true,
@@ -428,6 +970,7 @@
this.pay_type();
this.others_params();
this.fetchCompTree();
+ this.getFavouredPolicyItem();
},
// 閫夋嫨瀹㈡埛
selectCustomer() {
@@ -440,13 +983,12 @@
this.$reqGet('customer', this.selectCustomerData).then(res => {
uni.hideLoading();
if (res.code == 0) {
-
this.customerData = res.data.records;
}
});
},
+ // 瀹㈡埛閫夋嫨寮规鎵撳紑浜�
selectCustomerOpen() {
- console.log('瀹㈡埛閫夋嫨寮规鎵撳紑浜�');
// this.spanStyle = 'overflow:hidden'; //褰撹挋灞傚脊璧锋椂锛屽浐瀹氱晫闈㈢姝㈡粴鍔紝褰撹挋灞傚叧闂椂锛屽厑璁告粴鍔�
},
selectCustomerClose() {
@@ -502,8 +1044,7 @@
selectCustomerOkClick(v) {
console.log('id', v);
this.$reqGet('getAccount', { customerId: v }).then(res => {
- console.log('鑾峰彇璐﹀彿', res);
- this.accountDetails = res.data
+ this.accountDetails = res.data;
this.newFormData.customerName = res.data.customerName;
this.newFormData.customerId = res.data.id;
this.searchContractForm.customerName = res.data.customerName;
@@ -515,7 +1056,6 @@
// 鏃堕棿
confirmTime(v) {
this.timeShow = false;
- console.log(v);
v.forEach(e => {
this.newFormData.startDate = v[0];
this.newFormData.endDate = v[v.lenght - 1];
@@ -525,7 +1065,25 @@
// 閫夋嫨鍚堝悓
selectContract() {
- this.selectContractShow = true;
+ if (this.newFormData.customerName != '') {
+ if (this.newFormData.contractOrders != []) {
+ uni.showToast({
+ title: '娣诲姞璁㈠崟鍚庯紝涓嶈兘淇敼鍚堝悓锛�',
+ icon: 'error',
+ duration: 2000
+ });
+ }
+ this.selectContractShow = true;
+ } else {
+ this.$refs.formRef
+ .validate()
+ .then(res => {
+ uni.$u.toast('鏍¢獙鎴愬姛');
+ })
+ .catch(err => {
+ uni.$u.toast('璇烽�夋嫨缁撶畻瀹㈡埛');
+ });
+ }
},
// 閫夋嫨鍚堝悓绫诲瀷杈撳叆妗嗚幏鍙栫劍鐐硅Е鍙�
searchContractFormTypeFocus() {
@@ -534,7 +1092,6 @@
// 寮瑰嚭妗嗙被鍨嬭姹�
this.$nextTick(() => {
this.$reqGet('contract_type').then(res => {
- console.log('contract_type', res);
res.data.forEach(item => {
this.selectContractTypeData[0].push(item.value);
});
@@ -600,12 +1157,276 @@
this.searchContractForm.type = '';
},
selectContractClick(e) {
- console.log(e);
+ console.log('閫夋嫨鍚堝悓', e);
+ this.newFormData.contractName = e.contractName;
+ this.newFormData.contractNum = e.num;
+ this.newFormData.contractId = e.id;
+ this.selectContractShow = false;
+
+ // 浠锋牸鍙傛暟璧嬪��
+ this.getNewPriceData.type = e.type;
+ // 閫夊畾鍚堝悓璇︽儏
+ uni
+ .request({
+ url: `/yunxiao/contractitem/getByContractId/${e.id}`,
+ method: 'GET',
+ header: {
+ 'TENANT-ID': 5,
+ Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
+ VERSION: 'zzl'
+ }
+ })
+ .then(res => {
+ this.contractDetails = res[1].data.data;
+ console.log('鍚堝悓璇︽儏', res, this.contractDetails);
+ })
+ .catch(err => {
+ console.log(err);
+ });
+ },
+ // 娣诲姞鍚堝悓鎸夐挳
+ addContractClick() {
+ // 鎵撳嵃true鎴杅alse
+ this.$refs.formRef
+ .validate()
+ .then(res => {
+ if (this.accountDetails.balanceType == '璐�') {
+ uni.showToast({
+ title: '瀹㈡埛璐︽埛浣欓褰撳墠澶勪簬娆犳鐘舵�侊紒',
+ icon: 'error',
+ duration: 2000
+ });
+ } else {
+ if (this.accountDetails.balance == 0 || (null && this.accountDetails.balance2 == 0) || null) {
+ uni.showToast({
+ title: '璐︽埛浣欓涓嶈冻锛�',
+ icon: 'error',
+ duration: 2000
+ });
+ } else {
+ console.log('娣诲姞鍚堝悓鎸夐挳鐐瑰嚮', res);
+ this.addContractShow = true;
+ this.addContractFormdata = {
+ amount: null,
+ coalId: null,
+ coalName: '',
+ compId: null,
+ compName: '',
+ cost1: '',
+ cost2: '',
+ customerId: null,
+ customerName: '',
+ edit: true,
+ favouredpolicyIds: '',
+ filedId: null,
+ filedName: '',
+ fromStation: '',
+ modifyId: null,
+ modifyInfoId: null,
+ customerAddressId: null,
+ price: null,
+ priceMode: '0',
+ quant: '',
+ toStation: '',
+ trainType: 1,
+ type: ''
+ };
+ this.multipleSelection = [];
+ }
+ }
+ })
+ .catch(err => {
+ uni.$u.toast('鏁堥獙澶辫触');
+ });
+ },
+ // 娣诲姞鍚堝悓寮瑰嚭妗�
+ addContractClose() {
+ this.addContractShow = false;
+ },
+ addContractOpen() {
+ console.log('娣诲姞璁㈠崟鎵撳紑');
+ },
+ // 閫夋嫨鐓ゅ巶
+ coalFiledSelectOpen(e) {
+ console.log('coalfiledSelect: ', e);
+ },
+ coalFiledSelectClose() {
+ this.coalFiledSelectShow = false;
+ },
+ // 閫夋嫨鐨勭叅鍘�
+ coalFiledSelectClick(e) {
+ this.addContractFormdata.compName = e.compName;
+ this.addContractFormdata.filedName = e.name;
+ this.addContractFormdata.compId = e.compId;
+ this.addContractFormdata.filedId = e.id;
+ this.addContractFormdata.fromStation = e.toStation;
+
+ this.selectCoalFiledData = e;
+
+ this.coalFiledSelectShow = false;
+ },
+ // 鏀惰揣浜�
+ addContractConsigneeClose() {
+ this.addContractConsigneeShow = false;
+ },
+ // 娣诲姞鍚堝悓瀛愰」鏀惰揣浜烘墦寮�
+ addContractConsigneeOpen() {},
+ addContractConsignee() {
+ this.addContractConsigneeShow = true;
+ },
+ addContractConsigneeConfirm(v) {
+ this.addContractFormdata.toStation = v.toStation;
+ this.addContractFormdata.customerName = v.customerName;
+ this.$reqGet('getAccount', { customerId: v.id }).then(res => {
+ console.log('鑾峰彇鏀惰揣浜鸿处鍙�', res);
+ // this.accountDetails = res.data;
+ // this.newFormData.customerName = res.data.customerName;
+ // this.newFormData.customerId = res.data.id;
+ // this.searchContractForm.customerName = res.data.customerName;
+ this.addContractFormdata.customerId = res.data.id;
+ });
+ this.$nextTick(() => {
+ this.addContractConsigneeShow = false;
+ });
+
+ // 璧嬪�肩粰鍙栦环鏍艰姹傚弬鏁�
+ this.getNewPriceData.customerAddressName = v.customerFullName;
+ this.getNewPriceData.customerAddressId = v.id;
+ this.getNewPriceData.toStation = v.toStation;
+
+ this.addContractFormdata.toStation = v.toStation;
+ this.addContractFormdata.customerAddressId = v.id;
+
+ // 娣诲姞鐓ょ閫夐」
+ this.contractDetails.forEach(item => {
+ let a = [{ label: '', id: '' }];
+ a[0].label = item.coalName;
+ a[0].id = item.coalId;
+ if(this.addContractCoalData[0]){
+ this.addContractCoalData = [];
+ }
+ this.addContractCoalData.push(a);
+ });
+ },
+ // 鍝佺閫夋嫨鍣�
+ addContractCoalConfirm(e) {
+ console.log('鍝佺閫夋嫨鍣�', e);
+
+ this.addContractCoalShow = false; // 鍏抽棴閫夋嫨鍣�
+ this.addContractFormdata.coalId = e.value[0].id;
+ this.addContractFormdata.coalName = e.value[0].label;
+ // 鐓ょ浠锋牸璇锋眰(鐓ゅ巶=>浠锋牸鍙傛暟)
+ this.getNewPriceData.coalId = e.value[0].id;
+ this.getNewPriceData.coalName = e.value[0].label;
+
+ // this.selectCoalFiledData.compId = e.compId;
+ // this.selectCoalFiledData.compName = e.compName;
+ // this.selectCoalFiledData.toStation = e.fromStation;
+
+ this.$reqGet('getNewPrice', this.getNewPriceData).then(res => {
+ if (res.code == 0) {
+ let data = res.data;
+ if (data) {
+ this.currentCoal.coalName = data.coalName;
+ this.currentCoal.cokingPrice = data.cokingPrice; //鐒﹀寲浠锋牸
+ this.currentCoal.noImportantPrice = data.noImportantPrice; //涓嶉噸瑕佷环鏍�
+ this.currentCoal.quotePrice = data.quotePrice; // 鎸傜墝浠锋牸
+ this.currentCoal.steelMillPrice = data.steelMillPrice; // 閽㈠巶浠锋牸
+ this.currentCoal.modifyId = data.modifyId; //淇敼id
+ this.currentCoal.modifyInfoId = data.id;
+
+ this.addContractFormdata.price = data.steelMillPrice;
+ // if (data.coalPath && data.coalPath.indexOf('鍔ㄥ姏鐓�') > -1) {
+ // this.currentCoal.type = 0;
+ // } else {
+ // this.currentCoal.type = 1;
+ // }
+ this.addContractFormdata.modifyId = data.modifyId;
+ this.addContractFormdata.id = data.id;
+ } else {
+ uni.$u.toast('鐓ょ浠锋牸鏈缃�');
+ }
+ }
+ });
+ },
+ addContractCoalClose() {
+ this.addContractCoalShow = false;
+ },
+ // 鐓ゅ搧绉嶄环鏍�
+ groupChange(e) {
+ console.log('鍗曢�夋灏忕粍', e);
+ },
+ changePriceMode(e) {
+ if (!this.currentCoal) return;
+ this.addContractFormdata.priceMode = e;
+ switch (this.addContractFormdata.priceMode) {
+ case '0':
+ this.addContractFormdata.price = this.afterPrice.steelMillPrice;
+ break;
+ case '1':
+ this.addContractFormdata.price = this.afterPrice.cokingPrice;
+ break;
+ case '2':
+ this.addContractFormdata.price = this.afterPrice.noImportantPrice;
+ break;
+ case '3':
+ this.addContractFormdata.price = this.afterPrice.quotePrice;
+ break;
+ }
+ },
+ // 浼樻儬閫夋嫨
+ selectionChange(e) {
+ this.multipleSelection = [];
+ this.favouredpolicyList.forEach((item, i) => {
+ if (e.detail.index.indexOf(i) != -1) {
+ this.multipleSelection.push(item);
+ }
+ });
+ },
+ // 杩愯緭閫夋嫨鍣�
+ addContractTransportConfirm(e) {
+ this.addContractTransportShow = false;
+ this.addContractFormdata.trainType = e.value[0].value;
+ switch (this.addContractFormdata.trainType) {
+ case 1:
+ this.addContractTransport = '鍦伴攢';
+ break;
+ case 2:
+ this.addContractTransport = '璺繍';
+ break;
+ }
+ },
+ addContractTransportClose() {
+ this.addContractTransportShow = false;
+ },
+ // 鑾峰彇杩愯垂
+ async getFreight(from, to, customerId) {
+ let key = from + to + customerId;
+ let price = this.trainfreight[key];
+ price = await this.$reqGet('trainFreightFind', { from, to, customerId }).then(res => {
+ let resPrice = 10; //榛樿浠锋牸涓�10
+ if (res.data) {
+ resPrice = res.data.price;
+ }
+ return resPrice;
+ });
+ return price;
+ },
+ addContractSanConfirm() {
+ if (this.addContractFormdata.compId && this.addContractFormdata.customerId && this.addContractFormdata.filedId) {
+ this.newFormData.contractOrders.push(this.addContractFormdata);
+ this.$nextTick(() => {
+ this.addContractShow = false;
+ });
+ } else {
+ uni.$u.toast('璇疯鑼冭緭鍏ユ墍鏈変俊鎭�');
+ }
},
// 鍒濆鏁版嵁璇锋眰
operato() {
this.$reqGet('operator').then(res => {
// console.log('operator', res);
+ this.operator = res.data;
});
},
pay_type() {
@@ -622,9 +1443,15 @@
});
// console.log(this.actions);
},
+ // 鎶戝皹璐�
others_params() {
this.$reqGet('others_params').then(res => {
- // console.log('others_params', res);
+ console.log('others_params', res);
+ res.data.forEach(e => {
+ if (e.label == 'dust') {
+ this.dust = parseFloat(e.value);
+ }
+ });
});
},
coalprice() {
@@ -632,14 +1459,23 @@
// console.log('coalprice', res);
});
},
+ // 绾у埆璺濅紭鎯�
jcfavouredpolicyitem() {
this.$reqGet('jcfavouredpolicyitem', { current: 1, size: 1000, status: 0 }).then(res => {
- // console.log('jcfavouredpolicyitem', res);
+ console.log('绾у埆璺濅紭鎯�', res);
+ // this.favouredpolicyListAll = res.data.records;
});
},
+ // 鑾峰彇鎵�鏈夌殑浼樻儬鏀跨瓥
+ getFavouredPolicyItem() {
+ this.$reqGet('getFavouredPolicyItem', { current: 1, size: 1000, status: 0 }).then(res => {
+ this.favouredpolicyListAll = res.data.records;
+ });
+ },
+ // 鐓ゅ満
coalfiled() {
- this.$reqGet('coalfiled', { current: 1, size: 10 }).then(res => {
- // console.log('coalfiled', res);
+ this.$reqGet('coalfiled', this.coalfiledParams).then(res => {
+ this.coalfiledData = res.data.records;
});
},
// 鏃堕棿
@@ -656,8 +1492,70 @@
// moveHandleContract(){
// return true;
// },
+ // 鏂板缓鍙戣繍鐢宠
newApplicationFormDataClick() {
- console.log('纭鏂板鐢宠琛ㄥ崟');
+ this.$refs.formRef
+ .validate()
+ .then(res => {
+ let amount = 0;
+ this.newFormData.contractOrders.forEach(e => {
+ amount += Number(e.amount);
+ });
+ if (this.newFormData.payType == '0') {
+ if (this.accountDetails.balance < amount) {
+ let msg = this.accountDetails.balance == null ? 0 : this.accountDetails.balance;
+ uni.showToast({
+ title: '瀹㈡埛璐︽埛鐜版眹浣欓涓嶈冻锛岀幇姹囦綑棰�:' + msg,
+ icon: 'error',
+ duration: 2000
+ });
+ } else {
+ this.xswaybill();
+ }
+ } else {
+ if (this.accountDetails.balance2 < amount) {
+ let msg = this.accountDetails.balance2 == null ? 0 : this.accountDetails.balance2;
+ uni.showToast({
+ title: '瀹㈡埛璐︽埛鎵垮厬浣欓涓嶈冻锛屾壙鍏戜綑棰�:' + msg,
+ icon: 'error',
+ duration: 2000
+ });
+ } else {
+ this.xswaybill();
+ }
+ }
+ })
+ .catch(err => {
+ uni.$u.toast('鏍¢獙澶辫触');
+ });
+ },
+ // 鍒犻櫎璁㈠崟鍗$墖
+ deleteContractCardClick(e) {
+ console.log('鍒犻櫎璁㈠崟鍗$墖', e);
+ this.newFormData.contractOrders.splice(e, 1);
+ },
+ xswaybill() {
+ console.log('鏂板缓鍙戣繍鐢宠');
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ });
+ this.$reqPost('xswaybill', this.newFormData).then(res => {
+ uni.hideLoading();
+ console.log('鏂板缓鍙戣繍鐢宠', res);
+ if (res.code == 0) {
+ uni.showToast({
+ title: '娣诲姞鎴愬姛锛�',
+ icon: 'success',
+ duration: 2000
+ });
+ this.$nextTick(() => {
+ uni.navigateBack({
+ // url: '/pages/my-application/my-application'
+ delta: 2
+ });
+ });
+ }
+ });
},
backPage() {
uni.navigateBack({
@@ -725,67 +1623,11 @@
// 鏁版嵁鍒楄〃
.searchResultList {
margin-top: vww(16);
- .u-collapse {
- .u-collapse-item {
- .u-collapse-item__content {
- .u-collapse-item__content__text {
- padding: 0;
- }
- }
- }
- }
- .customerDetails {
- .uni-table-scroll {
- min-width: 0 !important;
- // overflow-x: hidden;
- .uni-table {
- .uni-table-tr {
- padding: 0;
- font-size: vww(13);
- .uni-table-th {
- width: vww(100);
- height: vww(32);
- line-height: vww(20);
- padding: vww(5) vww(10);
- color: #111111;
- font-weight: 400;
- background: #f5f5f5;
- }
-
- .uni-table-td {
- height: vww(32);
- line-height: vww(20);
- padding: vww(5) vww(10);
- color: #111111;
- }
- }
- }
- }
-
- .table-head {
- height: vww(32);
- border: vww(1) solid #dddddd;
- display: flex;
- justify-content: space-between;
- font-size: vww(13);
- line-height: vww(32);
- padding: 0 vww(8);
- background: #f5f5f5;
-
- .titleText {
- font-weight: 550;
- }
-
- .timeText {
- color: #999999;
- }
- }
- }
}
// 鍚堝悓琛ㄦ牸
.tableContract {
- margin-top:vww(30);
+ margin-top: vww(30);
display: flex;
justify-content: center;
.uni-table-scroll {
@@ -818,12 +1660,12 @@
.TableUtilBtn {
width: 20%;
overflow: hidden;
- .uni-table{
- min-width:0!important;
+ .uni-table {
+ min-width: 0 !important;
}
- .TableUtilBtnContainer{
- .u-button{
- width:vww(20);
+ .TableUtilBtnContainer {
+ .u-button {
+ width: vww(20);
}
}
}
@@ -875,47 +1717,217 @@
}
}
- // 琛ㄦ牸
- .newApplicationTable {
- margin: vww(40) auto;
- width: 91%;
- .uni-table {
- .uni-table-tr {
- .uni-table-th {
- padding: 0;
- width: vww(88);
- height: vww(40);
- background-color: #f5f5f5;
- color: #111111;
- font-size: vww(13);
- font-weight: 500;
- }
- .uni-table-td {
- width: vww(253);
- height: vww(40);
- background-color: #ffffff;
- color: #111111;
- font-size: vww(13);
- display: flex;
- justify-content: space-between;
- align-items: center;
- .text {
+ // 鐓ゅ巶
+ .addContractContainer {
+ .u-popup {
+ .u-transition {
+ height: 95%;
+ .u-popup__content {
+ overflow: scroll !important;
+ .addContractFormTitle {
+ margin-bottom: 0;
}
- .icon {
- display: flex;
- align-items: center;
- image {
- width: vww(10);
- height: vww(5.5);
+
+ // 鎼滅储
+ .coalFiledSelectSearch {
+ }
+ // 閫夋嫨鐓ょ
+ .coalFiledSelectPopup {
+ .u-popup {
+ .u-transition {
+ height: 80%;
+ .u-popup__content {
+ overflow: scroll !important;
+ // 琛ㄦ牸
+ .coalFiledTable {
+ width: 92%;
+ display: flex;
+ justify-content: center;
+ margin: 0 auto;
+ .uni-table-scroll {
+ min-width: 0 !important;
+ .uni-table {
+ .uni-table-tr {
+ padding: 0;
+ font-size: vww(13);
+ .uni-table-th {
+ width: vww(100);
+ height: vww(32);
+ line-height: vww(20);
+ padding: vww(5) vww(10);
+ color: #111111;
+ font-weight: 400;
+ background: #f5f5f5;
+ }
+
+ .uni-table-td {
+ line-height: vww(20);
+ padding: vww(5) vww(10);
+ color: #111111;
+ }
+ }
+ }
+ }
+ .tableBody {
+ width: 80%;
+ }
+ .TableUtilBtn {
+ width: 20%;
+ overflow: hidden;
+ .uni-table {
+ min-width: 0 !important;
+ }
+ .TableUtilBtnContainer {
+ .u-button {
+ width: vww(20);
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}
}
}
- // 杈规
- // .table--border{
- // border:1px solid #DDDDDD;
- // }
+ }
+
+ // 娣诲姞鍚堝悓
+ .addContractContainer {
+ .u-popup {
+ .u-transition {
+ height: 95%;
+ .u-popup__content {
+ // background-color: rgb(247, 247, 247);
+ overflow: scroll !important;
+ .addContractForm {
+ width: 92%;
+ margin: 0 auto;
+
+ // 琛ㄥ崟
+ // .u-form{
+ // .u-form-item{
+ // .u-form-item__body{
+ // .u-form-item__body__right{
+ // .u-form-item__body__right__content__slot{
+ // .u-input{
+ // border:1px solid #dddddd;
+ // .u-input__content{
+
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+
+ .formUpCard {
+ margin-top: vww(10);
+ padding: vww(10);
+ border-radius: vww(4);
+ box-shadow: 0 2px 16px #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
+ background-color: #ffffff;
+ // 浠锋牸鍗$墖
+ .priceList {
+ min-height: vww(20);
+ border-radius: vww(4);
+ padding: vww(10) 0;
+ box-shadow: 0 2px 16px #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
+ // margin-top:vww(10);
+ background-color: #ffffff;
+ .currentPriceContainer {
+ .currentPriceBox {
+ width: 92%;
+ margin: 0 auto;
+ }
+ }
+ .selectPriceContainer {
+ .selectPricebox {
+ width: 92%;
+ margin: 0 auto;
+ .selectPriceboxItem {
+ display: flex;
+ justify-content: space-between;
+ }
+ }
+ }
+ }
+ }
+ .formDownCard {
+ border-radius: vww(4);
+ padding: vww(10);
+ box-shadow: 0 2px 16px #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
+ margin-top: vww(10);
+ background-color: #ffffff;
+ }
+
+ .addContractConfirm {
+ margin-top: vww(30);
+ }
+ }
+
+ // 鍝佺閫夋嫨鍣�
+ .addContractCoalPicker {
+ .u-popup {
+ .u-transition {
+ height: auto;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // 琛ㄦ牸
+ .newApplicationTable {
+ margin: vww(40) auto;
+ width: 100%;
+ padding: vww(0) vww(10) vww(60) vww(10);
+ box-sizing: border-box;
+ .u-swipe-action {
+ .u-swipe-action-item {
+ box-shadow: 0 2px 16px #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
+ margin-top: vww(10);
+ .u-swipe-action-item__right {
+ .u-swipe-action-item__right__button {
+ .u-swipe-action-item__right__button__wrapper {
+ background-color: #ee336b !important;
+ }
+ }
+ }
+ }
+ }
+ .cardList {
+ height: vww(130);
+ border-radius: vww(4);
+ padding: vww(10);
+ .cardList-container {
+ .cardList_item {
+ margin-top: vww(12);
+ font-size: 14px;
+ display: flex;
+ view {
+ width: 50%;
+ &:nth-child(2) {
+ margin-left: vww(20);
+ }
+ }
+ }
+ }
+ }
+ .addCard {
+ width: 100%;
+ height: vww(130);
+ margin-top: vww(10);
+ border-radius: vww(4);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ box-shadow: 0 2px 16px #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
+ }
}
// button
diff --git a/pages/new-application/new-application.vue b/pages/new-application/new-application.vue
index 3992476..f4d7ca8 100644
--- a/pages/new-application/new-application.vue
+++ b/pages/new-application/new-application.vue
@@ -81,9 +81,15 @@
},
methods: {
init(){
+ this.newApplicationData = [];
this.$reqGet('getNewProcessDataList',this.updateData).then(res=>{
if(res.code === 0){
- this.newApplicationData = res.data.records
+ res.data.records.forEach(item=>{
+ if(item.id=="WAY_BILL:4:87504"){
+ this.newApplicationData.push(item);
+ }
+ })
+
console.log("鏂板",res);
}
})
diff --git a/static/menuIcon/menu-shipment.png b/static/menuIcon/menu-shipment.png
new file mode 100644
index 0000000..9a78569
--- /dev/null
+++ b/static/menuIcon/menu-shipment.png
Binary files differ
diff --git a/utils/api.js b/utils/api.js
index c42b81e..b1298e1 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -49,6 +49,12 @@
name:'pig',
method:'GET'
},
+ // 鑾峰彇鍏ㄩ儴浼樻儬鏀跨瓥
+ getFavouredPolicyItem:{
+ url:'/yunxiao/jcfavouredpolicyitem/page',
+ method:'GET'
+ },
+ // 鐓ゅ満
coalfiled:{
url:'/yunxiao/coalfiled/page',
name:'pig',
@@ -67,6 +73,12 @@
url:'/yunxiao/account/getAccount',
method:'GET'
},
+ // 閫夋嫨瀹㈡埛鍥炶皟
+ // customerAccount:{
+ // url:'/yunxiao/account/getAccountByCustmoerIdAndCompId',
+ // method:'GET'
+ // },
+
// 閫夋嫨鍚堝悓
contract:{
@@ -82,22 +94,39 @@
url:'/admin/dict/type/contract_type',
method:'GET'
},
- // 閫夊畾鍚堝悓
- getByContractId:{
- url:'/yunxiao/contractitem/getByContractId',
+ trainFreightFind:{
+ url:"/yunxiao/trainFreight/find",
+ mehtod:"GET"
+ },
+
+
+ // 娣诲姞鐢宠
+ xswaybill:{
+ url:'/yunxiao/xswaybill',
+ method:'POST'
+ },
+ // 鐓ょ浠锋牸淇敼淇℃伅
+ getNewPrice:{
+ url:'/yunxiao/coalpricemodifyinfo/getNewPrice',
method:'GET'
},
+ // 鑾峰彇杩愯垂
+
+
// 鎾ゅ洖
withDraw:{
url:'/oa/actBusiness/cancel',
- name:'pig',
method:'POST'
+ },
+ // 鑾峰彇鎿嶄綔浜�
+ getFirstNode:{
+ url:'/oa/actProcess/getFirstNode',
+ method:'GET'
},
// 閲嶆柊鐢宠
apply:{
url:'/oa/actBusiness/apply',
- name:'pig',
method:'POST'
},
// 鎴戠殑寰呭姙
diff --git a/utils/index.js b/utils/index.js
index f87a629..a4b5a19 100644
--- a/utils/index.js
+++ b/utils/index.js
@@ -8,8 +8,6 @@
},
headerPOST: {
"Content-type":'application/json'
- // 'Content-Type': 'application/x-www-form-urlencoded',
-
},
}
@@ -20,17 +18,22 @@
return fetch(url, opt)
}
-// get璇锋眰
-export const reqGet = (url, params, opt = {}) => {
+// get璇锋眰
+// urlParam鏄嫾鎺ヨ矾寰勭殑鍙傛暟
+export const reqGet = (url, params, urlParam, opt = {}) => {
opt.header = typeObj['headerGET'];
opt.method = "GET";
opt.data = params;
- return fetch(url, opt)
+ return fetch(url, opt ,urlParam)
}
// post璇锋眰
-export const reqPost = (url, params, opt = {}) => {
- opt.header = typeObj['headerPOST'];
+export const reqPost = (url, params, form, opt = {}) => {
+ if(form == 'form'){
+ opt.header = {'Content-Type': 'application/x-www-form-urlencoded'}
+ } else {
+ opt.header = typeObj['headerPOST'];
+ }
opt.method = "POST";
opt.data = params;
return fetch(url, opt)
diff --git a/utils/request.js b/utils/request.js
index 43fa9c7..b8a09ec 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -89,11 +89,11 @@
// 璇锋眰鎷︽埅
-const fetch = (url, opt) => {
+const fetch = (url, opt ,urlParam) => {
let urls = (api[opt.url]?.url || api[url]?.url || jihua[opt.url]?.url || jihua[url]?.url);
let params = opt.params ? ('?' + Object.keys(opt.params).map(key => key + '=' + opt.params[key]).join('&')) :
'';
- opt.url = urls + params
+ opt.url = urlParam ? urls + `/${urlParam}` + params : urls + params
opt.method = opt.method || "GET";
var header = {}
if (uni.getStorageSync('access_token')) {
@@ -103,8 +103,7 @@
VERSION: "zzl"
}
}
- // 'Bearer'
- // 'version:zzl'
+
opt.header = {
...opt.header,
...header
--
Gitblit v1.9.1