| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597 |
- <!-- 气瓶入库 -->
- <template>
- <view id="gasCylinderInbound">
- <view class="gasCylinderInbound-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)">
- <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-check-box" @click="checkButton(2)">
- <view>出库实验室</view>
- <view>{{newData.newData8?'更改':'请选择'}}</view>
- <uni-icons class="right-icon" type="right"></uni-icons>
- </view>
- <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-max-input-box">
- <view class="name-box">签收人</view>
- <view class="input-box" style="color:#808080;" @click='shadeButton(1)'>{{newData.newData13?newData.newData13:'请选择'}}</view>
- </view>
- <view class="content-max-input-box">
- <view class="name-box">费用</view>
- <input class="uni-input input-box" v-model="newData.newData14" type="number" maxlength="10"
- 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 class="shade-max-big-box" v-if="shadeType">
- <view class="shade-big-top-box" @click="shadeButton(2)"></view>
- <view class="shade-big-bottom-box">
- <view class="shade-input-max-box">
- <uni-icons type="search" class="icons-box" size="20"></uni-icons>
- <input class="uni-input input-box" v-model="inputData" maxlength="20" placeholder="请输入" />
- <view class="button-box" @click="searchButton()">搜索</view>
- </view>
- <view class="list-max-box">
- <view @click="checkUserButton(item)"
- v-for="(item,index) in userList" :key="index">
- {{item.userName}}({{item.account}})
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- systemUserSelectUser
- } from '@/pages_supplierCylinderManagement/api/index.js'
- export default {
- data() {
- return {
- baseUrl: config.base_url,
- newData: {
- newData1: '',
- newData2: '',
- newData3: '',
- newData4: '',
- newData5: '',
- newData6: '',
- newData7: '',
- newData8: '',
- newData9: '',
- newData91: '',
- newData92: '',
- newData10: '',
- newData11: '',
- newData12: '',
- newData13: '',
- newData133: '',
- newData14: '',
- newData15: [],
- newData16: '',
- },
- inputData: '',
- userList:[],
- shadeType:false,
- }
- },
- onLoad(options) {
- if (options.pageType) {
- let obj = JSON.parse(decodeURIComponent(options.form));
- if (options.pageType == 1) {
- this.$set(this.newData, 'newData1', obj.id);
- this.$set(this.newData, 'newData2', obj.bottleCode);
- this.$set(this.newData, 'newData3', obj.gasName);
- this.$set(this.newData, 'newData4', obj.specification);
- this.$set(this.newData, 'newData5', obj.gasCategory);
- this.$set(this.newData, 'newData6', obj.pressure);
- this.$set(this.newData, 'newData7', obj.purity);
- } else if (options.pageType == 2) {
- this.$set(this.newData, 'newData8', obj.subId);
- this.$set(this.newData, 'newData9', obj.subName);
- this.$set(this.newData, 'newData92', obj.deptId);
- this.$set(this.newData, 'newData10', obj.buildName);
- this.$set(this.newData, 'newData11', obj.floorName);
- this.$set(this.newData, 'newData12', obj.roomNum);
- }
- }
- },
- onShow() {
- },
- methods: {
- checkButton(type) {
- if (type == 1) {
- uni.navigateTo({
- url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/selectCylinder?from=1",
- });
- } else if (type == 2) {
- uni.navigateTo({
- url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/selectLab?from=1",
- });
- }
- },
- //提交方法
- 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] // 必须包裹成数组
- });
- },
- searchButton(){
- if(this.inputData !== '' && this.inputData.length>1){
- this.systemUserSelectUser();
- }else{
- uni.showToast({
- title: '请输入至少2个字符',
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- },
- //搜索用户
- async systemUserSelectUser() {
- const {
- data
- } = await systemUserSelectUser({
- "userName": this.inputData,
- 'userType': '1'
- });
- if (data.code == 200) {
- this.$set(this,'userList',data.data);
- }
- },
- //选择用户
- checkUserButton(item){
- this.$set(this.newData,'newData13',item.userName);
- this.$set(this.newData,'newData133',item.userId);
- this.$set(this,'shadeType',false);
- },
- //遮罩层开关
- shadeButton(type){
- if(type == 1){
- if(this.newData.newData13){
- this.$set(this,'inputData',this.newData.newData13);
- this.systemUserSelectUser();
- }
- this.$set(this,'shadeType',true);
- }else if(type == 2){
- this.$set(this,'shadeType',false);
- }
- }
- }
- }
- </script>
- <style lang="stylus" scoped>
- #gasCylinderInbound {
- height: 100%;
- width: 100%;
- display flex;
- flex-direction column;
- overflow: hidden;
- .gasCylinderInbound-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;
- 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 {
- border-top: 1rpx solid #dedede;
- 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;
- }
- }
- .shade-max-big-box {
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- z-index: 10;
- background-color: rgba(0, 0, 0, 0.2);
- .shade-big-top-box {
- flex: 1;
- }
- .shade-big-bottom-box {
- height:800rpx;
- background-color: #fff;
- border-top-left-radius: 30rpx;
- border-top-right-radius: 30rpx;
- .shade-input-max-box {
- display: flex;
- margin: 40rpx 60rpx;
- .icons-box {
- border-top-left-radius: 30rpx;
- border-bottom-left-radius: 30rpx;
- width: 80rpx;
- text-align: center;
- height: 60rpx;
- line-height: 60rpx;
- background-color: #eeeeee;
- }
- .input-box {
- flex: 1;
- padding: 0 20rpx 0 0;
- height: 60rpx;
- line-height: 60rpx;
- background-color: #eeeeee;
- font-size: 28rpx;
- }
- .button-box {
- background-color: #0183FA;
- color: #fff;
- width: 120rpx;
- text-align: center;
- line-height: 60rpx;
- font-size: 28rpx;
- border-top-right-radius: 30rpx;
- border-bottom-right-radius: 30rpx;
- }
- }
- .list-max-box {
- height:660rpx;
- overflow-y: scroll;
- border-top: 1rpx solid #dedede;
- view:nth-child(1){
- border:none;
- }
- view{
- font-size:28rpx;
- padding:20rpx 40rpx;
- line-height:60rpx;
- border-top:1rpx solid #dedede;
- display block;
- overflow hidden;
- text-overflow ellipsis;
- white-space nowrap;
- }
- }
- }
- }
- }
- </style>
|