123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <template>
- <view class="checkSubmit">
- <view class="form-box" style="margin:0 30rpx">
- <uni-forms ref="baseForm" :modelValue="formData" label-position="left">
- <view class="commons-title">
- 交班人员
- </view>
- <uni-forms-item label="交班人员">
- <view style="padding-top:18rpx"><span v-for="(i) in userName">{{i}}</span> </view>
- </uni-forms-item>
- <view class="commons-title">
- 转班明细
- </view>
- <view style="border-bottom: 1rpx solid #000;" v-for="(i,index) in listData" :key="i.qrCode">
- <uni-forms-item label="物料名称" >
- <view style="padding-top:18rpx">{{i.materialName}}</view>
- </uni-forms-item>
- <uni-forms-item label="称重结果" >
- <view style="padding-top:18rpx">{{i.weighingResults}}kg</view>
- </uni-forms-item>
- <uni-forms-item label="有无外包装" >
- <view style="padding-top:18rpx">{{i.outerPackaging ? '有' : '无'}}</view>
- </uni-forms-item>
- <uni-forms-item label="有无卷芯" >
- <view style="padding-top:18rpx">{{i.convolution ? '有' : '无'}}</view>
- </uni-forms-item>
- </view>
- </uni-forms>
- </view>
- <view class="submit-box">
- <view class="" style="line-height: 80rpx;text-align: center;">
- 本次转班:{{listData.length}} 件
- </view>
- <button @click="shiftChange" style="background: #0066CC;color:#fff;margin-bottom: 30rpx;">提交</button>
-
- </view>
-
- </view>
- </template>
- <script>
- import {
- getInfo
- } from "@/util/api.js";
- import Vue from 'vue'
- import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
- import {
- dateFormat,
- getTime
- } from '../../util/uitl.js'
- export default {
- components: {
- htzImageUpload,
- },
- data() {
- return {
- formData: {
-
- },
- userName:[],
- listData:[],
- req:{
- shiftChangeId:null,
- },
- }
- },
- onLoad(option) {
- const v = this
- uni.getStorage({
- key: "userInfo",
- success(_data) {
- v.req.shiftChangeId = _data.data.id
- v.getData()
- },
- fail() {
-
- }
- })
-
- },
- methods: {
-
- shiftChange(){
- const v = this
- if(v.listData.length == 0){
- uni.showToast({
- icon:'none',
- title: '暂无交接信息',
- duration: 2000
- });
- return
- }
- v.$post("/mgr/shiftChange/updateShift",v.req).then(res=>{
- if(res.code == 200){
- uni.showToast({
- title:'接班成功,跳转中!'
- })
- setTimeout(()=>{
- wx.reLaunch({
- url: '/pages/home'
- })
- },1000)
- }
- })
- },
- getData(){
- const v = this
- v.$post('/mgr/shiftChange/selectSuccession',v.req).then(res=>{
- if(res.code == 200){
- for (var i = 0; i < res.data.length; i++) {
- v.userName.push(res.data[i].nickName)
- }
- v.userName = [...new Set(v.userName)]
- if(res.data.length != 0 ){
- v.listData = res.data
- }
- }
- })
- },
- switchChange(){
-
- },
- bindPickerChange2(){
-
- },
- imgDelete(_index){
- const v = this
- v.imgs.splice(_index,1)
- },
- zidingyiSuccess() {
- },
- checkSubmit(_type) {
- const v = this
- v.formData.checkJudgment = _type
- v.$post('/wx/check/temp',v.formData).then(res=>{
- if(res.code == 200){
- uni.showToast({
- title: '提交成功,跳转中!'
- })
- setTimeout(() => {
-
- wx.reLaunch({
- url: '/pages/check/checkDtl?data=' + encodeURIComponent(JSON.stringify(v.optionCopy))
- })
- }, 2000)
- }
- })
-
- },
- select(e) {
- console.log(e)
- const v = this
- v.$post('/wx/common/uploadFile', {
- file: e.tempFilePaths[0]
- }).then(res => {
- })
- },
- },
- }
- </script>
- <style lang="less">
- .checkSubmit {
- .submit-box {
- padding: 0 30rpx;
- }
- .dtl {
- padding: 30rpx;
- border-bottom: 1rpx solid #dcdcdc;
- font-size: 26rpx;
- line-height: 40rpx;
- }
- .addQrcode-list {
- height: 80rpx;
- display: flex;
- justify-content: space-between;
- padding: 15rpx;
- border-bottom: 1rpx solid #dcdcdc;
- font-size: 24rpx;
- .fl {
- display: flex;
- .code {
- margin-right: 20rpx;
- }
- }
- .fr {
- line-height: 80rpx;
- }
- }
- }
- .popup-input-warp {
- padding: 30rpx 40rpx;
- }
- .txt {
- margin-bottom: 20rpx;
- }
- .imglist {
- display: flex;
- flex-wrap: wrap;
- }
- .imglist .item {
- width: 150rpx;
- height: 150rpx;
- margin-right: 22rpx;
- margin-bottom: 10rpx;
- position: relative;
- }
- .imglist .last-item {
- width: 150rpx;
- height: 150rpx;
- text-align: center;
- line-height: 146rpx;
- border: 2rpx dashed #8B97A9;
- box-sizing: border-box;
- }
- .imglist .item image {
- width: 100%;
- height: 100%;
- }
- .imglist .item .delete {
- width: 30rpx;
- height: 30rpx;
- position: absolute;
- top: -25rpx;
- right: -12rpx;
- font-size: 40rpx;
- font-weight: bold;
- }
- </style>
|