4月16日提交

master
rosehan 2 years ago
parent b6ac4e441f
commit 51f1449852
  1. 1
      App.vue
  2. 5
      pages/traceability-product/delivery/deliveryEdit.vue
  3. 87
      pages/traceability-product/delivery/index.vue
  4. 79
      pages/traceability-product/loss/index.vue
  5. 92
      pages/traceability-product/sales/index.vue
  6. 87
      static/scss/v-layout.scss
  7. 30
      utils/mix.js

@ -32,6 +32,7 @@
</script>
<style lang="scss">
@import '@/uni_modules/uni-scss/index.scss';
@import "@/uni_modules/uview-ui/index.scss";
@import '@/static/scss/index.scss'
</style>

@ -233,11 +233,6 @@
} finally {}
},
//
getSalesChange(e) {
this.formData.salesType = e.detail.value[0].value
},
// Id
getCustomChange(e) {
this.currenCustomer = e.detail.value

@ -11,33 +11,39 @@
<!-- 页面 列表 -->
<view class="v-pages-list v-container m-t-regular">
<u-list @scrolltolower="scrolltolower">
<view class="v-pages-list-item" v-for="item in listData" :key="item.id">
<view class="v-pages-list-item" v-for="(item,index) in listData" :key="item.id">
<!-- 页面 卡片 -->
<view class="v-card">
<!-- 卡片 内容 -->
<view class="v-card-content">
<!-- 卡片 上部 -->
<view class="v-card-top row">
<!-- 卡片 图片 -->
<image src="../../static/test/pic.jpg" class="v-card-image"></image>
<!-- 卡片 信息 -->
<view class="v-card-info col">
<view class="v-card-title row"><text
class="name col">{{item.processingName}}</text><text class="tip"
v-if="item.speciesName">{{item.speciesName}}</text>
<view class="v-card-info">
<view class="v-card-title row">
<text class="name col">{{item.processingName}}</text>
</view>
<view class="v-card-state m-t-mini"><text class="state">{{item.sourceType}}</text>
<view class="v-card-state m-t-mini">
<text class="state secondary"
v-if="item.speciesName">{{item.speciesName}}</text>
<dict-tag class="state primary" type="source_type" :value="item.sourceType" />
</view>
<view class="v-card-code"><text
class="iconfont icon-code m-r-small"></text>{{item.traceabilityCode}}</view>
</view>
</view>
<!-- 卡片 下部 -->
<view class="v-card-bot">
<view class="v-card-small-item" v-for="(cell,i) in item.recordList" :key="i">
<view class="v-page-form small row m-t-small">
<view class="v-form-item col-12"><text class="label">配送人:</text><text
class="content">{{cell.deliveryMan}}</text></view>
<view class="v-form-item col-12"><text class="label">接收人:</text><text
class="content">{{formatData(cell.receivedMan)}}</text></view>
<view class="v-card-small-item" @click="openPopup(index)">
<view class="v-card-small-box row v-page-form small">
<view class="v-form-item col">
<uni-icons type="calendar" size="14"></uni-icons>
<text
class="content m-r-small">{{getFormat(item.recordList[0].deliveryTime)}}
</text>
配送
</view>
<view class="record"><text class="btn">配送记录</text></view>
</view>
</view>
</view>
@ -47,6 +53,39 @@
<u-loadmore :status="status" />
</u-list>
</view>
<!-- 记录 弹框 -->
<uni-popup ref="popup">
<view class="popup-content v-container">
<view class="close" @click="closePopup">
<uni-icons type="close" size="30"></uni-icons>
</view>
<view class="v-card">
<view class="v-popup-title"><text>{{RecordName}}</text> 配送记录</view>
<view class="v-card-small-item" v-for="(item,index) in RecordData" :key="index">
<view class="v-card-small-box row v-page-form small">
<view class="col-10">
<view class="time">{{getFormat(item.deliveryTime)}}</view>
<view class="name delivery"><text>{{formatData(item.deliveryMan)}}</text></view>
</view>
<view class="col-4">
<view class="line">
<image src="@/static/images/icon_delivery.svg"></image>
</view>
</view>
<view class="col-10">
<view class="time">{{getFormat(item.receivedTime)}}</view>
<view class="name received"><text>{{formatData(item.receivedMan)}}</text></view>
</view>
<view class="v-form-item col-24 m-t-mini">
<text class="label">配送公司</text>
<text class="content">{{formatData(item.logisticsName)}}</text>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
@ -54,11 +93,16 @@
<script>
import * as ProductApi from "@/api/traceability/deliveryrecord"
import mix from '@/utils/mix.js'
import DictTag from "@/components/DictTag/index"
export default {
components: {
DictTag
},
data() {
return {
listData: [],
RecordName: null,
RecordData: [],
loadMoreStatus: 'loadmore',
queryParams: {
pageNo: 1,
@ -96,6 +140,19 @@
} finally {}
},
//
openPopup(index) {
console.log(this.listData[index])
this.RecordName = this.listData[index].processingName
this.RecordData = this.listData[index].recordList
this.$refs.popup.open()
},
//
closePopup() {
this.$refs.popup.close()
},
//
scrolltolower() {
if (this.loadMoreStatus == 'loading' || this.loadMoreStatus == 'nomore') {

@ -11,7 +11,7 @@
<!-- 页面 列表 -->
<view class="v-pages-list v-container m-t-regular">
<u-list @scrolltolower="scrolltolower">
<view class="v-pages-list-item" v-for="item in listData" :key="item.id">
<view class="v-pages-list-item" v-for="(item,index) in listData" :key="item.id">
<!-- 页面 卡片 -->
<view class="v-card">
<!-- 卡片 内容 -->
@ -20,24 +20,29 @@
<view class="v-card-top row">
<!-- 卡片 信息 -->
<view class="v-card-info col">
<view class="v-card-title row"><text
class="name col">{{item.processingName}}</text>
<view class="v-card-title row">
<text class="name col">{{item.processingName}}</text>
</view>
<view class="v-card-state m-t-mini">
<text class="state">{{item.speciesName}}</text>
<text class="state">{{item.sourceType}}</text>
<text class="state secondary"
v-if="item.speciesName">{{item.speciesName}}</text>
<dict-tag class="state primary" type="source_type" :value="item.sourceType" />
</view>
<view class="v-card-code"><text
class="iconfont icon-code m-r-small"></text>{{item.traceabilityCode}}</view>
</view>
</view>
<!-- 卡片 下部 -->
<view class="v-card-bot">
<view class="v-card-small-item" v-for="(cell,i) in item.damagedList" :key="i">
<view class="v-page-form small row m-t-small">
<view class="v-form-item col-10"><text class="label">报损日期:</text><text
class="content">{{getData(cell.createTime)}}</text></view>
<view class="col-2"></view>
<view class="v-form-item col-10"><text class="label">报损类型:</text><text
class="content">{{cell.lossType}}</text></view>
<view class="v-card-small-item" @click="openPopup(index)">
<view class="v-card-small-box row v-page-form small">
<view class="v-form-item col">
<uni-icons type="calendar" size="14"></uni-icons>
<text
class="content m-r-small">{{getData(item.damagedList[0].createTime)}}</text>
报损
</view>
<view class="record"><text class="btn">报损记录</text></view>
</view>
</view>
</view>
@ -48,17 +53,53 @@
</u-list>
</view>
<!-- 记录 弹框 -->
<uni-popup ref="popup">
<view class="popup-content v-container">
<view class="close" @click="closePopup">
<uni-icons type="close" size="30"></uni-icons>
</view>
<view class="v-card">
<view class="v-popup-title"><text>{{RecordName}}</text> 报损记录</view>
<view class="v-card-small-item" v-for="(item,index) in RecordData" :key="index">
<view>
<uni-icons type="calendar" class="text-primary m-r-small" size="14"></uni-icons>
<text class="content">{{getData(item.createTime)}}</text>
</view>
<view class="v-card-small-box v-page-form small row m-t-small">
<view class="v-form-item col-12">
<text class="label">报损类型</text>
<dict-tag class="state primary" type="loss_type" :value="String(item.lossType)" />
</view>
<view class="v-form-item col-12">
<text class="label">报损数量</text>
<text class="content">{{item.productLoss}}公斤</text>
</view>
<view class="v-form-item col-24 m-t-mini">
<text class="label">报损原因</text>
<text class="content">{{formatData(item.lossReason)}}</text>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import * as ProductApi from "@/api/traceability/loss"
import mix from '@/utils/mix.js'
import DictTag from "@/components/DictTag/index"
export default {
components: {
DictTag
},
data() {
return {
listData: [],
RecordName: null,
RecordData: [],
loadMoreStatus: 'loadmore',
queryParams: {
pageNo: 1,
@ -95,6 +136,18 @@
} finally {}
},
//
openPopup(index) {
this.RecordName = this.listData[index].processingName
this.RecordData = this.listData[index].damagedList
this.$refs.popup.open()
},
//
closePopup() {
this.$refs.popup.close()
},
//
scrolltolower() {
if (this.loadMoreStatus == 'loading' || this.loadMoreStatus == 'nomore') {

@ -11,35 +11,39 @@
<!-- 页面 列表 -->
<view class="v-pages-list v-container m-t-regular">
<u-list @scrolltolower="scrolltolower">
<view class="v-pages-list-item" v-for="item in listData" :key="item.id">
<view class="v-pages-list-item" v-for="(item,index) in listData" :key="item.id">
<!-- 页面 卡片 -->
<view class="v-card">
<!-- 卡片 内容 -->
<view class="v-card-content">
<!-- 卡片 上部 -->
<view class="v-card-top row">
<!-- 卡片 图片 -->
<image src="../../static/test/pic.jpg" class="v-card-image"></image>
<!-- 卡片 信息 -->
<view class="v-card-info col">
<view class="v-card-title row"><text
class="name col">{{item.processingName}}</text><text class="tip"
v-if="item.speciesName">{{item.speciesName}}</text>
<view class="v-card-info">
<view class="v-card-title row">
<text class="name col">{{item.processingName}}</text>
</view>
<view class="v-card-state m-t-mini"><text class="state">{{item.sourceType}}</text>
<view class="v-card-state m-t-mini">
<text class="state secondary"
v-if="item.speciesName">{{item.speciesName}}</text>
<dict-tag class="state primary" type="source_type" :value="item.sourceType" />
</view>
<view class="v-card-code"><text
class="iconfont icon-code m-r-small"></text>{{item.traceabilityCode}}</view>
</view>
</view>
<!-- 卡片 下部 -->
<view class="v-card-bot">
<view class="v-card-small-item" v-for="(cell,i) in item.salesRecordsList" :key="i">
<view class="v-page-form small row m-t-small">
<view class="v-form-item col-12"><text class="label">销售类型:</text><text
class="content">{{cell.salesType}}</text></view>
<view class="v-form-item col-12"><text class="label">销售数量:</text><text
class="content">{{formatData(cell.salesType)}}</text></view>
<view class="v-form-item col-12"><text class="label">销售日期:</text><text
class="content">{{getFormat(cell.createTime)}}</text></view>
<view class="v-card-small-item" @click="openPopup(index)">
<view class="v-card-small-box row v-page-form small">
<view class="v-form-item col">
<uni-icons type="calendar" size="14"></uni-icons>
<text
class="content m-r-small">{{getFormat(item.salesRecordsList[0].createTime)}}
</text>
销售
</view>
<view class="record"><text class="btn">销售记录</text></view>
</view>
</view>
</view>
@ -50,18 +54,57 @@
</u-list>
</view>
<!-- 记录 弹框 -->
<uni-popup ref="popup">
<view class="popup-content v-container">
<view class="close" @click="closePopup">
<uni-icons type="close" size="30"></uni-icons>
</view>
<view class="v-card">
<view class="v-popup-title"><text>{{RecordName}}</text> 销售记录</view>
<view class="v-card-small-item" v-for="(item,index) in RecordData" :key="index">
<view>
<uni-icons type="calendar" class="text-primary m-r-small" size="14"></uni-icons>
<text class="content">{{getFormat(item.createTime)}}</text>
</view>
<view class="v-card-small-box v-page-form small row m-t-small">
<view class="v-form-item col-12">
<text class="label">销售类型</text>
<dict-tag class="state primary" type="sales_type" :value="String(item.salesType)" />
</view>
<view class="v-form-item col-12">
<text class="label">销售数量</text>
<text class="content">{{formatNumber(item.salesNumber)}}公斤</text>
</view>
<view class="v-form-item col-24 m-t-mini">
<text class="label">销售金额</text>
<text class="content">{{formatData(item.salesVolume)}}</text>
</view>
<view class="v-form-item col-24 m-t-mini">
<text class="label">客户名称</text>
<text class="content">{{formatData(item.logisticsName)}}</text>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import * as ProductApi from "@/api/traceability/salerecord"
import mix from '@/utils/mix.js'
import DictTag from "@/components/DictTag/index"
export default {
components: {
DictTag
},
data() {
return {
keyword: null,
listData: [],
RecordName: null,
RecordData: [],
loadMoreStatus: 'loadmore',
queryParams: {
pageNo: 1,
@ -98,6 +141,19 @@
} finally {}
},
//
openPopup(index) {
console.log(this.listData[index])
this.RecordName = this.listData[index].processingName
this.RecordData = this.listData[index].salesRecordsList
this.$refs.popup.open()
},
//
closePopup() {
this.$refs.popup.close()
},
//
scrolltolower() {
if (this.loadMoreStatus == 'loading' || this.loadMoreStatus == 'nomore') {

@ -41,7 +41,9 @@ $v-muted: #dddddd;
.text-secondary {
color: $v-secondary;
}
.text-muted {color: $v-muted}
.text-muted {
color: $v-muted;
}
.v-primary-btn {
font-size: 12px;
height: 20px;
@ -241,13 +243,17 @@ $v-muted: #dddddd;
padding: 1px 10px;
font-size: 12px;
border-radius: 4px;
&.primary{color: $v-primary;
&.primary {
color: $v-primary;
background-color: rgba($v-primary, 0.1);
border: 1px solid rgba($v-primary, 0.1);}
border: 1px solid rgba($v-primary, 0.1);
}
&.secondary{color: $v-secondary;
&.secondary {
color: $v-secondary;
background-color: rgba($v-secondary, 0.1);
border: 1px solid rgba($v-secondary, 0.1);}
border: 1px solid rgba($v-secondary, 0.1);
}
}
.state + .state {
@ -260,6 +266,77 @@ $v-muted: #dddddd;
height: 70px;
border-radius: 5px;
}
.v-card-small-item {
&:not(:last-child) {
margin-bottom: 20px;
}
.v-card-small-box {
padding: 10px;
background-color: rgba(0, 0, 0, 0.03);
border-radius: 8px;
.time {
font-size: 13px;
text-align: center;
font-family: DIN Alternate;
}
.line{text-align: center; image{width: 30px;height: 15px;}}
.name {
font-size: 12px;
text-align: center;
&.delivery {
text:before {
content: '';
padding: 2px;
margin-right: 5px;
background-color: rgba($v-primary, 0.05);
color: rgba($v-primary, 1);
}
}
&.received {
text:before {
content: '';
padding: 2px;
margin-right: 5px;
background-color: rgba($v-secondary, 0.05);
color: rgba($v-secondary, 1);
}
}
}
.record {
font-size: 12px;
.btn {
padding: 2px 8px;
border: 1px solid rgba(0, 0, 0, 0.08);
border-radius: 20px;
}
}
}
}
.popup-content {
position: relative;
.close {
position: absolute;
right: 20px;
top: 5px;
z-index: 9;
:before {
color: rgba(0, 0, 0, 0.4);
}
}
.v-popup-title {
text-align: center;
margin-bottom: 20px;
text {
margin-right: 10px;
font-size: 18px;
font-weight: 600;
}
color: $v-primary;
}
}
.v-form {
.v-form-item {
position: relative;

@ -2,22 +2,16 @@ export default {
methods: {
/** 时间戳处理 */
getData(timestamp) {
if (timestamp == undefined || timestamp == null) {
return "--"
} else {
let date = new Date(parseInt(timestamp))
let Year = date.getFullYear()
let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate())
let GMT = Year + '-' + Moth + '-' + Day
return GMT
},
/** 时间戳处理 */
getData(timestamp) {
let date = new Date(parseInt(timestamp))
let Year = date.getFullYear()
let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate())
let GMT = Year + '-' + Moth + '-' + Day
return GMT
}
},
/** 日期格式化 */
@ -34,13 +28,25 @@ export default {
}
},
/** 空字符串 */
formatData(value) {
if (value == undefined || value == null || value == '' || value == "" && value != '0' && value != 0) {
if (value == '0' && value == 0) {
return value
} else {
if (value == undefined || value == null || value == '' || value == '') {
return '--'
} else {
return value
}
}
},
formatNumber(value) {
if (value == undefined || value == null || value == '') {
return '0'
} else {
return value
}
}
}
}
Loading…
Cancel
Save