Browse Source

商机修改

yusheng 10 tháng trước cách đây
mục cha
commit
b89b0541a0

+ 5 - 4
pages/saleManage/businessOpportunity/add.vue

@@ -46,14 +46,14 @@
 				<uni-datetime-picker type="date" slot="value" v-model="form.expectedClosingDate">
 				</uni-datetime-picker>
 			</u-cell>
-			<u-cell title="计价方式" arrow-direction="down">
+<!-- 			<u-cell title="计价方式" arrow-direction="down">
 
 				<radio-group @change="radioChange" v-model="form.pricingWay" slot="value">
 					<radio value="1" :checked="form.pricingWay==1">按数量计价</radio>
 					<radio value="2" :checked="form.pricingWay==2">按重量计价</radio>
 
 				</radio-group>
-			</u-cell>
+			</u-cell> -->
 
 			<u-cell title="备注" arrow-direction="down">
 				<u--textarea slot="value" placeholder="请输入" border="surround" v-model="form.remark"></u--textarea>
@@ -65,7 +65,7 @@
 			<u-button type="default" text="返回" @click="back"></u-button>
 			<u-button type="primary" @click="save" text="保存"></u-button>
 		</view>
-		<produceList ref="produceListRef" v-show="current==1" :pricingWay="form.pricingWay"></produceList>
+		<produceList ref="produceListRef" v-show="current==1"  :isTemporary="true"></produceList>
 		<businessList ref="businessListRef" v-show="current==2"></businessList>
 		<personnelList ref="personnelListRef" :linkList="linkList" v-show="current==3"></personnelList>
 		<u-toast ref="uToast"></u-toast>
@@ -211,7 +211,7 @@
 			},
 
 			async save() {
-				console.log(this.$refs.produceListRef.getValue(), 'this.$refs.produceListRef.getValue()')
+			
 				try {
 
 					if (!this.form.contactName) {
@@ -290,6 +290,7 @@
 		position: fixed;
 		bottom: 0;
 		z-index: 10;
+		background-color: #fff;
 
 		/deep/.u-button {
 			height: 100%;

+ 12 - 9
pages/saleManage/businessOpportunity/index.vue

@@ -15,14 +15,15 @@
 			<image class="menu_icon" src="~@/static/pda/menu.svg"></image>
 
 		</view>
-<!-- 		<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
+		<!-- 		<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
 			<myCard @del="del(item)" :item="item" :index="index+1" :columns="columns" :btnList="btnList"></myCard>
 
 		</view> -->
 		<view class="wrapper">
 			<u-list @scrolltolower="scrolltolower" class="listContent">
 				<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
-					<myCard @del="del(item)" :item="item" :index="index+1" :columns="columns" :btnList="btnList"></myCard>
+					<myCard @del="del(item)" :item="item" :index="index+1" :columns="columns" :btnList="btnList">
+					</myCard>
 				</view>
 			</u-list>
 		</view>
@@ -34,7 +35,7 @@
 			<u-icon name="plus" color="#fff"></u-icon>
 		</view>
 
-
+		
 		<u-toast ref="uToast"></u-toast>
 
 	</view>
@@ -58,6 +59,7 @@
 				page: 1,
 				size: 10,
 				isEnd: false,
+		
 				current: {},
 				btnList: [{
 					name: '详情',
@@ -74,10 +76,10 @@
 					pageUrl: '/pages/saleManage/businessOpportunity/add',
 					judge: [{
 						authorities: '',
-					},{
+					}, {
 						key: 'approvalStatus',
 						value: [0, 3],
-					
+
 					}],
 				}, {
 					name: '跟进',
@@ -89,13 +91,13 @@
 				}, {
 					name: '删除',
 					apiName: 'del',
-				
+
 					btnType: 'error ',
 					type: '2',
 					pageUrl: '',
 					judge: [{
 						authorities: 'eom:businessopportunity:delete',
-					},{
+					}, {
 						key: 'approvalStatus',
 						value: [0, 3]
 					}],
@@ -157,7 +159,7 @@
 			this.page = 1
 			this.getList()
 		},
-		
+
 		methods: {
 			doSearch() {
 				this.isEnd = false
@@ -196,6 +198,7 @@
 				uni.navigateTo({
 					url: '/pages/saleManage/businessOpportunity/add'
 				})
+
 			},
 
 			view() {
@@ -212,7 +215,7 @@
 					this.getList(this.where)
 				})
 			},
-			scrolltolower(){
+			scrolltolower() {
 				if (this.isEnd) {
 					return
 				}

+ 9 - 1
pages/saleManage/components/myCard.vue

@@ -7,7 +7,15 @@
 			<view class="perce50" :class="val.className" :style="val.style" v-for="(val) in _item" :key="val.prop">
 				<view class="item_box rx-sc" v-if="val.type=='title'">
 					<view class="round" v-if='index'>{{index}}</view>
-					<view class="orderId" :style="{marginLeft: index?'16rpx':''}">{{item[val.prop]||''}} </view>
+					<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-if="val.slot">
+						<slot :name="val.slot"> </slot>
+
+					</view>
+					<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-else>
+
+						{{item[val.prop]||''}}
+					</view>
+
 				</view>
 
 				<view class="item_one rx-sc" v-else-if="val.type=='action'">

+ 114 - 46
pages/saleManage/components/produceList.vue

@@ -8,7 +8,8 @@
 				<u--input :disabled="!!contractId" slot="singleWeight" @input="singleWeightChange(item,index)"
 					type="number" placeholder="请输入" border="surround" v-model="item.singleWeight"></u--input>
 				<u--input :disabled="!!contractId" slot="singlePrice" style="flex:none;width: 50%;"
-					@input="getTotalPrice()" type="number" placeholder="请输入" border="surround" v-model="item.singlePrice">
+					@input="getTotalPrice()" type="number" placeholder="请输入" border="surround"
+					v-model="item.singlePrice">
 					<template slot="suffix">元</template>
 				</u--input>
 				<uni-datetime-picker :disabled="!!contractId" type="date" slot="customerExpectDeliveryDeadline"
@@ -19,8 +20,26 @@
 				<uni-data-picker :readonly="!!contractId" slot="guaranteePeriodUnitCode"
 					v-model="item.guaranteePeriodUnitCode" placeholder="请选择" :localdata="date_unit">
 				</uni-data-picker>
-				<u--input slot="customerMark" placeholder="请输入" border="surround"
-					v-model="item.customerMark"></u--input>
+				<u--input slot="customerMark" placeholder="请输入" border="surround" v-model="item.customerMark">
+
+				</u--input>
+				<u--input slot="productBrand" placeholder="请输入" border="surround" :disabled="item.productCode"
+					v-model="item.productBrand">
+				</u--input>
+				<u--input slot="specification" placeholder="请输入" border="surround" :disabled="item.productCode"
+					v-model="item.specification">
+
+				</u--input>
+				<u--input slot="measuringUnit" placeholder="请输入" border="surround" :disabled="item.productCode"
+					v-model="item.measuringUnit">
+				</u--input>
+				<u--input slot="modelType" placeholder="请输入" border="surround" :disabled="item.productCode"
+					v-model="item.modelType">
+				</u--input>
+
+				<u--input slot="productName" placeholder="请输入" border="surround" :disabled="item.productCode"
+					v-model="item.productName">
+				</u--input>
 			</myCard>
 
 
@@ -33,7 +52,8 @@
 		<view class="add" @click="add" v-if="!contractId">
 			<u-icon name="plus" color="#fff"></u-icon>
 		</view>
-
+		<u-action-sheet :actions="addList" :show="show" :closeOnClickOverlay="true" :closeOnClickAction="true"
+			@close="show=false" @select='select'> </u-action-sheet>
 	</view>
 </template>
 
@@ -47,7 +67,15 @@
 		data() {
 			return {
 				tableList: [],
+				addList: [{
+						name: '选择物品清单',
 
+					},
+					{
+						name: '新增临时产品',
+					}
+				],
+				show: false,
 				current: {},
 				date_unit: [],
 				allPrice: '',
@@ -59,6 +87,17 @@
 					pageUrl: '',
 
 				}],
+				defaultForm: {
+					key: null,
+					endTime: '',
+					isFirst: 0,
+					name: '',
+					startTime: '',
+					workHour: '',
+					guaranteePeriodUnitCode: '',
+					technicalDrawings: [],
+					arrivalWay: 1
+				}
 
 			}
 		},
@@ -69,6 +108,11 @@
 			pricingWay: {
 				default: 1
 			},
+			isTemporary: {
+				//临时
+				type: Boolean,
+				default: false
+			},
 			contractId: '',
 			columns: {
 				type: Array,
@@ -76,6 +120,7 @@
 					[{
 						label: '产品名称:',
 						prop: 'productName',
+						slot: 'productName',
 						type: 'title',
 						className: 'perce100',
 					}],
@@ -84,14 +129,17 @@
 						prop: 'productCode'
 					}, {
 						label: '牌号:',
-						prop: 'productBrand'
+						prop: 'productBrand',
+						slot: 'productBrand',
 					}],
 					[{
 						label: '规格:',
-						prop: 'specification'
+						prop: 'specification',
+						slot: 'specification',
 					}, {
 						label: '型号:',
-						prop: 'modelType'
+						prop: 'modelType',
+						slot: 'modelType',
 					}],
 					[{
 						label: '数量:',
@@ -100,6 +148,7 @@
 					}, {
 						label: '计量单位:',
 						prop: 'measuringUnit',
+						slot: 'measuringUnit',
 					}],
 
 					[{
@@ -162,29 +211,65 @@
 					item['productName'] = item.name
 					item['approvalNumber'] = item.extField.approvalNumber
 					item['packingSpecification'] = item.extField.packingSpecification
+					item['packageDispositionList'] = item.packageDispositionList
+
+					if (item.packageDispositionList?.length) {
+						item['saleUnitId'] = item.packageDispositionList[0].id
+						item['saleUnit'] = item.packageDispositionList[0].conversionUnit
+
+					}
 				})
 				this.tableList.push(...data)
 			})
 
 			this.getByCode()
 		},
-		mounted() {
-		
-		},
-		watch:{
-			contractId(val){
+
+		watch: {
+			contractId(val) {
 				if (val) {
 					this.btnList = []
 				}
-				
+
 			}
 		},
 		methods: {
+			add() {
+				if (this.isTemporary) {
+					this.show = true
+				} else {
+					uni.navigateTo({
+						url: '/pages/saleManage/components/selectProduce?isAll=' + 1
+					})
+				}
+
+
+			},
+			select({
+				name
+			}) {
+				if (name == '选择物品清单') {
+					uni.navigateTo({
+						url: '/pages/saleManage/components/selectProduce?isAll=' + 1
+					})
+				} else {
+					this.handlAdd()
+				}
+
+
+
+			},
+			// 添加
+			handlAdd() {
+				let item = JSON.parse(JSON.stringify(this.defaultForm));
+				item.key = this.tableList.length + 1;
+				this.tableList.push(item);
+			},
 			init(list) {
 				if (list) {
 					this.tableList = JSON.parse(JSON.stringify(list))
 					this.getTotalPrice(list)
-					
+
 				}
 			},
 			getValue() {
@@ -192,7 +277,7 @@
 			},
 
 			del(index) {
-                
+
 				this.tableList.splice(index, 1);
 
 			},
@@ -225,13 +310,13 @@
 					sum = this.getNumTotalPrice();
 					let allsum = sum.toFixed(2);
 					this.allPrice = allsum;
-					if(!row){
+					if (!row) {
 						uni.$emit('allsum', allsum)
 					}
 					return allsum;
 				} else {
 					this.allPrice = 0.0;
-					if(!row){
+					if (!row) {
 						uni.$emit('allsum', allsum)
 					}
 					return 0.0;
@@ -265,26 +350,23 @@
 			},
 			//计算单重
 			singleWeightChange(row, index) {
-				if (row && row.singleWeight && row.totalCount) {
-					row.totalWeight = (row.singleWeight * row.totalCount).toFixed(2) || 0;
-					this.$set(this.tableList[index], 'totalWeight', row.totalWeight);
+
+
+				if (row.weightUnit == row.measuringUnit) {
+					this.$set(this.tableList[index], 'totalWeight', row.totalCount);
+				} else if (row.totalCount && row.singleWeight) {
+					this.$set(this.tableList[index], 'totalWeight', (row.singleWeight * row.totalCount).toFixed(2) || 0);
 				} else {
-					this.$set(this.tableList[index], 'totalWeight', '');
-				}
-				if (this.pricingWay == 2) {
-					this.getTotalPrice();
+					this.$set(this.tableList[index], 'totalWeight', 0);
 				}
+
+
 			},
 			//获取合计
 			getAllPrice(row) {
-				let num = 0;
+				let num = Number(row.singlePrice) * Number(row.totalCount);
 
-				if (this.pricingWay == 1) { //按数量计价计算总金额
-					num = Number(row.singlePrice) * Number(row.totalCount);
 
-				} else if (this.pricingWay == 2) { //按重量计价计算总金额
-					num = Number(row.singlePrice) * Number(row.totalCount) * Number(row.singleWeight);
-				}
 
 				return isNaN(num) ? '' : num.toFixed(2);
 
@@ -320,18 +402,8 @@
 			},
 			//获取折让合计
 			getDiscountTotalPrice(row, val) {
-				let num = 0;
-
-				if (this.pricingWay == 1) {
-					num = Number(row.discountSinglePrice) * Number(row.totalCount);
+				let num = Number(row.discountSinglePrice) * Number(row.totalCount);
 
-				} else if (this.pricingWay == 2) {
-					num =
-						Number(row.discountSinglePrice) *
-						Number(row.totalCount) *
-						Number(row.singleWeight);
-
-				}
 
 				return isNaN(num) ? '' : num.toFixed(2);
 			},
@@ -341,11 +413,7 @@
 					this.$set(this.tableList[index], 'customerMark', val)
 				})
 			},
-			add() {
-				uni.navigateTo({
-					url: '/pages/saleManage/components/selectProduce?isAll=' + 1
-				})
-			}
+
 
 		}
 	}

+ 21 - 5
pages/saleManage/components/selectProduce.vue

@@ -66,7 +66,8 @@
 <script>
 	import {
 		getProduceTreeByPid,
-		getCategoryList
+		getCategoryList,
+		getCategoryPackageDisposition
 	} from '@/api/warehouseManagement'
 	import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
 	export default {
@@ -86,7 +87,7 @@
 				listData: [], //列表数据
 				classificationList: [], //分类数据
 				seletedAll: false, //全选状态,
-				isAll: '' 
+				isAll: ''
 
 			}
 		},
@@ -149,7 +150,9 @@
 				this.getList()
 			},
 			async getClassify() {
-				getProduceTreeByPid({ type: 1 }).then(res => {
+				getProduceTreeByPid({
+					type: 1
+				}).then(res => {
 					this.classificationList = res
 					this.page = 1
 					this.getList()
@@ -191,10 +194,23 @@
 				}
 			},
 			//跳转回添加页面
-			jumpAdd() {
+			async jumpAdd() {
+				let list = this.listData.filter(item => item.checked)
+
+				// 获取包装规格
+				let packingSpecification = await getCategoryPackageDisposition({
+					categoryIds: list.map(item => item.id)
+				});
+				list.forEach((item) => {
+					item['packageDispositionList'] = packingSpecification
+						.filter((ite) => item.id == ite.categoryId && ite.conversionUnit)
+						.sort((a, b) => a.sort - b.sort);
+				});
+
+
 				uni.$emit(
 					'setProduceList',
-					this.listData.filter(item => item.checked)
+					list
 				)
 
 				uni.navigateBack()

+ 12 - 13
pages/saleManage/contact/add.vue

@@ -31,8 +31,7 @@
 			<u-cell title="单位电话" arrow-direction="down">
 				<u--input slot="value" placeholder="请输入" border="surround" v-model="form.phone"></u--input>
 			</u-cell>
-			<u-cell title="地址" arrow-direction="down">
-
+			<u-cell title="注册地址" arrow-direction="down">
 				<uni-data-picker v-model="address" :map="{text:'label',value:'value'}" slot="value" placeholder="请选择地址"
 					popup-title="请选择城市" :localdata="chinaData" @change="onchange">
 				</uni-data-picker>
@@ -40,6 +39,14 @@
 			<u-cell title="详细地址" arrow-direction="down">
 				<u--textarea slot="value" placeholder="请输入" border="surround" v-model="form.address"></u--textarea>
 			</u-cell>
+			<u-cell title="联系地址" arrow-direction="down">
+				<uni-data-picker v-model="address1" :map="{text:'label',value:'value'}" slot="value" placeholder="请选择地址"
+					popup-title="请选择城市" :localdata="chinaData" @change="onchange1">
+				</uni-data-picker>
+			</u-cell>
+			<u-cell title="详细地址" arrow-direction="down">
+				<u--textarea slot="value" placeholder="请输入" border="surround" v-model="otherForm.address"></u--textarea>
+			</u-cell>
 			<u-cell title="统一社会信用代码" arrow-direction="down">
 				<u--input slot="value" placeholder="请输入" border="surround"
 					v-model="form.unifiedSocialCreditCode"></u--input>
@@ -72,7 +79,7 @@
 				<uni-data-picker v-model="form.level" slot="value" placeholder="请选择" :localdata="contact_level">
 				</uni-data-picker>
 			</u-cell>
-			<u-cell title="结算方式" arrow-direction="down">
+			<!-- 			<u-cell title="结算方式" arrow-direction="down">
 				<uni-data-picker v-model="otherForm.settlementMode" slot="value" placeholder="请选择"
 					:localdata="settlement_mode">
 				</uni-data-picker>
@@ -90,17 +97,8 @@
 			</u-cell>
 			<u-cell title="收件人电话" arrow-direction="down">
 				<u--input slot="value" placeholder="请输入" border="surround" v-model="otherForm.senderPhone"></u--input>
-			</u-cell>
-			<u-cell title="收件人地址" arrow-direction="down">
-				<uni-data-picker v-model="address1" :map="{text:'label',value:'value'}" slot="value" placeholder="请选择地址"
-					popup-title="请选择城市" :localdata="chinaData" @change="onchange1">
-				</uni-data-picker>
-			</u-cell>
-
+			</u-cell> -->
 
-			<u-cell title="收件人详细地址" arrow-direction="down">
-				<u--textarea slot="value" placeholder="请输入" border="surround" v-model="otherForm.address"></u--textarea>
-			</u-cell>
 
 			<u-cell title="经营范围" arrow-direction="down">
 				<u--textarea slot="value" placeholder="请输入" border="surround"
@@ -396,6 +394,7 @@
 		position: fixed;
 		bottom: 0;
 		z-index: 10;
+		background-color: #fff;
 
 		/deep/.u-button {
 			height: 100%;

+ 9 - 8
pages/saleManage/contact/components/info.vue

@@ -46,11 +46,16 @@
 					{{form.phone||''}}
 				</text>
 			</u-cell>
-			<u-cell title="详细地址" arrow-direction="down">
+			<u-cell title="注册地址" arrow-direction="down">
 				<text slot="value">
 					{{(form.addressName||'')+form.address||''}}
 				</text>
 			</u-cell>
+			<u-cell title="联系地址" arrow-direction="down">
+				<text slot="value">
+					{{(otherForm.addressName||'')+otherForm.address||''}}
+				</text>
+			</u-cell>
 			<u-cell title="统一社会信用代码" arrow-direction="down">
 				<text slot="value">
 					{{form.unifiedSocialCreditCode||''}}
@@ -86,7 +91,7 @@
 					{{form.contact_level||''}}
 				</text>
 			</u-cell>
-			<u-cell title="结算方式" arrow-direction="down">
+	<!-- 		<u-cell title="结算方式" arrow-direction="down">
 				<text slot="value">
 					{{otherForm.settlementModeName||''}}
 				</text>
@@ -110,12 +115,8 @@
 				<text slot="value">
 					{{otherForm.senderPhone||''}}
 				</text>
-			</u-cell>
-			<u-cell title="收件人详细地址" arrow-direction="down">
-				<text slot="value">
-					{{(otherForm.addressName||'')+otherForm.address||''}}
-				</text>
-			</u-cell>
+			</u-cell> -->
+	
 			<u-cell title="经营范围" arrow-direction="down">
 				<text slot="value">
 					{{otherForm.businessScope||''}}

+ 1 - 1
pages/saleManage/contact/components/linkListAdd.vue

@@ -64,7 +64,7 @@
 					email: '',
 					deptName: '',
 					post: '',
-					status: '',
+					status: '1',
 					ifChief:0,
 					remark: '',
 				},