Explorar o código

生成销售单

lilei %!s(int64=2) %!d(string=hai) anos
pai
achega
fc2153ccc8

+ 15 - 0
api/shelfReplenish.js

@@ -132,4 +132,19 @@ export const saveMainAndDetail = (params) => {
     data: params,
     method: 'post'
   })
+}
+// 查询关联的销售单
+export const queryRelationSalesBill = (params) => {
+  return axios.request({
+    url: `shelfReplenish/queryRelationSalesBill/${params.replenishBillSn}`,
+    method: 'get'
+  })
+}
+// 生成销售单
+export const createSalesBill = (params) => {
+  return axios.request({
+    url: `shelfReplenish/createSalesBill/${params.replenishBillSn}`,
+    data: params,
+    method: 'post'
+  })
 }

+ 5 - 1
pages/common/commonModal.vue

@@ -2,7 +2,7 @@
 	<u-mask class="commonModal" :show="isShow" :mask-click-able="false" z-index="999998">
 		<view class="modal-con">
 			<u-icon v-if="isClose" @click="isShow=false" class="close-icon" name="close-circle" size="40" color="#999"></u-icon>
-			<view class="modal-title">{{title}}</view>
+			<view class="modal-title" v-if="showTitle">{{title}}</view>
 			<view class="modal-main">
 			{{content}}
 			<slot></slot>
@@ -45,6 +45,10 @@
 			cancelText: { //  取消按钮内容
 				type: String,
 				default: '取消'
+			},
+			showTitle:{ //  是否显示标题
+				type: Boolean,
+				default: true
 			}
 		},
 		data() {

+ 9 - 8
pages/common/partList.vue

@@ -26,23 +26,24 @@
 									<text class="pcode">{{item.product&&item.product.code?item.product.code:'--'}}</text>
 								</view>
 								<view v-if="pageType=='replenishmentSign'||pageType=='manualPrint'||pageType=='scanCodePrint'">
-									{{item.billState == 'FINISH'?'签收数量':'实发数量'}}:
+									{{item.billState == 'FINISH'?'签收数量':'补货数量'}}:
 									<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}{{item.product&&item.product.unit?item.product.unit:'--'}}</text>
 								</view>
 								<view v-if="pageType=='replenishmentOut'">
-									x<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}</text>
+								   补货数量<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}{{item.product&&item.product.unit?item.product.unit:'--'}}</text>
 								</view>
 								<view v-if="pageType=='replenishmentDetail'">
-									应发<text class="pnums">{{item.qty||item.qty==0?item.qty:'--'}}</text>
-									实发<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}</text>
+									补货<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}</text>/
 									签收<text class="pnums">{{item.putQty||item.putQty==0?item.putQty:'--'}}</text>
+									({{item.product&&item.product.unit?item.product.unit:'--'}})
 								</view>
 								<view v-if="pageType=='sendOutGoods'">
-									实发:<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}{{item.product&&item.product.unit?item.product.unit:'--'}}</text>
-									/已扫:<text class="pnums">{{item.scanQty||item.scanQty==0?item.scanQty:'--'}}</text>
+									补货<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}</text>
+									/已扫<text class="pnums">{{item.scanQty||item.scanQty==0?item.scanQty:'--'}}</text>
+									({{item.product&&item.product.unit?item.product.unit:'--'}})
 								</view>
 								<view v-if="pageType=='replenishmentDetailc'">
-									<text class="pnums">{{item.qty||item.qty==0?item.qty:'--'}}</text>
+									补货数量:<text class="pnums">{{item.qty||item.qty==0?item.qty:'--'}}</text>
 									{{item.product&&item.product.unit?item.product.unit:'--'}}
 								</view>
 								<view v-if="pageType=='recall'">
@@ -81,7 +82,7 @@
 				<view v-if="model == 'view'" class="ptools flex align_center justify_between">
 					<view></view>
 					<view class="pcurnums flex align_center" v-if="pageType=='replenishmentSign'">
-						<text>入库数量</text>
+						<text>签收数量</text>
 						<view class="u-ninput">
 							<u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.putQty" @change="numberChange" :min="0" :max="999999"></u-number-box>
 						</view>

+ 76 - 4
pages/replenishmentManage/detail.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="replenishment-detail-wrap">
 		<u-navbar back-text="补货单详情" :border-bottom="false" :background="{backgroundColor: $config('primaryColor')}" back-icon-color="#fff" :back-text-style="{ color: '#fff' }">
-			<view slot='right' style="padding: 0 30upx;color: #ffffff;" v-if="pageType=='success'">
+			<view slot='right' style="padding: 0 30upx;color: #ffffff;" @click="creatSalesOrder" v-if="pageType=='success'">
 				<u-icon name="chuangjiandingdan" custom-prefix="iscm-icon"></u-icon>
 				<text style="margin-left: 6rpx;">生成销售单</text>
 			</view>
@@ -33,22 +33,69 @@
 			</view>
 			<view class="part-list">
 				<!-- 补货产品 -->
-				<partList :list="partList" title="补货产品" model="view" :fromPage="pageType=='success'?'replenishmentDetail':'replenishmentDetailc'" ref="partList" noDataText="暂无产品"></partList>
+				<partList :list="partList" title="配件列表" model="view" :fromPage="pageType=='success'?'replenishmentDetail':'replenishmentDetailc'" ref="partList" noDataText="暂无产品"></partList>
 			</view>
 		</view>
+		<!-- 生成销售单 -->
+		<common-modal v-if="confirmModal" :showTitle="false" :openModal="confirmModal" @confirm="modalConfirm" @close="confirmModal=false">
+			<view style="font-size: 28upx;">
+				<view style="padding: 10upx;" class="flex align_center justify_between">
+					<view>产品总款数:<text style="color: red;">5</text></view>
+					<view>产品总件数:<text style="color: red;">15</text></view>
+				</view>
+				<view v-if="salesOrderList.length">
+					<view style="padding: 0 10upx 10upx;">此补货单已经存在对应的销售单?</view>
+					<view style="padding: 0 10upx 20upx;">确认再次生成销售单吗?</view>
+					<view>
+						<view 
+						v-for="item in salesOrderList" 
+						:key="item.id"
+						style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;" 
+						class="flex align_center justify_between">
+							<text>{{item.orderNo}}</text>
+							<view>
+								<u-icon name="arrow-right"></u-icon>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view v-else>
+					<view style="padding: 0 10upx 20upx;">确认生成销售单?</view>
+					<view>
+						<view 
+						v-for="item in salesOrderList" :key="item.id"
+						style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;" 
+						class="flex align_center justify_between">
+							<text>{{item.orderNo}}</text>
+							<view>
+								<u-icon name="arrow-right"></u-icon>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</common-modal>
 	</view>
 </template>
 
 <script>
-	import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPutStock } from '@/api/shelfReplenish'
+	import { 
+		shelfReplenishDetail, 
+		shelfReplenishDetailList, 
+		shelfReplenishPutStock, 
+		queryRelationSalesBill,
+		createSalesBill} from '@/api/shelfReplenish'
 	import partList from '@/pages/common/partList.vue'
+	import commonModal from '@/pages/common/commonModal.vue'
 	export default {
-		components: { partList },
+		components: { partList, commonModal },
 		data() {
 			return {
+				confirmModal: false,
 				replenishBillSn: '',
 				basicInfoData:null,
 				partList: [],
+				salesOrderList:[],
 				customStyle: {
 					borderRadius:'100rpx',
 					fontSize:'30rpx',
@@ -68,6 +115,7 @@
 			this.pageType = option.type
 			this.getDetail()
 			this.getPartList()
+			this.getSalesOrder()
 		},
 		methods: {
 			// 查询详情
@@ -91,6 +139,30 @@
 						this.partList = []
 					}
 				})
+			},
+			// 查询关联销售单
+			getSalesOrder () {
+			  queryRelationSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
+			    if (res.status == 200) {
+			      this.salesOrderList = res.data
+			    } else {
+			      this.salesOrderList = []
+			    }
+			  })
+			},
+			// 生成销售单
+			creatSalesOrder(){
+				this.confirmModal = true
+			},
+			modalConfirm(){
+				this.showLoading("正在生成销售单...")
+				createSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
+					if (res.status == 200) {
+						this.getSalesOrder()
+					}
+					this.toashMsg(res.message)
+					uni.hideLoading()
+				})
 			}
 		}
 	}

+ 1 - 1
pages/replenishmentManage/signWarehousing.vue

@@ -23,7 +23,7 @@
 			</view>
 			<view class="part-list">
 				<!-- 补货产品 -->
-				<partList :list="partList" title="补货产品" model="view" fromPage="replenishmentSign" ref="partList" noDataText="暂无产品" @numberChange="numberChange"></partList>
+				<partList :list="partList" title="配件列表" model="view" fromPage="replenishmentSign" ref="partList" noDataText="暂无产品" @numberChange="numberChange"></partList>
 			</view>
 		</view>
 		<view class="replenishment-putWarehousing-footer">

+ 5 - 5
pages/sales/listComponent.vue

@@ -13,7 +13,7 @@
 							<view>
 								<view style="display: inline-block;margin-right: 6upx;">{{item.salesBillNo}}</view>
 								<u-tag v-if="item.oosFlag==1" text="急件" :bg-color="$config('errorColor')" mode="dark" shape="circle" size="mini" style="margin-right: 6upx;vertical-align: text-top;" />
-								<u-tag v-if="item.salesBillSourceDictValue" :text="item.salesBillSourceDictValue" :bg-color="$config('primaryColor')" mode="dark" shape="circle" size="mini" style="vertical-align: text-top;" />
+								<u-tag v-if="item.sourceTypeDictValue" :text="item.sourceTypeDictValue" :bg-color="$config('primaryColor')" mode="dark" shape="circle" size="mini" style="vertical-align: text-top;" />
 							</view>
 							<view class="color_6 font_13">{{item.createDate || '--'}}</view>
 						</view>
@@ -30,10 +30,10 @@
 					<!-- <view class="button-box">
 						<u-button @click="handleFun('audit', item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="item.billStatus == 'WAIT_AUDIT'">审核</u-button>
 						<u-button @click="handleFun('out', item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="item.billStatus == 'WAIT_OUT_WAREHOUSE'">出库</u-button>
-						<u-button @click="handleEdit(item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="(item.salesBillSource == 'SATELLITE' || item.salesBillSource == 'SALES' || item.salesBillSource == 'TEMPORARY_DISPATCHING') && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'WAIT_SUBMIT' || item.billStatus == 'AUDIT_REJECT')">编辑</u-button>
-						<u-button @click="handleFun('del', item)" size="mini" :hair-line="false" shape="circle" plain type="error" hover-class="none" v-if="((item.salesBillSource == 'SATELLITE' || item.salesBillSource == 'SALES' || item.salesBillSource == 'TEMPORARY_DISPATCHING') && item.billStatus != 'FINISH')">删除</u-button>
-						<u-button @click="handleEdit(item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="item.salesBillSource == 'PURCHASE' && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'SUPERIOR_CHANGE')">改单</u-button>
-						<u-button @click="handleFun('cancel', item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="item.salesBillSource == 'PURCHASE' && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'SUPERIOR_CHANGE')">取消</u-button>
+						<u-button @click="handleEdit(item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="(item.sourceType == 'SATELLITE' || item.sourceType == 'SALES' || item.sourceType == 'TEMPORARY_DISPATCHING') && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'WAIT_SUBMIT' || item.billStatus == 'AUDIT_REJECT')">编辑</u-button>
+						<u-button @click="handleFun('del', item)" size="mini" :hair-line="false" shape="circle" plain type="error" hover-class="none" v-if="((item.sourceType == 'SATELLITE' || item.sourceType == 'SALES' || item.sourceType == 'TEMPORARY_DISPATCHING') && item.billStatus != 'FINISH')">删除</u-button>
+						<u-button @click="handleEdit(item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="item.sourceType == 'PURCHASE' && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'SUPERIOR_CHANGE')">改单</u-button>
+						<u-button @click="handleFun('cancel', item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="item.sourceType == 'PURCHASE' && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'SUPERIOR_CHANGE')">取消</u-button>
 					</view> -->
 				</view>
 				<view v-if="listData && listData.length == 0 && status!='loading'">

+ 1 - 1
pages/sales/orderInfoModal.vue

@@ -35,7 +35,7 @@
 				</view>
 				<view>
 					<text class="info-item-tit">来源:</text>
-					<text class="info-item-txt">{{infoData && infoData.salesBillSourceDictValue || '--'}}</text>
+					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
 				</view>
 				<view>
 					<text class="info-item-tit">业务状态:</text>