Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-repair-app
This commit is contained in:
commit
ab53c2c1ba
@ -27,7 +27,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import request from '../../utils/request';
|
import request from '../../utils/request';
|
||||||
import {
|
import {
|
||||||
getToken
|
getToken,getUserInfo
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
let innerAudioContext ='';
|
let innerAudioContext ='';
|
||||||
// #ifdef APP || H5
|
// #ifdef APP || H5
|
||||||
@ -43,6 +43,7 @@
|
|||||||
msgNum: null,
|
msgNum: null,
|
||||||
identity: 'user',
|
identity: 'user',
|
||||||
nowPageInterval: null,
|
nowPageInterval: null,
|
||||||
|
userInfo:{},
|
||||||
arr: [{
|
arr: [{
|
||||||
text: '首页'
|
text: '首页'
|
||||||
},
|
},
|
||||||
@ -59,8 +60,8 @@
|
|||||||
msg: String|Number
|
msg: String|Number
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
this.userInfo = getUserInfo();
|
||||||
console.log('tabbag', uni.getStorageSync('identity'));
|
console.log('tabbag', uni.getStorageSync('identity'));
|
||||||
|
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
if (this.nowPageInterval) {
|
if (this.nowPageInterval) {
|
||||||
@ -172,11 +173,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getgogo(index) {
|
getgogo(index) {
|
||||||
|
const userInfo = getUserInfo()
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
this.aindex = index
|
this.aindex = index
|
||||||
|
if (userInfo.roleCodes.includes("repair_warehouse")){
|
||||||
|
//跳转首页
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages-warehouse/home/home'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages-home/home/home'
|
url: '/pages-home/home/home'
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (index == 2) {
|
if (index == 2) {
|
||||||
this.aindex = index
|
this.aindex = index
|
||||||
@ -192,7 +201,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="body-top">
|
<view class="body-top">
|
||||||
<view class="body-top-search">
|
<view class="body-top-search">
|
||||||
<input class="body-top-search-input" placeholder="查询审批单" placeholder-style="font-size: 28rpx"
|
<input class="body-top-search-input" v-model="queryParams.query" placeholder="工单号、车牌号、联系电话" placeholder-style="font-size: 28rpx"
|
||||||
type="text">
|
type="text">
|
||||||
<text>搜索</text>
|
<text @click="onRefresherrefresh">搜索</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="body-top-tab">
|
<view class="body-top-tab">
|
||||||
<view v-for="(item, index) in tabList" @click="activeTab(index)" :key="index" :class="{ active: active === index }"
|
<view v-for="(item, index) in tabList" @click="activeTab(index)" :key="index" :class="{ active: active === index }"
|
||||||
@ -30,6 +30,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="todoListBox">
|
<view class="todoListBox">
|
||||||
<scroll-view :refresher-triggered="isTriggered" @scrolltolower="onReachBottomCus" class="itemContent"
|
<scroll-view :refresher-triggered="isTriggered" @scrolltolower="onReachBottomCus" class="itemContent"
|
||||||
refresher-enabled
|
refresher-enabled
|
||||||
@ -37,14 +38,14 @@
|
|||||||
<view v-for="(item, index) in ticketWares" :key="index" class="orderItem">
|
<view v-for="(item, index) in ticketWares" :key="index" class="orderItem">
|
||||||
<view class="order-top">
|
<view class="order-top">
|
||||||
<view class="order-top-left">
|
<view class="order-top-left">
|
||||||
<text class="order-top-name">{{ item.repairName+'的配件申请单' }}</text>
|
<text class="order-top-name">{{ item.repairName}}{{'配件申请单'}}</text>
|
||||||
<text class="order-top-date">{{ item.createTimeStr }}</text>
|
<text class="order-top-date">{{ item.createTimeStr }}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="order-status">{{ item.statusStr }}</text>
|
<text class="order-status">{{ item.statusStr }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-content">
|
<view class="order-content">
|
||||||
<view>
|
<view>
|
||||||
申请人:{{ item.repairName }}
|
车牌号:{{ item.licenseNumber }}
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
服务顾问:{{ item.adviserName }}
|
服务顾问:{{ item.adviserName }}
|
||||||
@ -52,13 +53,12 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-footer">
|
<view class="order-footer">
|
||||||
<template>
|
<template v-if="!queryParams.isBack">
|
||||||
<view class="order-btn no">拒绝审批</view>
|
<view @click="inOutWareHouse(item,true)" class="order-btn yes">通知领料</view>
|
||||||
<view class="order-btn yes">审批出库</view>
|
<!-- <view class="order-btn yes">采购</view>-->
|
||||||
</template>
|
</template>
|
||||||
<template>
|
<template v-else>
|
||||||
<view class="order-btn">配件出库</view>
|
<view @click="inOutWareHouse(item,false)" class="order-btn yes">通知退料</view>
|
||||||
<view class="order-btn">配件入库</view>
|
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -78,14 +78,13 @@ import VNavigationBar from '@/components/VNavigationBar.vue'
|
|||||||
import OrderCard from "@/components/orderCard.vue";
|
import OrderCard from "@/components/orderCard.vue";
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import {builderOrder, formatTimestamp, saveTicketsRecords} from "@/utils/utils";
|
|
||||||
import {
|
import {
|
||||||
getToken,
|
getToken,
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
getStrData,
|
getStrData,
|
||||||
getTenantId
|
getTenantId
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
import {getDictTextByCodeAndValue,formatDate} from "@/utils/utils";
|
import {getDictTextByCodeAndValue,formatDate,formatTimestamp} from "@/utils/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -129,26 +128,6 @@ export default {
|
|||||||
shopList: [],
|
shopList: [],
|
||||||
bannerList: [],
|
bannerList: [],
|
||||||
richTextHtml: null,
|
richTextHtml: null,
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
|
|
||||||
|
|
||||||
orderList: [
|
|
||||||
{
|
|
||||||
orderNo: '1209840149750105501',
|
|
||||||
flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
|
|
||||||
carModel: '一汽奥迪 2024款 A6L',
|
|
||||||
projectList: [
|
|
||||||
{name: '清洗内饰', id: 1},
|
|
||||||
{name: '内饰精洗除臭', id: 2},
|
|
||||||
{name: '烘干底板胶及脚垫', id: 3}
|
|
||||||
],
|
|
||||||
userName: '张三',
|
|
||||||
userPhone: '157****6879',
|
|
||||||
appointDate: '2024-10-20 12:00',
|
|
||||||
counselorName: '李相东'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
defaultAvatar: require('@/static/icons/avatar.png')
|
defaultAvatar: require('@/static/icons/avatar.png')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -179,9 +158,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领配件、退配件Tab页
|
||||||
|
*/
|
||||||
activeTab(index){
|
activeTab(index){
|
||||||
this.active = index
|
this.active = index
|
||||||
this.queryParams.type = 1==index?'01':'02'
|
if (index == 1){
|
||||||
|
this.queryParams.isBack = true
|
||||||
|
} else {
|
||||||
|
this.queryParams.isBack = undefined
|
||||||
|
}
|
||||||
this.onRefresherrefresh()
|
this.onRefresherrefresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -204,7 +191,6 @@ export default {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: this.queryParams
|
params: this.queryParams
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
console.log(res,187)
|
|
||||||
if (res.code == 200){
|
if (res.code == 200){
|
||||||
res.rows.map((item) => {
|
res.rows.map((item) => {
|
||||||
getDictTextByCodeAndValue("ticket_wares_status",item.status).then(value => {
|
getDictTextByCodeAndValue("ticket_wares_status",item.status).then(value => {
|
||||||
@ -213,10 +199,10 @@ export default {
|
|||||||
item.statusStr = "未知"
|
item.statusStr = "未知"
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
item.createTimeStr = formatDate(item.createTime)
|
item.createTimeStr = formatTimestamp(item.createTime)
|
||||||
})
|
})
|
||||||
this.total = res.total
|
this.total = res.total
|
||||||
if (this.pageNo != 1) {
|
if (this.queryParams.pageNo != 1) {
|
||||||
this.ticketWares = this.ticketWares.concat(res.rows)
|
this.ticketWares = this.ticketWares.concat(res.rows)
|
||||||
} else {
|
} else {
|
||||||
this.ticketWares = res.rows
|
this.ticketWares = res.rows
|
||||||
@ -242,7 +228,24 @@ export default {
|
|||||||
this.getTicketWares()
|
this.getTicketWares()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件出库
|
||||||
|
*/
|
||||||
|
inOutWareHouse(formData,isBack){
|
||||||
|
formData.isBack = isBack
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages-warehouse/inOutWarehouse/inOutWarehouse?formData='+encodeURIComponent(JSON.stringify(formData))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件出库操作
|
||||||
|
*/
|
||||||
|
handlePass(row){
|
||||||
|
//组装提交参数
|
||||||
|
const formData = {...row}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
gotoPage(menu) {
|
gotoPage(menu) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -1,28 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<VNavigationBar background-color="#fff" title="配件出库" title-color="#333"></VNavigationBar>
|
<VNavigationBar background-color="#fff" title="单据处理" title-color="#333"></VNavigationBar>
|
||||||
<view class="search">
|
<!-- <view class="tabs">-->
|
||||||
<view class="searchBox">
|
<!-- <view v-for="(item, index) in tabs" :key="index" :class="{'active': item.value === active}" class="tab-item">-->
|
||||||
<input class="searchInput" placeholder="查询配件名称" placeholder-style="font-size: 28rpx" type="text">
|
<!-- {{ item.name }}-->
|
||||||
<text>搜索</text>
|
<!-- </view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
|
||||||
<view class="tabs">
|
|
||||||
<view v-for="(item, index) in tabs" :key="index" :class="{'active': item.value === active}" class="tab-item">
|
|
||||||
{{ item.name }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="listBox">
|
<view class="listBox">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view v-for="(item, index) in repairList" :key="index" class="listItem">
|
<view v-for="(item, index) in wares" :key="index" class="listItem">
|
||||||
<view class="repairName">{{ item.name }}</view>
|
<view class="repairName">{{ item.waresName }}</view>
|
||||||
<view class="repairBottom">
|
<view class="repairBottom">
|
||||||
<text class="repairDesc">单位:
|
<text class="repairDesc">单位:
|
||||||
<text class="repairUnit">{{ item.unit }}</text>
|
<text class="repairUnit">{{ item.unitStr }}</text>
|
||||||
|
</text>
|
||||||
|
<text class="repairDesc">库存:
|
||||||
|
<text class="repairUnit">{{ item.wares.stock }}</text>
|
||||||
</text>
|
</text>
|
||||||
<view class="repairBtns">
|
<view class="repairBtns">
|
||||||
<u-icon name="minus-circle-fill" size="24" @click="delNum(item)"></u-icon>
|
<u-icon name="minus-circle-fill" size="24" @click="delNum(item)"></u-icon>
|
||||||
<text class="repairNum">{{ item.num }}</text>
|
<text class="repairNum">{{ item.waresCount }}</text>
|
||||||
<u-icon color="#0174F6" name="plus-circle-fill" size="24" @click="addNum(item)"></u-icon>
|
<u-icon color="#0174F6" name="plus-circle-fill" size="24" @click="addNum(item)"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -30,31 +27,30 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<text class="label">共选择:</text>
|
<text class="label"></text>
|
||||||
<text class="repairNum">{{ repairCount }}个配件</text>
|
<text class="repairNum"></text>
|
||||||
<view class="submit" @click="submit">确认出库</view>
|
<view class="submit" @click="submit">{{type?'通知领料':'通知退料'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import VNavigationBar from "@/components/VNavigationBar.vue";
|
import VNavigationBar from "@/components/VNavigationBar.vue";
|
||||||
|
import request from '@/utils/request';
|
||||||
|
import {getDictTextByCodeAndValue,createUniqueCodeByHead} from "@/utils/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {VNavigationBar},
|
components: {VNavigationBar},
|
||||||
onLoad() {
|
|
||||||
this.init()
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tabs: [
|
//配件申请单id
|
||||||
{name: '全部', value: ''},
|
twId:'',
|
||||||
{name: '机油', value: '1'},
|
//配件列表
|
||||||
{name: '机油', value: '2'},
|
wares:[],
|
||||||
{name: '机油', value: '3'},
|
//01零配件、02退配件
|
||||||
{name: '机油', value: '4'},
|
type:true,
|
||||||
{name: '机油', value: '5'},
|
//父组件传入的数据
|
||||||
],
|
formData:{},
|
||||||
repairList: [],
|
repairList: [],
|
||||||
selectedRepairList: [
|
selectedRepairList: [
|
||||||
{name: '炫驰全合成机油S7 4L/ALL', num: 3, unit: '桶', id: 3}
|
{name: '炫驰全合成机油S7 4L/ALL', num: 3, unit: '桶', id: 3}
|
||||||
@ -62,6 +58,15 @@ export default {
|
|||||||
active: ''
|
active: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad(data) {
|
||||||
|
if (data.formData){
|
||||||
|
this.formData = JSON.parse(decodeURIComponent(data.formData))
|
||||||
|
this.type = this.formData.isBack
|
||||||
|
this.twId = this.formData.id
|
||||||
|
}
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
repairCount() {
|
repairCount() {
|
||||||
return this.selectedRepairList.reduce((val, item) => {
|
return this.selectedRepairList.reduce((val, item) => {
|
||||||
@ -70,48 +75,100 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 初始化配件数据
|
||||||
|
*/
|
||||||
init() {
|
init() {
|
||||||
// 接口返回
|
const params = {
|
||||||
const result = [{name: '炫驰全合成机油S7 4L/ALL', num: 0, unit: '桶', id: 1},
|
twId:this.formData.id
|
||||||
{name: '炫驰全合成机油S7 4L/ALL', num: 0, unit: '桶', id: 2},
|
|
||||||
{name: '炫驰全合成机油S7 4L/ALL', num: 0, unit: '桶', id: 3},
|
|
||||||
{name: '炫驰全合成机油S7 4L/ALL', num: 0, unit: '桶', id: 4},
|
|
||||||
{name: '炫驰全合成机油S7 4L/ALL', num: 0, unit: '桶', id: 5}]
|
|
||||||
// 初始化数据
|
|
||||||
this.repairList = result.map(m => {
|
|
||||||
if (this.selectedRepairList && this.selectedRepairList.length > 0) {
|
|
||||||
const find = this.selectedRepairList.find(f => f.id === m.id)
|
|
||||||
if (find) {
|
|
||||||
m.num = find.num
|
|
||||||
}
|
}
|
||||||
}
|
request({
|
||||||
return m
|
url: '/admin-api/repair/twi/list',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
}).then((res)=>{
|
||||||
|
const items = res.data;
|
||||||
|
items.map((item)=>{
|
||||||
|
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
|
||||||
|
item.waresCount = this.type ? count : item.waresAlreadyCount
|
||||||
|
item.isStock = this.type ? count <= item.wares.stock : true
|
||||||
|
getDictTextByCodeAndValue("repair_unit",item.wares.unit).then(value => {
|
||||||
|
item.unitStr = value
|
||||||
|
}).catch(error => {
|
||||||
|
item.unitStr = "未知"
|
||||||
|
});
|
||||||
|
})
|
||||||
|
this.wares = items;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
addNum(repair) {
|
addNum(repair) {
|
||||||
this.$set(repair, 'num', repair.num + 1)
|
this.$set(repair, 'waresCount', repair.waresCount + 1)
|
||||||
const find = this.selectedRepairList.find(f => f.id === repair.id)
|
const find = this.wares.find(f => f.id === repair.id)
|
||||||
if (find) {
|
if (find) {
|
||||||
find.num = repair.num
|
find.waresCount = repair.waresCount
|
||||||
} else {
|
} else {
|
||||||
this.selectedRepairList.push(JSON.parse(JSON.stringify(repair)))
|
this.wares.push(JSON.parse(JSON.stringify(repair)))
|
||||||
}
|
}
|
||||||
console.log('repair', repair)
|
console.log('repair', repair)
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 减
|
||||||
|
*/
|
||||||
delNum(repair) {
|
delNum(repair) {
|
||||||
if (repair.num <= 0) {
|
if (repair.waresCount <= 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$set(repair, 'num', repair.num - 1)
|
this.$set(repair, 'waresCount', repair.waresCount - 1)
|
||||||
const findIndex = this.selectedRepairList.findIndex(f => f.id === repair.id)
|
const findIndex = this.wares.findIndex(f => f.id === repair.id)
|
||||||
if (findIndex > -1 && repair.num <= 0) {
|
if (findIndex > -1 && repair.num <= 0) {
|
||||||
this.selectedRepairList.splice(findIndex, 1)
|
this.wares.splice(findIndex, 1)
|
||||||
} else if (repair.num > 0) {
|
} else if (repair.num > 0) {
|
||||||
this.$set(this.selectedRepairList[findIndex], 'num', repair.num)
|
this.$set(this.wares[findIndex], 'waresCount', repair.waresCount)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 出库
|
||||||
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
console.log('this.selectedRepairList', this.selectedRepairList)
|
this.formData.repairSo = {
|
||||||
|
soType:this.type?'02':'04',
|
||||||
|
soNo:createUniqueCodeByHead(this.type?'LL':'TL'),
|
||||||
|
userId:this.formData.repairId,
|
||||||
|
userName:this.formData.repairName,
|
||||||
|
soStatus:this.type?'04':'07'
|
||||||
|
}
|
||||||
|
this.formData.repairSois = [...this.wares.map(item =>{
|
||||||
|
return {
|
||||||
|
soiType: this.type ? '02' : "04",
|
||||||
|
goodsId: item.waresId,
|
||||||
|
goodsCount: item.waresCount,
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
if (this.type){
|
||||||
|
this.formData.items = [...this.wares.map(item => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
}
|
||||||
|
request({
|
||||||
|
url: '/admin-api/repair/tw/pass',
|
||||||
|
method: 'post',
|
||||||
|
data:this.formData
|
||||||
|
}).then((res)=>{
|
||||||
|
if (res.code === 200){
|
||||||
|
uni.showToast({
|
||||||
|
title: '通知成功!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(()=>{
|
||||||
|
uni.navigateBack()
|
||||||
|
},700)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user