Commit 8e97548b authored by Morson's avatar Morson

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents d3d0d469 c612caba
...@@ -36,6 +36,10 @@ let partsApiFun = function (vm) { ...@@ -36,6 +36,10 @@ let partsApiFun = function (vm) {
* 查询自己的备件仓 * 查询自己的备件仓
*/ */
let getMyReserve = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/reserve', params); let getMyReserve = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/reserve', params);
/**
* 查询工单的配件明细
*/
let getWorkOrderParts = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/workOrder/', params);
const partsApi = { const partsApi = {
getSiteAddress, getSiteAddress,
...@@ -44,7 +48,8 @@ let partsApiFun = function (vm) { ...@@ -44,7 +48,8 @@ let partsApiFun = function (vm) {
getBrandList, getBrandList,
getPartsList, getPartsList,
applyParts, applyParts,
getMyReserve getMyReserve,
getWorkOrderParts
} }
return partsApi return partsApi
} }
......
<!-- ******************* 配件选择 ******************* --> <!-- ******************* 配件选择 ******************* -->
<template> <template>
<view>
<view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view>
<view class="u-flex-1 add-parts" @click="toParts">
添加配件<u-icon name="arrow-right" color="#2979ff" size="30"></u-icon>
</view>
</view>
<view class="complete-part"> <view class="complete-part">
<view v-if="status === 1"> <view v-if="status === 1">
<adjust-parts v-for="(item, index) in lists" :key="index" :info="item" @change="partsChange($event, index)" :disabled="disabled"></adjust-parts> <adjust-parts v-for="(item, index) in lists" :key="index" :info="item" @change="partsChange($event, index)" :disabled="disabled"></adjust-parts>
</view> </view>
<view class="u-flex select-part" v-else-if="status === 2"> <view class="u-flex select-part" v-else-if="status === 2">
<view class="img"> <view class="img">
<image src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" class="part-icon" /> <image :src="noPartsImage" class="part-icon" />
</view> </view>
<view class="u-flex content"> <view class="u-flex content">
<text class="title">暂无配件信息</text> <text class="title">暂无配件信息</text>
<text class="desc">可选择备件仓配件</text> <text class="desc">可选择备件仓配件</text>
</view> </view>
<view class="btn"> <view class="btn">
<u-button shape="circle" :custom-style="customStyle"> <u-button shape="circle" :custom-style="customStyle" @click="toParts">
去选择 去选择
</u-button> </u-button>
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
...@@ -31,9 +40,9 @@ ...@@ -31,9 +40,9 @@
}, },
mixins: [arrMixin], mixins: [arrMixin],
props: { props: {
status: { orderId: {
type: Number, type: String,
default: 1 default: ''
} }
}, },
data() { data() {
...@@ -42,18 +51,19 @@ ...@@ -42,18 +51,19 @@
{ {
id: 1, id: 1,
name: "正泰漏保", name: "正泰漏保",
num: 1, quantity: 1,
min: 1, min: 1,
max: 100, max: 100,
}, },
{ {
id: 1, id: 1,
name: "挚达广汽充电桩", name: "挚达广汽充电桩",
num: 3, quantity: 3,
min: 1, min: 1,
max: 5, max: 5,
}, },
] ],
status: 2
} }
}, },
computed: { computed: {
...@@ -64,31 +74,65 @@ ...@@ -64,31 +74,65 @@
'color': '#2272FF', 'color': '#2272FF',
'font-size': '32rpx', 'font-size': '32rpx',
} }
} },
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
noPartsImage() {
return process.uniEnv.qn_base_url + 'no_parts.png'
},
},
created() {
this.getWorkOrderParts()
}, },
methods: { methods: {
getWorkOrderParts() {
const params = {
workOrderId: this.orderId
}
this.$u.getWorkOrderParts(params).then(res => {
if (res.code === 200) {
const data = res.data
this.status = data.receivedItems.length > 0 ? 1 : 2
this.lists = data.receivedItems || []
}
})
},
partsChange(val, index) { partsChange(val, index) {
console.log("val", val, index) console.log("val", val, index)
this.$set(this.lists[index], 'quantity', val)
}, },
toParts() { toParts() {
// uni.navigateTo({ uni.navigateTo({
// url: '/pages/' url: '/pages/order/parts'
// }) })
}, },
toHandle() { handle(val) {
console.log("val", val)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.add-parts {
color: #2272FF;
text-align: right;
}
.complete-part { .complete-part {
.select-part { .select-part {
align-items: center; align-items: center;
height: 240rpx; height: 240rpx;
.img { .img {
margin-right: 20rpx; display: flex;
align-items: center;
margin-right: 30rpx;
.part-icon { .part-icon {
width: 110rpx; width: 110rpx;
height: 110rpx; height: 110rpx;
...@@ -113,7 +157,6 @@ ...@@ -113,7 +157,6 @@
text-align: left; text-align: left;
color: #999; color: #999;
font-size: 26rpx; font-size: 26rpx;
margin-top: 20rpx;
margin-right: auto; margin-right: auto;
} }
} }
......
<template> <template>
<view class="no-order-view" :style="customStyle"> <view class="no-order-view" :style="customStyle">
<image class="no-order-image" :src="wudingdanImage"></image> <image class="no-order-image" :src="wudingdanImage"></image>
<text>当前暂无订单</text> <text>{{text}}</text>
</view> </view>
</template> </template>
......
<template> <template>
<!-- 已申请配件cell --> <!-- 已申请配件cell -->
<view class="applied-cell" @click="handleClick"> <view class="return-cell" @click="handleClick">
<view class="title-view"> <view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text> <text class="title-text" :style="{'color': titleColor}">{{title}}</text>
<view> <view>
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.applied-cell { .return-cell {
padding: 30rpx; padding: 30rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
......
<template>
<!-- 已申请配件cell -->
<view class="applied-cell" @click="handleClick">
<view class="title-view">
<text class="title-text">{{title}}</text>
<view>
<text>返件时间:</text>
<text>{{info.createTime}}</text>
</view>
</view>
<view class="line-view"></view>
<view class="list-content">
<view class="list-item" v-for="(item, index) in info.items" :key="index">
<SpareCell :item="item"/>
</view>
</view>
<view class="line-view"></view>
<view class="info-item">
<view>
<text>返件编号:</text>
<text @longpress="handleLongpress">{{info.number}}</text>
</view>
<text class="copy-view" @click="$u.throttle(handleLongpress, 500)">复制</text>
</view>
<view class="line-view"></view>
<view class="bottom-view">
<view class="total-view">
<text>合计:</text>
<text class="amount-view">{{total}}</text>
<text>件</text>
</view>
</view>
</view>
</template>
<script>
import SpareCell from "@/components/parts/spareCell.vue"
export default {
components: {
SpareCell
},
props: {
info: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
}
},
computed: {
title() {
return this.info.finished ? '已返件' : '返件中'
},
total() { // 合计
var i = 0
for (var item of this.info.items) {
i += item.quantity
}
return i
},
},
methods: {
handleLongpress() { // 长按复制单号
uni.setClipboardData({
data: this.info.number,
success: function () {
console.log('success');
}
})
}
}
}
</script>
<style lang="scss" scoped>
.applied-cell {
padding: 30rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.title-view{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
color: #333333;
.title-text {
font-size: 36rpx;
font-weight: bold;
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 20rpx;
}
.list-content {
margin-top: 40rpx;
margin-bottom: 40rpx;
.list-item {
margin-bottom: 30rpx;
}
}
.info-item {
margin-top: 24rpx;
margin-bottom: 24rpx;
color: #333333;
font-size: 26rpx;
display: flex;
justify-content: space-between;
align-items: center;
.detail-left-view {}
.copy-view {
color: #2272FF;
padding-left: 30rpx;
}
}
.bottom-view {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 24rpx;
margin-bottom: 4rpx;
.total-view {
font-size: 32rpx;
font-weight: bold;
color: #333333;
.amount-view {
color: #2272FF;
padding-right: 10rpx;
}
}
}
}
</style>
<template>
<view class="spare-item">
<view class="left-view">
<u-checkbox v-if="showChecked" icon-size="28" size="40" v-model="item.selected" @change="handleChange" shape="circle"/>
<image class="image-view" :src="imageUrl"></image>
<view class="info-view">
<view class="name-text">{{item.name}}</view>
<view>{{remarkText}}</view>
</view>
</view>
<view class="count-view">x{{item.quantity}}</view>
</view>
</template>
<script>
export default {
props: {
showChecked: { // 是否显示勾选
type: Boolean,
default() {
return false
}
},
item: {
type: Object,
default() {
return {}
}
},
noteText: {
type: String,
default: ''
}
},
data() {
return {
checked: false
}
},
computed: {
remarkText() {
return this.noteText || this.item.code
// return this.info.categoryName + '-' + this.info.brandName
},
imageUrl() {
return this.item.images ? process.uniEnv.systemUrl.apiUrl + this.item.images.split(',').shift() : this.placeholderImage
},
placeholderImage() {
return process.uniEnv.qn_base_url + 'logo.png'
},
},
methods: {
handleChange() {
this.$emit('change')
}
}
}
</script>
<style lang="scss" scoped>
.spare-item {
display: flex;
// width: 100%;
justify-content: space-between;
align-items: flex-end;
// padding: 30rpx;
// background-color: #FFFFFF;
// border-radius: 12rpx;
.left-view {
display: flex;
align-items: center;
.image-view {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.info-view {
font-size: 24rpx;
color: #333333;
.name-text {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 30rpx;
}
}
}
.count-view {
font-size: 28rpx;
color: #333333;
}
}
</style>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</view> </view>
<view class="num"> <view class="num">
<u-number-box v-if="!disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || info.quantity" @change="numChange"></u-number-box> <u-number-box v-if="!disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || info.quantity" @change="numChange"></u-number-box>
<text class="nums" v-else>x{{ info.num || 1 }}</text> <text class="nums" v-else>x{{ info.quantity || 1 }}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="u-flex bottom" :style="customStyle"> <view class="u-flex bottom" :style="customStyle">
<view class="select-view"> <view class="select-view">
<view class="u-flex bottom-left" v-if="showChecked"> <view class="u-flex bottom-left" v-if="showChecked">
<view class="left-list"><u-checkbox icon-size="30" size="40" v-model="checked" @change="selectAll" shape="circle"/></view> <view class="left-list"><u-checkbox icon-size="28" size="40" v-model="checked" @change="selectAll" shape="circle"/></view>
<view class="left-list">全选</view> <view class="left-list">全选</view>
</view> </view>
<view class="u-flex bottom-center"> <view class="u-flex bottom-center">
......
...@@ -300,8 +300,9 @@ ...@@ -300,8 +300,9 @@
"path": "warehouse/records", "path": "warehouse/records",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "操作记录", "navigationBarTitleText": "出入库记录",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"disableScroll": true
} }
}, },
{ {
......
...@@ -23,14 +23,7 @@ ...@@ -23,14 +23,7 @@
<view class="detail-view"> <view class="detail-view">
<view class="list-content"> <view class="list-content">
<view class="list-item" v-for="(item, index) in info.items" :key="index"> <view class="list-item" v-for="(item, index) in info.items" :key="index">
<view class="left-view"> <SpareCell :item="item" :noteText="noteText"/>
<image class="image-view" :src="imageUrl(item)"></image>
<view class="info-view">
<view class="name-text">{{item.name}}</view>
<view>{{noteText}}</view>
</view>
</view>
<view class="count-view">x{{item.quantity}}</view>
</view> </view>
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
...@@ -60,7 +53,11 @@ ...@@ -60,7 +53,11 @@
</template> </template>
<script> <script>
import SpareCell from "@/components/parts/spareCell.vue"
export default { export default {
components: {
SpareCell
},
data() { data() {
return { return {
info: { info: {
...@@ -163,7 +160,7 @@ ...@@ -163,7 +160,7 @@
}) })
}, },
imageUrl(item) { imageUrl(item) {
return item.images ? item.images.split(',').shift() : this.placeholderImage return item.images ? process.uniEnv.systemUrl.apiUrl + item.images.split(',').shift() : this.placeholderImage
}, },
handleLongpress(key, text) { // 长按复制单号 handleLongpress(key, text) { // 长按复制单号
if (key == 'orderNumber') { if (key == 'orderNumber') {
...@@ -267,47 +264,13 @@ ...@@ -267,47 +264,13 @@
} }
.list-content { .list-content {
margin-top: 40rpx; margin-top: 10rpx;
margin-bottom: 40rpx; margin-bottom: 10rpx;
.list-item { .list-item {
display: flex;
width: 100%;
margin-right: 30rpx;
justify-content: space-between;
align-items: flex-end;
margin-bottom: 40rpx;
.left-view {
display: flex;
align-items: flex-start;
.image-view {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.info-view {
font-size: 24rpx;
color: #333333;
.name-text {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
} }
}
.count-view {
font-size: 28rpx;
color: #333333;
}
}
}
.detail-info-view { .detail-info-view {
.info-item { .info-item {
......
<template> <template>
<view class="ware-wrap"> <view class="ware-wrap">
<w-navbar title="" :background="{backgroundColor: '#F4F5F7'}"></w-navbar> <u-navbar back-icon-color="#333333" background="#FFFFFF" title="出入库记录" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<!-- <view class="content"> <!-- <view class="content">
<view class="panel"> <view class="panel">
<view class="title">物料明细</view> <view class="title">物料明细</view>
...@@ -61,22 +62,22 @@ ...@@ -61,22 +62,22 @@
}, },
computed: {}, computed: {},
onLoad() { onLoad() {
getApp().trackPage('我的仓库-操作记录') getApp().trackPage('出入库记录')
this.getData(); this.getData();
}, },
methods: { methods: {
getData() { getData() {
let self = this let self = this
self.initDetails() // self.initDetails()
self.loadAccess() self.loadAccess()
}, },
async initDetails() { // async initDetails() {
let self = this // let self = this
let res = await self.$u.api.listBystock() // let res = await self.$u.api.listBystock()
if(res && res.code == 200) { // if(res && res.code == 200) {
self.details = res.data // self.details = res.data
} // }
}, // },
loadRecord() { loadRecord() {
if(this.status == 'nomore') return ; if(this.status == 'nomore') return ;
this.status = 'loading'; this.status = 'loading';
...@@ -109,13 +110,15 @@ ...@@ -109,13 +110,15 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.ware-wrap { .ware-wrap {
background-color: #F4F5F7; background-color: #FFFFFF;
.content { // .content {
padding: 34rpx 30rpx; height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.panel { .panel {
padding: 0 30rpx 44rpx 30rpx;
height: 100%;
.title { .title {
margin-bottom: 30rpx; margin-bottom: 30rpx;
font-size: 32rpx; font-size: 32rpx;
...@@ -151,7 +154,7 @@ ...@@ -151,7 +154,7 @@
} }
} }
} }
} // }
} }
} }
.width-504 { .width-504 {
......
This diff is collapsed.
This diff is collapsed.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="class-bd"> <view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top" <u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsName != 'actualPaid' || show200" :id="`item${item.fieldsId}`"> :prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsName != 'actualPaid' || show200" :id="`item${item.fieldsId}`">
<view class="label" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'"> <view class="label" v-if="!hiddenTitle.includes(item.formType)">
<image class="item-image" :src="mixingImage" v-if="item.required"></image> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}} {{item.fieldsTitle}}
</view> </view>
...@@ -70,9 +70,10 @@ ...@@ -70,9 +70,10 @@
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :order-id="orderId" :value='form[item.fieldsName] || ""' :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :order-id="orderId" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-service-more> </xh-service-more>
<xh-label v-else-if="item.formType==='label'" <xh-label v-else-if="item.formType==='label'" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'>
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'>
</xh-label> </xh-label>
<xh-parts v-else-if="item.formType==='parts'" :order-id="orderId" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'>
</xh-parts>
</template> </template>
</u-form-item> </u-form-item>
</view> </view>
...@@ -110,6 +111,7 @@ ...@@ -110,6 +111,7 @@
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue' import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue'
import XhServiceMore from "@/components/createCom/XhServiceMore" import XhServiceMore from "@/components/createCom/XhServiceMore"
import XhLabel from "@/components/createCom/XhLabel" import XhLabel from "@/components/createCom/XhLabel"
import XhParts from "@/components/createCom/XhParts"
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index' import baseFile from '@/components/upload/index'
...@@ -139,6 +141,7 @@ ...@@ -139,6 +141,7 @@
['date', ['time','text']], ['date', ['time','text']],
['form', ['form','text']], ['form', ['form','text']],
['label', ['label','text']], ['label', ['label','text']],
['parts', ['parts','text']],
]) ])
/** /**
...@@ -209,6 +212,7 @@ ...@@ -209,6 +212,7 @@
export default { export default {
data() { data() {
return { return {
hiddenTitle: ['location', 'form', 'label', 'parts'],
orderId:0, orderId:0,
categoryId:0, categoryId:0,
orderServiceType:'', orderServiceType:'',
...@@ -273,7 +277,8 @@ ...@@ -273,7 +277,8 @@
XhServiceMeasure, XhServiceMeasure,
XhServiceMore, XhServiceMore,
XhLabel, XhLabel,
'take-photo': takePhoto XhParts,
takePhoto
}, },
mixins: [baseFile], mixins: [baseFile],
created() { created() {
......
<template> <template>
<view class="u-flex det-wrap"> <view class="u-flex det-wrap">
<view class="search">
<u-search
:clearabled="true"
:action-style="searchStyle"
bg-color="#fff"
v-model="keyword"
@custom="searchParts"
@search="searchParts"
></u-search>
</view>
<view class="content" v-if="lists.length > 0"> <view class="content" v-if="lists.length > 0">
<scroll-view style="height: 100%;" scroll-y="true"> <scroll-view style="height: 100%;" scroll-y="true">
<select-parts <select-parts
...@@ -56,16 +45,10 @@ ...@@ -56,16 +45,10 @@
}, },
data() { data() {
return { return {
lists: [], lists: []
keyword: ''
} }
}, },
computed: { computed: {
searchStyle() {
return {
color: "#2272FF"
};
},
// 配件数 // 配件数
partNum() { partNum() {
return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0) return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0)
...@@ -85,10 +68,7 @@ ...@@ -85,10 +68,7 @@
}, },
methods: { methods: {
getReserve() { getReserve() {
const params = { this.$u.api.getMyReserve().then(res => {
keyword: this.keyword
}
this.$u.api.getMyReserve(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
const data = res.data || [] const data = res.data || []
this.lists = data.map(v => { this.lists = data.map(v => {
...@@ -101,11 +81,6 @@ ...@@ -101,11 +81,6 @@
} }
}) })
}, },
// 搜索配件
searchParts(val) {
this.keyword = val
this.getReserve()
},
numChange(val, index) { numChange(val, index) {
this.$set(this.lists[index], 'quantity', val) this.$set(this.lists[index], 'quantity', val)
}, },
...@@ -128,6 +103,8 @@ ...@@ -128,6 +103,8 @@
quantity: v.quantity quantity: v.quantity
} }
}) })
prevPage.$vm.handle(lists)
this.$u.route({ type: 'back' })
console.log(lists) console.log(lists)
}, },
qnFile(src) { qnFile(src) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment