lilei před 1 rokem
rodič
revize
42fe532ae5
3 změnil soubory, kde provedl 99 přidání a 4 odebrání
  1. 20 0
      api/shelf.js
  2. 1 1
      config/index.js
  3. 78 3
      pages/shelfSetting/shelfSet.vue

+ 20 - 0
api/shelf.js

@@ -209,4 +209,24 @@ export const insert = (params) => {
     data: params,
     method: 'post'
   })
+}
+
+// 货架模板 列表  分页
+export const shelfTemplateList = (params) => {
+  const url = `shelfTemplate/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 导入货架模板
+export const importShelfTemplate = params => {
+  return axios.request({
+    url: 'shelf/importShelfTemplate',
+    data: params,
+    method: 'post'
+  })
 }

+ 1 - 1
config/index.js

@@ -6,7 +6,7 @@ const getConfig = (theme) => {
 			themePath: 'default',
 			pro_URL: 'https://iscm.360arrow.com/qpls-md/', // 生产地址
 			uat_URL: 'https://p.iscm.360arrow.com/qpls-md/', // 预发布地址
-			dev_URL: 'http://192.168.2.117/qpls-md/', // 本地地址
+			dev_URL: 'http://192.168.2.124/qpls-md/', // 本地地址
 			appName: 'iSCM智慧供应链', // app 名称
 			company: '陕西山海高科信息技术有限公司',
 			loadText:{

+ 78 - 3
pages/shelfSetting/shelfSet.vue

@@ -12,7 +12,7 @@
 			<view class="card-box" v-if="detailData">
 				<view class="card-row flex align_center justify_between">
 					<view class="label">货架名称:</view>
-					<view class="text flex align_center justify_end"@click="editShelf">
+					<view class="text flex align_center justify_end" @click="editShelf">
 						<text>{{detailData.shelfName}}</text>
 						<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
 					</view>
@@ -95,13 +95,17 @@
 						<u-image :src="`../../static/${$config('themePath')}/def_no_data@3x.png`" width="180"
 							height="180" border-radius="10"></u-image>
 					</view>
+					<view>暂无货位信息,请点击</view>
 					<view class="flex">
-						暂无货位信息,请点击
 						<view>
 							<text @click="toPlRacking">批量上架</text>
 							<u-badge :offset="[-6,-10]" v-if="showDot" :is-dot="true" size="mini"
 								type="error"></u-badge>
 						</view>
+						<view>
+							<text></text>或
+							<text @click="toImportTpl">导入模板</text>
+						</view>
 					</view>
 				</view>
 				<view class="nodata" v-else>
@@ -145,6 +149,27 @@
 				<view @click="showCancelShelf=false" style="border: 1px solid #eee;border-bottom:0;width: 50%;padding: 0.6rem 0;">取消</view>
 			</view>
 		</u-popup>
+		<!-- 导入模板 -->
+		<u-popup v-model="showImportTpl" mode="center" border-radius="14" length="80%">
+			<view style="padding: 1rem;text-align: center;font-size: 1rem;">请选择货架模板</view>
+			<scroll-view 
+			scroll-y 
+			class="slot-content" 
+			style="padding: 0 1rem 1rem;text-align: center;height: 30vh;">
+				<u-radio-group v-model="templateSn" :wrap="true">
+					<u-radio 
+						v-for="(item, index) in templateList" :key="item.id" 
+						:name="item.templateSn"
+					>
+						{{item.templateName}}
+					</u-radio>
+				</u-radio-group>
+			</scroll-view>
+			<view class="flex align_center justify_between" style="text-align: center;font-size: 1rem;">
+				<view @click="toImportTplOk" style="border: 1px solid #eee;border-right:0;border-bottom:0;width: 50%;padding: 0.6rem 0;color: dodgerblue;">确定</view>
+				<view @click="toImportTpCancel" style="border: 1px solid #eee;border-bottom:0;width: 50%;padding: 0.6rem 0;">取消</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -156,7 +181,9 @@
 		getProductPlace,
 		getShelfPriceShow,
 		updateShelfPriceShow,
-		shelfModifState
+		shelfModifState,
+		shelfTemplateList,
+		importShelfTemplate
 	} from '@/api/shelf'
 	import {
 		shelfCartNotEmpty
@@ -174,6 +201,9 @@
 				switchVal: false,
 				showMenus: false,
 				scrollH: 400,
+				showImportTpl: false,
+				templateSn: null,
+				templateList: [],
 				popData: [{
 					title: '快速补货',
 					val: '0'
@@ -258,6 +288,51 @@
 				this.shelfPlaceList = null
 				this.getShelfPlace(true)
 			},
+			// 导入模板弹框
+			toImportTpl(){
+				if(this.templateList.length == 0){
+					uni.showLoading({
+						mask: true,
+						title: '加载中...'
+					})
+					shelfTemplateList({pageNo:1,pageSize:100}).then(res=>{
+						this.templateList = res.data&&res.data.list||[]
+						if(this.templateList.length){
+							this.showImportTpl = true
+							uni.hideLoading()
+						}else{
+							this.toashMsg(res.message)
+						}
+					})
+				}else{
+					this.showImportTpl = true
+				}
+			},
+			// 导入模板弹框确定
+			toImportTplOk(){
+				if(this.templateSn){
+					uni.showLoading({
+						mask: true,
+						title: '导入模板弹...'
+					})
+					importShelfTemplate({ shelfSn: this.shelfSn, templateSn: this.templateSn }).then(res => {
+					  if (res.status == 200) {
+					    this.toashMsg(res.message)
+						this.toImportTpCancel()
+					    this.getShelfDetal()
+						this.updateHw()
+					  }
+					  uni.hideLoading()
+					})
+				}else{
+					this.toashMsg('请选择模板')
+				}
+			},
+			// 关闭模板导入
+			toImportTpCancel(){
+				this.showImportTpl = false
+				this.templateSn = null
+			},
 			// 批量上架
 			toPlRacking() {
 				const url = this.showDot ? '/pages/batchShelves/cartList' : '/pages/batchShelves/index'