| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471 |
- <!-- 气瓶出库 -->
- <template>
- <view id="gasCylinderOutbound">
- <view class="gasCylinderOutbound-page">
- <view class="content-max-box">
- <view class="content-big-box">
- <view class="content-title-p">气瓶信息</view>
- <view class="content-min-box">
- <view class="content-check-box" @click="checkButton(1)" v-if="!detailsType">
- <view>选择气瓶</view>
- <view>{{newData.newData1?'更改':'请选择'}}</view>
- <uni-icons class="right-icon" type="right"></uni-icons>
- </view>
- <view class="content-bottom-text-box" v-if="newData.newData1">
- <view class="content-text-box">
- <view>气瓶编码:</view>
- <view>{{newData.newData2}}</view>
- </view>
- <view class="content-text-box">
- <view>气体:</view>
- <view>{{newData.newData3}}</view>
- </view>
- <view class="content-text-box">
- <view>气瓶规格:</view>
- <view>{{newData.newData4}}</view>
- </view>
- <view class="content-text-box">
- <view>气体类别:</view>
- <view>{{newData.newData5}}</view>
- </view>
- <view class="content-text-box">
- <view>压力:</view>
- <view>{{newData.newData6}}</view>
- </view>
- <view class="content-text-box">
- <view>纯度:</view>
- <view>{{newData.newData7}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="content-big-box">
- <view class="content-title-p">实验室信息</view>
- <view class="content-min-box">
- <view class="content-bottom-text-box" v-if="newData.newData8">
- <view class="content-text-box">
- <view>实验室名称:</view>
- <view>{{newData.newData9}}</view>
- </view>
- <view class="content-text-box">
- <view>楼栋:</view>
- <view>{{newData.newData10}}</view>
- </view>
- <view class="content-text-box">
- <view>楼层:</view>
- <view>{{newData.newData11}}</view>
- </view>
- <view class="content-text-box">
- <view>房间:</view>
- <view>{{newData.newData12}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="content-big-box" style="margin-top:30rpx;">
- <view class="content-min-box">
- <picker @change="bindPickerChange" :value="index" :range="array">
- <view class="content-check-box">
- <view>出库类型</view>
- <view>{{newData.newData17 == 1?'空瓶出库':(newData.newData17 == 2?'满瓶出库':'请选择')}}</view>
- <uni-icons class="right-icon" type="right"></uni-icons>
- </view>
- </picker>
- <view class="content-max-input-box" style="margin:0;">
- <view class="name-box">费用</view>
- <input class="uni-input input-box" v-if="newData.newData17 != 2" v-model="newData.newData14" type="number"
- maxlength="10" placeholder="请输入" />
- <p class="input-box" v-if="newData.newData17 == 2">0</p>
- </view>
- </view>
- </view>
- <view class="content-max-input-box">
- <view class="name-box">签出人</view>
- <input class="uni-input input-box" v-model="newData.newData13" maxlength="20" placeholder="请输入" />
- </view>
- <view class="content-max-up-box">
- <view class="name-box">出库单</view>
- <view class="up-big-box">
- <view class="img-data" v-for="(item,index) in newData.newData15" :key="index">
- <img class="min-img" @click="previewSingleImage(baseUrl+item)" :src="baseUrl+item">
- <uni-icons class="del-postion-p" @click="delImg(index)" type="close" color="red" size="20"></uni-icons>
- </view>
- <view class="add-button" @click="selectImage()" v-if="!newData.newData15[8]">
- <uni-icons type="cloud-upload" size="30" color="#666"></uni-icons>
- <view>上传照片</view>
- </view>
- </view>
- </view>
- <view class="content-max-up-box">
- <view class="name-box">备注</view>
- <textarea class="textarea textarea-box" placeholder="请输入" maxlength="100"
- v-model="newData.newData16"></textarea>
- </view>
- </view>
- <view class="bottom-button-p" @click="submitButton()">确认出库</view>
- </view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- export default {
- data() {
- return {
- baseUrl: config.base_url,
- detailsType:false,
- newData: {
- newData1: '',
- newData2: '',
- newData3: '',
- newData4: '',
- newData5: '',
- newData6: '',
- newData7: '',
- newData8: '',
- newData9: '',
- newData10: '',
- newData11: '',
- newData12: '',
- newData13: '',
- newData14: '',
- newData15: [],
- newData16: '',
- newData17: '',
- },
- array: ['空瓶出库', '满瓶出库'],
- }
- },
- onLoad(options) {
- if (options.pageType) {
- let obj = decodeURIComponent(options.form);
- if (options.pageType == 1) {
- //选择气瓶
- this.$set(this.newData, 'newData1', obj.data1);
- this.$set(this.newData, 'newData2', obj.data2);
- this.$set(this.newData, 'newData3', obj.data3);
- this.$set(this.newData, 'newData4', obj.data4);
- } else if (options.pageType == 2) {
- //选择实验室
- this.$set(this.newData, 'newData5', obj.data5);
- this.$set(this.newData, 'newData6', obj.data6);
- this.$set(this.newData, 'newData7', obj.data7);
- this.$set(this.newData, 'newData8', obj.data8);
- } else if (options.pageType == 3) {
- //历史记录-气瓶出库
- this.$set(this,'detailsType',true);
- this.$set(this.newData, 'newData1', "1");
- this.$set(this.newData, 'newData8', "1");
- }
- }
- },
- onShow() {
- },
- methods: {
- bindPickerChange(e) {
- if (e.detail.value == 0) {
- this.$set(this.newData, 'newData17', 1)
- } else {
- this.$set(this.newData, 'newData17', 2)
- }
- },
- checkButton(type) {
- if (type == 1) {
- uni.navigateTo({
- url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/selectCylinder?from=2",
- });
- } else if (type == 2) {
- uni.navigateTo({
- url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/selectLab?from=2",
- });
- }
- },
- //提交方法
- submitButton() {
- uni.showModal({
- title: '确认出库',
- content: '确认后,该气体气瓶的当前状态将变更为已出库。',
- showCancel: true,
- cancelText: '关闭',
- confirmText: '确认出库',
- confirmColor:'#2684D8',
- success: (res) => {
- if (res.confirm) {
- uni.showToast({
- title:'出库完成',
- icon:"success",
- mask:true,
- duration: 2000
- });
- setTimeout(function(){
- uni.navigateBack();
- },2000);
- }
- }
- });
- },
- /******图片上传******/
- selectImage() {
- let self = this;
- if (self.newData.newData15[8]) {
- uni.showToast({
- title: '最多上传9张图片',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- uni.chooseImage({
- count:1,
- sizeType: ["original", "compressed"],
- sourceType: ["album", "camera"],
- success: function(res) {
- if (res.tempFilePaths[0]) {
- res.tempFilePaths.forEach(function(item, index) {
- self.uploadImg(item);
- })
- }
- }
- });
- },
- async uploadImg(tempFilePaths) {
- var self = this;
- uni.showLoading({
- title: '上传中',
- mask: true
- });
- uni.uploadFile({
- url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
- header: {
- 'Authorization': uni.getStorageSync('token')
- },
- filePath: tempFilePaths,
- name: 'file',
- formData: {
- 'user': 'test'
- },
- success: (uploadFileRes) => {
- let res = JSON.parse(uploadFileRes.data);
- if (res.code == 200) {
- this.newData.newData15.push(res.data.url)
- // this.$set(this.newData, 'newData15', res.data.url);
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- },
- fail: err => {},
- complete: () => {
- uni.hideLoading()
- }
- });
- },
- //删除图片
- delImg(index) {
- this.newData.newData15.splice(index, 1)
- },
- //预览图片
- previewSingleImage(imageUrl) {
- uni.previewImage({
- urls: [imageUrl] // 必须包裹成数组
- });
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- #gasCylinderOutbound {
- height: 100%;
- width: 100%;
- display flex;
- flex-direction column;
- overflow: hidden;
- .gasCylinderOutbound-page {
- flex: 1;
- display flex;
- flex-direction column;
- overflow: hidden;
- .content-max-box {
- flex: 1;
- display flex;
- flex-direction column;
- overflow-y: scroll;
- .content-big-box {
- margin: 0 30rpx 0;
- .content-title-p {
- line-height: 80rpx;
- padding: 0 20rpx;
- color: #666;
- }
- .content-min-box {
- background-color: #fff;
- border-radius: 12rpx;
- .content-check-box {
- display: flex;
- padding: 40rpx 30rpx;
- border-bottom: 1rpx solid #dedede;
- view {
- font-size: 30rpx;
- line-height: 40rpx;
- }
- view:nth-child(1) {
- flex: 1;
- font-weight: 600;
- }
- view:nth-child(2) {
- font-size: 28rpx;
- font-weight: 600;
- margin-right: 10rpx;
- color: #666;
- }
- .right-icon {
- font-size: 30rpx;
- }
- }
- .content-bottom-text-box {
- margin: 0 30rpx;
- padding: 20rpx 0;
- .content-text-box {
- display: flex;
- view {
- font-size: 28rpx;
- line-height: 60rpx;
- }
- view:nth-child(1) {}
- view:nth-child(2) {
- flex: 1;
- text-align: right;
- }
- }
- }
- }
- }
- }
- .content-max-input-box {
- background-color: #fff;
- border-radius: 12rpx;
- display: flex;
- margin: 30rpx 30rpx 0;
- padding: 0 30rpx;
- .name-box {
- font-size: 30rpx;
- font-weight: 600;
- line-height: 100rpx;
- }
- .input-box {
- flex: 1;
- height: 100rpx;
- line-height: 100rpx;
- text-align: right;
- }
- }
- .content-max-up-box {
- background-color: #fff;
- border-radius: 12rpx;
- margin: 30rpx 30rpx 0;
- padding: 0 30rpx;
- .name-box {
- font-size: 30rpx;
- font-weight: 600;
- line-height: 100rpx;
- }
- .up-big-box {
- padding: 0 0 30rpx 0;
- .img-data:nth-child(3n) {
- margin-right: 0 !important;
- }
- .img-data {
- display: inline-block;
- width: 190rpx;
- height: 190rpx;
- margin-right: 30rpx;
- margin-bottom: 25rpx;
- position: relative;
- .min-img {
- display: block;
- width: 190rpx;
- height: 190rpx;
- overflow: hidden;
- border-radius: 12rpx;
- }
- .del-postion-p {
- position: absolute;
- top: -15rpx;
- right: -15rpx;
- width: 40rpx;
- height: 40rpx;
- color: red;
- }
- }
- .add-button {
- display: inline-block;
- overflow: hidden;
- border: 1rpx solid #dedede;
- border-radius: 12rpx;
- width: 190rpx !important;
- height: 145rpx;
- text-align: center;
- color: #666;
- font-size: 28rpx;
- padding-top: 45rpx;
- }
- }
- .textarea-box {
- width: 570rpx;
- padding: 30rpx;
- border: 1px solid #dedede;
- border-radius: 12rpx;
- margin-bottom: 30rpx;
- }
- }
- .bottom-button-p {
- width: 700rpx;
- height: 100rpx;
- line-height: 100rpx;
- text-align: center;
- margin: 30rpx auto 60rpx;
- color: #fff;
- background-color: #0183FA;
- border-radius: 16rpx;
- }
- }
- }
- </style>
|