123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <template>
- <view class="checkSubmit">
- <view class="dtl">
- <view class="">
- 物料编码:{{option.materialCode}}
- </view>
- <view class="">
- 二维码编码:{{option.supplierName}}
- </view>
- <view class="">
- 物料名称:{{option.materialName}}
- </view>
- </view>
- <view class="form-box" style="margin:0 30rpx">
- <uni-forms ref="baseForm" :modelValue="formData" label-position="top">
- <view class="commons-title">
- 质检结果
- </view>
- <uni-forms-item label="称重结果" required>
- <input
- style="border-bottom:1px solid #dcdcdc;width:90%;display: inline-block;"
- :type="'number'"
- v-model="formData.weighingResults"
- :min="0" placeholder="请输入称重结果" />
- <span style="margin-left:30rpx">kg</span>
- </uni-forms-item>
- <uni-forms-item label="实际克重" required>
- <input
- style="border-bottom:1px solid #dcdcdc;width:90%;display: inline-block;"
- :type="'number'"
- v-model="formData.unitWeight"
- :min="0" placeholder="请输入实际克重" />
- <span style="margin-left:30rpx">g</span>
- </uni-forms-item>
-
- </uni-forms>
- </view>
- <view class="submit-box">
- <button @click="checkSubmit(1)" 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: {
- quantitycheckId: null,
- materialId: null,
- quantity: null,
- qrCode: null,
- checkJudgment: null,
- checkQty: null,
- imageUrl: null,
- id: null,
- imageUrlAry: [],
- weighingResults:0,
- unitWeight:0,
- },
- imgs:[],
- option: null,
- imgUrl: null,
- checkListData: [],
- optionCopy:null,
- }
- },
- onLoad(option) {
-
-
- const v = this
-
- v.userData = Vue.prototype.$userInfo
- v.option = JSON.parse(decodeURIComponent(option.data))
- v.optionCopy = JSON.parse(JSON.stringify(v.option))
- v.formData.stockQuantitycheckId = v.option.id
- v.formData.materialId = v.option.materialCode
- v.formData.quantity = v.option.quantity
- v.formData.checkQty = v.option.quantity
- v.formData.qrCode = v.option.qrCode
- v.formData.unitWeight = v.option.unitWeight
- v.formData.weighingResults = v.option.weighingResults
- if(v.option.id2){
- v.formData = v.option
- v.formData.id = v.option.id2
- }
- console.log(v.formData,123123123)
- // uni.getStorage({
- // key: "checkListData",
- // success(_data) {
- // console.log(_data)
- // v.checkListData = []
- // },
- // fail() {
- // }
- // })
- console.log(v.formData)
- },
- methods: {
- imgDelete(_index){
- const v = this
- v.imgs.splice(_index,1)
- },
- bindUpload() {
- const v = this
- wx.chooseImage({
- count: 1,
- sizeType: ["original", "compressed"], // 可以指定是原图还是压缩图,默认二者都有
- sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
- success: function(res) {
- // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
- var tempFilePaths = res.tempFilePaths
- for (var i = 0; i < tempFilePaths.length; i++) {
- v.imgs.push({loadingType:true})
- wx.uploadFile({
- url: 'https://wmswx.adprintingplus.com/api/wx/common/uploadFile',
- filePath: tempFilePaths[i],
- name: "file",
- header: {
- "content-type": "multipart/form-data",
- 'Authorization': Vue.prototype.$token,
- },
- success: function(res) {
- console.log(res.data)
- res.data = JSON.parse(res.data)
- if (res.data.code == 200) {
- wx.showToast({
- title: "上传成功",
- icon: "none",
- duration: 1500
- })
- v.imgs.splice(-1)
- v.imgs.push(res.data.data)
- }
- },
- fail: function(err) {
- wx.showToast({
- title: "上传失败",
- icon: "none",
- duration: 2000
- })
- },
- complete: function(result) {
- console.log(result.errMsg)
- }
- })
- }
- }
- })
- },
- zidingyiSuccess() {
- },
- checkSubmit(_type) {
- const v = this
- v.formData.checkJudgment = _type
- v.$post('/wx/check/weighTemp',v.formData).then(res=>{
- if(res.code == 200){
- uni.showToast({
- title: '提交成功,跳转中!'
- })
- setTimeout(() => {
-
- wx.reLaunch({
- url: '/pages/weigh/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>
|