yangan
2024-10-15 5211e91aa2a919a9026b1db61bc1740c97d78c51
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<template>
   <view class="edc-sampling-form-wrap">
     <u--form
         labelPosition="left"
         :model="modelForm"
         :rules="rules"
         ref="uForm"
         labelAlign="right"
         labelWidth="20%"
     >
       <u-form-item
           label="车牌:"
           prop="carNo"
           borderBottom
           ref="item1"
       >
         <u--input
             v-model="modelForm.carNo"
             border="none"
         ></u--input>
       </u-form-item>
       <u-form-item
           label="供应商:"
           prop="customerName"
           borderBottom
           ref="item1"
       >
         <u--input
             v-model="modelForm.customerName"
             border="none"
         ></u--input>
       </u-form-item>
       <u-form-item
           label="批次:"
           prop="batchNumber"
           borderBottom
           ref="item1"
       >
         <u--input
             v-model="modelForm.batchNumber"
             border="none"
         ></u--input>
       </u-form-item>
       <u-form-item
           label="检验日期:"
           prop="startTime"
           borderBottom
           ref="item1"
       >
         <u--input
             v-model="modelForm.startTime"
             border="none"
         ></u--input>
       </u-form-item>
       <u-form-item
           label="采样地点:"
           prop="bunkerName"
           borderBottom
           ref="item1"
       >
         <u--input
             v-model="modelForm.bunkerName"
             border="none"
         ></u--input>
       </u-form-item>
       <u-form-item
           label="取样人:"
           prop="samplingPerson"
           borderBottom
           ref="item1"
       >
         <u--input
             v-model="modelForm.samplingPerson"
             border="none"
         ></u--input>
       </u-form-item>
     </u--form>
   </view>
</template>
 
<script>
const dayjs = require('dayjs')
 
export default {
  name: "edc-sampling-form",
  data() {
    return {
      modelForm: {
        id:'',
        carNo:'',
        customerName:'',
        batchNumber: '',
        startTime: '',
        bunkerName:'',
        samplingPerson: '',
        type: 1,  //1 EDC、2 聚氯乙烯树脂、3 硫酸、4 氢氧化钠 5 液氯 6、原盐钙镁 7、原盐TOC 8、原盐全检
      },
      checkId:'',
      rules: {
 
      }
    }
  },
  onLoad(opt) {
    if(opt.checkId) {
      this.checkId = opt.checkId
      console.log(this.checkId,'接收到上个页面传过来的参数===')
    }
    this.getByIdAndSubList()
  },
  methods: {
    getByIdAndSubList() {
      uni.showLoading({
        title:'加载中'
      })
      // this.$reqGet2('getByIdAndSubList',this.checkId).then(res => {
      //
      // })
      uni.request({  //获取deptId
        url: `/wrzs/zjqualitycheck/getByIdAndSubList/${this.checkId}`,
        method: 'GET',
        header: {
          Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'),
          clientToc: 'Y',
          'CLIENT_TOC': 'Y',
        },
        success: res => {
          console.log(res,'res====')
          if(res.data.code == 0) {
            uni.hideLoading()
            this.modelForm = res.data.data
            this.modelForm.startTime = this.dayjs().format('YYYY-MM-DD')
 
          }
          // console.log(res,'shuj------')
          // this.filedId = res.data?.data.length > 0 ? res.data.data[0].id : '';
          // this.getFiledIdCoalBunker()
        }
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.edc-sampling-form-wrap{
  width: 100%;
  padding: 0 40rpx;
  box-sizing: border-box;
  ::v-deep{
    .u-form{
      padding-top: 20rpx;
    }
    .u-form-item{
      margin-bottom: 20rpx;
      .u-line {
        border-bottom-width: 0!important;
      }
      .u-form-item__body__right{
        padding-left: 20rpx;
      }
    }
 
  }
}
</style>