Compare commits
No commits in common. "20a6b277234ac6cca76088b8284bbda6d037b5a8" and "3032b77623b1749b01b036cd2ade0e98a16cf616" have entirely different histories.
20a6b27723
...
3032b77623
@ -27,7 +27,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import request from '../../utils/request';
|
import request from '../../utils/request';
|
||||||
import {
|
import {
|
||||||
getToken,getUserInfo
|
getToken
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
let innerAudioContext ='';
|
let innerAudioContext ='';
|
||||||
// #ifdef APP || H5
|
// #ifdef APP || H5
|
||||||
@ -43,7 +43,6 @@
|
|||||||
msgNum: null,
|
msgNum: null,
|
||||||
identity: 'user',
|
identity: 'user',
|
||||||
nowPageInterval: null,
|
nowPageInterval: null,
|
||||||
userInfo:{},
|
|
||||||
arr: [{
|
arr: [{
|
||||||
text: '首页'
|
text: '首页'
|
||||||
},
|
},
|
||||||
@ -60,8 +59,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) {
|
||||||
@ -173,19 +172,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
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
|
||||||
@ -201,6 +192,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</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" v-model="queryParams.query" placeholder="工单号、车牌号、联系电话" placeholder-style="font-size: 28rpx"
|
<input class="body-top-search-input" placeholder="查询审批单" placeholder-style="font-size: 28rpx"
|
||||||
type="text">
|
type="text">
|
||||||
<text @click="onRefresherrefresh">搜索</text>
|
<text>搜索</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,7 +30,6 @@
|
|||||||
</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
|
||||||
@ -38,14 +37,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.licenseNumber }}
|
申请人:{{ item.repairName }}
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
服务顾问:{{ item.adviserName }}
|
服务顾问:{{ item.adviserName }}
|
||||||
@ -53,12 +52,13 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order-footer">
|
<view class="order-footer">
|
||||||
<template v-if="!queryParams.isBack">
|
<template>
|
||||||
<view @click="inOutWareHouse(item,true)" class="order-btn yes">通知领料</view>
|
<view class="order-btn no">拒绝审批</view>
|
||||||
<!-- <view class="order-btn yes">采购</view>-->
|
<view class="order-btn yes">审批出库</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template>
|
||||||
<view @click="inOutWareHouse(item,false)" class="order-btn yes">通知退料</view>
|
<view class="order-btn">配件出库</view>
|
||||||
|
<view class="order-btn">配件入库</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -78,13 +78,14 @@ 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,formatTimestamp} from "@/utils/utils";
|
import {getDictTextByCodeAndValue,formatDate} from "@/utils/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -128,6 +129,26 @@ 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')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -158,17 +179,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
/**
|
|
||||||
* 领配件、退配件Tab页
|
|
||||||
*/
|
|
||||||
activeTab(index){
|
activeTab(index){
|
||||||
this.active = index
|
this.active = index
|
||||||
if (index == 1){
|
this.queryParams.type = 1==index?'01':'02'
|
||||||
this.queryParams.isBack = true
|
|
||||||
} else {
|
|
||||||
this.queryParams.isBack = undefined
|
|
||||||
}
|
|
||||||
this.onRefresherrefresh()
|
this.onRefresherrefresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -191,6 +204,7 @@ 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 => {
|
||||||
@ -199,10 +213,10 @@ export default {
|
|||||||
item.statusStr = "未知"
|
item.statusStr = "未知"
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
item.createTimeStr = formatTimestamp(item.createTime)
|
item.createTimeStr = formatDate(item.createTime)
|
||||||
})
|
})
|
||||||
this.total = res.total
|
this.total = res.total
|
||||||
if (this.queryParams.pageNo != 1) {
|
if (this.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
|
||||||
@ -228,24 +242,7 @@ 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,25 +1,28 @@
|
|||||||
<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="tabs">-->
|
<view class="search">
|
||||||
<!-- <view v-for="(item, index) in tabs" :key="index" :class="{'active': item.value === active}" class="tab-item">-->
|
<view class="searchBox">
|
||||||
<!-- {{ item.name }}-->
|
<input class="searchInput" placeholder="查询配件名称" placeholder-style="font-size: 28rpx" type="text">
|
||||||
<!-- </view>-->
|
<text>搜索</text>
|
||||||
<!-- </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 wares" :key="index" class="listItem">
|
<view v-for="(item, index) in repairList" :key="index" class="listItem">
|
||||||
<view class="repairName">{{ item.waresName }}</view>
|
<view class="repairName">{{ item.name }}</view>
|
||||||
<view class="repairBottom">
|
<view class="repairBottom">
|
||||||
<text class="repairDesc">单位:
|
<text class="repairDesc">单位:
|
||||||
<text class="repairUnit">{{ item.unitStr }}</text>
|
<text class="repairUnit">{{ item.unit }}</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.waresCount }}</text>
|
<text class="repairNum">{{ item.num }}</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>
|
||||||
@ -27,30 +30,31 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<text class="label"></text>
|
<text class="label">共选择:</text>
|
||||||
<text class="repairNum"></text>
|
<text class="repairNum">{{ repairCount }}个配件</text>
|
||||||
<view class="submit" @click="submit">{{type?'通知领料':'通知退料'}}</view>
|
<view class="submit" @click="submit">确认出库</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 {
|
||||||
//配件申请单id
|
tabs: [
|
||||||
twId:'',
|
{name: '全部', value: ''},
|
||||||
//配件列表
|
{name: '机油', value: '1'},
|
||||||
wares:[],
|
{name: '机油', value: '2'},
|
||||||
//01零配件、02退配件
|
{name: '机油', value: '3'},
|
||||||
type:true,
|
{name: '机油', value: '4'},
|
||||||
//父组件传入的数据
|
{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}
|
||||||
@ -58,15 +62,6 @@ 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) => {
|
||||||
@ -75,100 +70,48 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
|
||||||
* 初始化配件数据
|
|
||||||
*/
|
|
||||||
init() {
|
init() {
|
||||||
const params = {
|
// 接口返回
|
||||||
twId:this.formData.id
|
const result = [{name: '炫驰全合成机油S7 4L/ALL', num: 0, unit: '桶', id: 1},
|
||||||
|
{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({
|
}
|
||||||
url: '/admin-api/repair/twi/list',
|
return m
|
||||||
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, 'waresCount', repair.waresCount + 1)
|
this.$set(repair, 'num', repair.num + 1)
|
||||||
const find = this.wares.find(f => f.id === repair.id)
|
const find = this.selectedRepairList.find(f => f.id === repair.id)
|
||||||
if (find) {
|
if (find) {
|
||||||
find.waresCount = repair.waresCount
|
find.num = repair.num
|
||||||
} else {
|
} else {
|
||||||
this.wares.push(JSON.parse(JSON.stringify(repair)))
|
this.selectedRepairList.push(JSON.parse(JSON.stringify(repair)))
|
||||||
}
|
}
|
||||||
console.log('repair', repair)
|
console.log('repair', repair)
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 减
|
|
||||||
*/
|
|
||||||
delNum(repair) {
|
delNum(repair) {
|
||||||
if (repair.waresCount <= 0) {
|
if (repair.num <= 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$set(repair, 'waresCount', repair.waresCount - 1)
|
this.$set(repair, 'num', repair.num - 1)
|
||||||
const findIndex = this.wares.findIndex(f => f.id === repair.id)
|
const findIndex = this.selectedRepairList.findIndex(f => f.id === repair.id)
|
||||||
if (findIndex > -1 && repair.num <= 0) {
|
if (findIndex > -1 && repair.num <= 0) {
|
||||||
this.wares.splice(findIndex, 1)
|
this.selectedRepairList.splice(findIndex, 1)
|
||||||
} else if (repair.num > 0) {
|
} else if (repair.num > 0) {
|
||||||
this.$set(this.wares[findIndex], 'waresCount', repair.waresCount)
|
this.$set(this.selectedRepairList[findIndex], 'num', repair.num)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 出库
|
|
||||||
*/
|
|
||||||
submit() {
|
submit() {
|
||||||
this.formData.repairSo = {
|
console.log('this.selectedRepairList', this.selectedRepairList)
|
||||||
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