瀏覽代碼

消息模块修改,头部搜索模块修改

asd26269546 2 年之前
父節點
當前提交
0d049f1123

+ 178 - 0
src/components/form/select-input.vue

@@ -0,0 +1,178 @@
+<template>
+	<div class="select-input">
+		<!-- 用途 -->
+		<div class="purpose" v-if="type == 1">
+			<Select
+				v-model="purposeIndex"
+				style="width: 200px"
+				@on-change="selectPurposeFn"
+				filterable
+			>
+				<div slot="empty">无匹配数据</div>
+				<Option :value="999">全部</Option>
+				<Option
+					v-for="(i, index) in selectPurposeList"
+					:value="index"
+					:key="index"
+					>{{ i.purpose }}</Option
+				>
+			</Select>
+		</div>
+		<!-- 供应商 -->
+		<div v-if="type == 2">
+			<Poptip trigger="focus" width="250" placement="bottom">
+				<div slot="content">
+					<ul style="" class="commons-select-search">
+						<li
+							:key="i.id"
+							v-for="i in supplierList"
+							@click="supplierListCk(i)"
+						>
+							{{ i.name }}
+						</li>
+					</ul>
+				</div>
+				<Input
+					v-model="inputValue"
+					@on-change="getSupplierSelectList"
+					placeholder="请输入用途关键词"
+				></Input>
+			</Poptip>
+		</div>
+        <!-- 物料 -->
+		<div v-if="type == 3">
+			<Poptip trigger="focus" width="250" placement="bottom">
+				<div slot="content">
+					<ul style="" class="commons-select-search">
+						<li
+							:key="i.id"
+							v-for="i in materialList"
+							@click="materialListCk(i)"
+						>
+							{{ i.name }}
+						</li>
+					</ul>
+				</div>
+				<Input
+					v-model="inputValue"
+					@on-change="getMaterialSelectList"
+					placeholder="请输入物料名称"
+				></Input>
+			</Poptip>
+		</div>
+	</div>
+</template>
+
+<script>
+import axios from 'axios'
+export default {
+	props: {
+		//1 用途 2 物料 3供应商
+		type: String,
+		value: {
+			type: String,
+			default: '',
+			require: true,
+		},
+	},
+	name: '',
+	watch: {
+		value: {
+			handler() {
+				this.$emit('input', this.value)
+			},
+			immediate: true,
+		},
+	},
+	data() {
+		return {
+			purposeIndex: null,
+			selectPurposeList: [],
+			inputValue: this.value,
+			supplierList: [],
+            materialList: [],
+		}
+	},
+	methods: {
+        getMaterialSelectList() {
+			const v = this
+			v.loading = true
+			axios
+				.post('/cloudApi/material/selectList', {
+					pageNum:1,
+					pageSize:10,
+					search:this.inputValue,
+				})
+				.then((res) => {
+					v.materialList = res.data.data
+					v.loading = false
+				})
+			
+		},
+		getSupplierSelectList(req) {
+			const v = this
+			v.loading = true
+			axios
+				.post('/cloudApi/supplier/selectList', {
+					search: this.inputValue,
+				})
+				.then((res) => {
+					v.supplierList = res.data.data
+					v.loading = false
+					console.log(v.supplierList)
+				})
+		},
+        materialListCk(i){
+            console.log(i)
+			this.inputValue = i.name
+			this.$emit('input', i.name)
+        },
+		supplierListCk(i) {
+			console.log(i)
+			this.inputValue = i.name
+			this.$emit('input', i.name)
+		},
+		selectPurposeFn(e) {
+			console.log(e)
+			if (e == 999) {
+				this.inputValue = ''
+				this.$emit('input', '')
+			} else {
+				this.inputValue = this.selectPurposeList[e].purpose
+				this.$emit('input', this.selectPurposeList[e].purpose)
+			}
+		},
+		getMaterialSelectPurposeList() {
+			const v = this
+			v.loading = true
+			axios
+				.get('/cloudApi/material/selectPurposeList?purpose=' + '', {})
+				.then((res) => {
+					v.selectPurposeList = res.data.data
+					v.loading = false
+				})
+		},
+	},
+	created() {
+		const v = this
+		if (v.type == undefined) {
+			console.log('请配置type //1 用途 2 物料 3供应商')
+			return
+		}
+		switch (v.type) {
+			case '1':
+				v.getMaterialSelectPurposeList()
+				break
+			case '2':
+				v.getSupplierSelectList()
+            case '3':
+				v.getMaterialSelectList()
+			default:
+				break
+		}
+	},
+}
+</script>
+
+<style lang="less" scoped>
+</style>

+ 55 - 13
src/view/base-manage/provider-maintenance/purchaseList.vue

@@ -4,20 +4,26 @@
 		<div style="display: flex; justify-content: space-between">
 			<h3>供应商采购概况</h3>
 			<Form ref="formInline" inline :label-width="80" style="float: left">
-				<Form-item label="按产品查看">
-					<Input
-						type="text"
-						v-model="params.supplierName"
-						placeholder="输入关键字模糊搜索"
-					></Input>
-				</Form-item>
-				<Form-item label="关键词">
-					<Input
-						type="text"
-						v-model="params.search"
-						placeholder="输入关键字模糊搜索"
-					></Input>
+				<Form-item label="物料用途">
+					<Select v-model="params.PurposeIndex" style="width:200px" @on-change="selectPurposeFn" filterable>
+						<div slot="empty">无匹配数据</div>
+						<Option  :value="999">全部</Option>
+						<Option v-for="(i,index) in selectPurposeList" :value="index" :key="index">{{ i.purpose }}</Option>
+					</Select>
 				</Form-item>
+				<FormItem label="关键词"> 
+					<Poptip trigger="focus"  width="250" placement="bottom">
+						<div slot="content">
+						<ul style="" class="commons-select-search">
+							<li :key="i.id" v-for="i in supplierList" @click="params.search = i.name">
+							{{i.name}}
+							</li>
+						</ul>
+						</div>
+						<Input v-model="params.search" @on-change="getSupplierSelectList" placeholder="请输入用途关键词"></Input>
+					</Poptip>
+					
+				</FormItem>
 				<Button
 					type="primary"
 					style="margin-right: 10px"
@@ -87,6 +93,7 @@ export default {
 		MyModalForm,
 		ProviderAccountForm,
 		renderListimgs,
+		
 	},
 	data() {
 		const v = this
@@ -505,12 +512,45 @@ export default {
 				TechnologyType: null,
 				Purpose: null,
 				search: null,
+				PurposeIndex:null,
 			},
 			statisticsClassifyData: [],
+			supplierList:[],
+			selectPurposeList:[],
 			total: 0,
 		}
 	},
 	methods: {
+		getSupplierSelectList(req){
+			const v = this
+			v.loading = true
+			axios
+				.post('/cloudApi/supplier/selectList', {search:this.params.search})
+				.then((res) => {
+				v.supplierList = res.data.data
+				v.loading = false
+				console.log(v.supplierList)
+				})
+		},
+		selectPurposeFn(e){
+			console.log(e)
+			if(e == 999){
+				this.params.Purpose = ''
+			}else{
+				this.params.Purpose = this.selectPurposeList[e].purpose
+			}
+		
+		},
+		getMaterialSelectPurposeList(){
+			const v = this
+			v.loading = true
+			axios
+				.get('/cloudApi/material/selectPurposeList?purpose=' + '', {})
+				.then((res) => {
+				v.selectPurposeList = res.data.data
+				v.loading = false
+				})
+		},
 		cfm() {},
 		// 检索条件事件处理
 		eventHandle(option) {
@@ -610,6 +650,8 @@ export default {
 	mounted() {
 		this.getList()
 		this.getStatisticsClassify()
+		this.getMaterialSelectPurposeList()
+		this.getSupplierSelectList()
 	},
 }
 </script>

+ 4 - 0
src/view/index/msg/msg.vue

@@ -422,6 +422,10 @@ export default {
     },
     getList () {
       const v = this
+      axios.post('/cloudApi/uMessage/list/count',v.params).then(res=>{
+        console.log(res)
+        v.params.total = res.data.data
+      })
       axios.post('/cloudApi/uMessage/list',v.params).then(res=>{
         
         res.data.data.forEach(item => {

+ 2 - 0
src/view/login/login.vue

@@ -92,6 +92,8 @@ export default {
     handleSubmit ({ userName, password }) {
       this.handleLogin({ userName, password }).then(res => {
         this.getUserInfo().then(res => {
+          console.log(res)
+          window.localStorage.setItem('jobNo',res.result.jobNo)
           /* 未在角色菜单配置首页的角色直接跳转第一个菜单 不显示首页 */
           let menus = this.$store.state.user.menu
           let home = menus.find(item => item.name === '_home')

+ 23 - 8
src/view/material-manege/pay/pay-history.vue

@@ -5,10 +5,11 @@
     <div style="margin-bottom:10px">
 		<Form ref="formInline" inline :label-width="100" style="float:left">
           <Form-item  label="按供应商查找">
-              <Input type="text" v-model="params.supplierName" placeholder="输入关键字模糊搜索"></Input>
+              <select-input v-model="params.supplierName" type="2"></select-input>
+              
           </Form-item>
           <Form-item label="按物料查找">
-              <Input type="text" v-model="params.materialName" placeholder="输入关键字模糊搜索"></Input>
+            <select-input v-model="params.materialName" type="3"></select-input>
           </Form-item>
           <Button type="primary" @click="searchFn()">搜索</Button>
       </Form>
@@ -231,6 +232,7 @@ import ContractForm from './modals/contract-form'
 import ApplyForm from './modals/apply-pass-form'
 import { GetInStockBill } from '@/api/stock'
 import  dateSelect  from '@/components/dateSelect/dateSelect'
+import  selectInput  from '@/components/form/select-input'
 import axios from 'axios'
 export default {
   name: 'material_pay_detail',
@@ -243,7 +245,8 @@ export default {
     InvoiceForm,
     ContractForm,
     ApplyForm,
-    dateSelect
+    dateSelect,
+    selectInput
   },
   data () {
     return {
@@ -284,12 +287,23 @@ export default {
     }
   },
   methods: {
-	searchFn(){
-		const v = this
-		v.getStatistics()
-		v.changePage(1)
+    getSupplierSelectList(req){
+			const v = this
+			v.loading = true
+			axios
+				.post('/cloudApi/supplier/selectList', {search:this.params.search})
+				.then((res) => {
+				v.supplierList = res.data.data
+				v.loading = false
+				console.log(v.supplierList)
+				})
+		},
+    searchFn(){
+      const v = this
+      v.getStatistics()
+      v.changePage(1)
 
-	},
+    },
     selectTime(){
       const v = this
       v.params.supplierId = ''
@@ -465,6 +479,7 @@ export default {
     this.getStatistics()
     // this.getHistoryPaymentMaterial()
     this.getList()
+    this.getSupplierSelectList()
   }
 }
 </script>

+ 4 - 3
src/view/store-manage/store-manage/store-manage-2.vue

@@ -144,7 +144,7 @@
 							<li
 								:key="i.id"
 								v-for="i in materialList"
-								@click="params.search = i.name"
+								@click="params.keyword = i.name"
 							>
 								{{ i.name }}
 							</li>
@@ -154,7 +154,7 @@
 					<Input
 						v-model="params.keyword"
 						@on-change="getMaterialSelectList"
-						placeholder="请输入用途关键词"
+						placeholder="请输入物料名称"
 					></Input>
 				</Poptip>
 			</div>
@@ -576,7 +576,7 @@ export default {
 				.post('/cloudApi/material/selectList', {
 					pageNum:1,
 					pageSize:10,
-					search: '1231',
+					search: v.params.keyword,
 				})
 				.then((res) => {
 					v.materialList = res.data.data
@@ -950,6 +950,7 @@ export default {
 		this.getMaterialSet()
 		this.getStockHouse()
 		this.getRemainingToday()
+		this.getMaterialSelectList()
 	},
 }
 </script>