123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <template>
- <view>
- <view class="uni-form-item uni-column">
- <view class="uni-flex uni-row">
- <view class="title">交验单号:</view>
- <input class="uni-input" style="-webkit-flex: 1;flex: 1;margin-right: 5px;" v-model="deliverNo" :focus="foucusIndex === 0" placeholder="请输入交验单号" @confirm="foucusChange0"/>
- </view>
- <view class="uni-flex uni-row" style="margin-top: 3px;margin-bottom: 3px;">
- <view class="title">生产令号:</view>
- <input class="uni-input" style="margin-right: 5px;" :focus="foucusIndex === 1" v-model="bomNo" placeholder="请输入生产令号" @confirm="foucusChange1"/>
- </view>
- <view class="uni-flex uni-row">
- <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;" @click="queryFun">查询</button>
- <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;margin-right: 5px;" @click="resetCondition">重置条件</button>
- </view>
- </view>
- <view style="margin-left: 5px;margin-right: 5px;">
- <view style="margin-left: 10px;margin-bottom: 5px;">已质检完成的交验单数据:</view>
- <view class="my-tips-view" v-if="isShowTips">没有查询到交验单数据......</view>
- <view class="uni-navigate-item1 uni-flex uni-row" style="-webkit-justify-content: space-between;justify-content: space-between;"
- v-for="(item,key) in deliverList" :key="key" @click="goDetailPage(item)">
- <text class="uni-navigate-text">{{item.deliverNo}}</text>
- <text class="uni-navigate-icon uni-icon"></text>
- </view>
- </view>
- </view>
- </template>
- <script>
- // TODO 修复Android v3 加载过慢问题
- // #ifdef APP-PLUS
- var domModule = weex.requireModule('dom');
- domModule.addRule('fontFace', {
- 'fontFamily': "uniicons",
- 'src': "url('/static/uni.ttf')"
- });
- // #endif
- export default {
- data() {
- return {
- title: '没有查询到校验单数据......',
- deliverNo : '',
- bomNo: '',
- isShowTips: true,
- deliverList:[],
- foucusIndex: 0
- }
- },
- methods: {
- initData() {
- this.deliverList = []
- let random = Math.round(Math.random()*10)
- let random1 = Math.round(Math.random()*80+10)
- if(random)
- {
- for(let i = 1; i <= random; i++) {
- this.deliverList.push({
- deliverid: i,
- deliverNo: 'JC-JY-23021400' + (i + random1)
- });
- }
- this.isShowTips = false;
- }
- else {
- this.isShowTips = true;
- }
- },
- async queryFun() {
- uni.showLoading({
- title: "正在查询...",
- mask: true,
- })
- this.deliverList = []
- let parm = {
- url : '/business/QaInspectRecord/QueryCheckedSapDeliverData',
- data: {
- DeliverNo: this.deliverNo,
- BomNo: this.bomNo
- },
- method: 'POST',
- isHaveToken : true
- }
- let retData = await getApp().RequestData(parm)
- // console.log(retData)
- if(retData.isSuccess) {
- if(retData.data.code == 200) {
- let len = retData.data.data.length
- for (let i = 0; i < len; i++) {
- this.deliverList.push({
- deliverid: i + 1,
- deliverNo: retData.data.data[i].deliverNo
- });
- }
- if(len > 0) {
- this.isShowTips = false
- }
- else {
- this.isShowTips = true
- }
- }
- else {
- this.isShowTips = true
- }
- }
- else {
- this.isShowTips = true
- }
- uni.hideLoading()
- },
- resetCondition() {
- this.deliverNo = ''
- this.bomNo = ''
- this.foucusIndex = 0
- },
- goDetailPage(item) {
- let urlStr = '/pages/Instore/instoreDtlNew?deliverNo=' + item.deliverNo;
- uni.navigateTo({
- url: urlStr
- });
- },
- foucusChange0(event) {
- let str = event.detail.value
- if(str.length !== 0) {
- this.foucusIndex = 1
- }
- },
- foucusChange1(event) {
- let str = event.detail.value
- if(str.length !== 0) {
- this.foucusIndex = 2
- }
- }
- }
- }
- </script>
- <style lang="scss">
- @import '@/common/uni-nvue.css';
- .uni-navigate-icon-01 {
- //margin-left: 200px;
- // margin-right: 5px;
- color: #999999;
- font-size: 14px;
- font-weight: normal;
- }
- .uni-navigate-item1 {
- align-items: center;
- background-color: #FFFFFF;
- border-top-style: solid;
- border-top-color: #f0f0f0;
- border-top-width: 1px;
- padding: 12px;
- cursor: pointer;
- }
- .uni-navigate-item1:active {
- background-color: #007AFF;
- }
- .my-tips-view {
- margin-top: 50px;
- text-align: center;
- color: #999999;
- font-size: 20px;
- font-weight: normal;
- }
- </style>
|