123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <template>
- <view>
- <view
- style="box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);width: 96%;border-top-right-radius: 10rpx;margin: 10rpx auto;padding-top: 10rpx;">
- <span
- style="width: 10rpx;height: 40rpx;background-color: #2979ff;display: block;float: left;margin-top: 20rpx;"></span>
- <!-- <h4 style="width: 140rpx;border-radius: 200rpx;text-align: center;color: #2979ff;border: 2rpx solid #1785FF;float: right;margin-right: 10rpx;margin-top: 10rpx;">2222222</h4> -->
- <view style="width: 92%;margin: 0 auto;margin: 0 auto;">
- <view
- style="display: flex;justify-content: space-between;height: 80rpx;line-height: 80rpx;border-bottom: 1rpx solid #eff4ff;">
- <h3>基本信息</h3>
- </view>
- <view>
- <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
- <view style="float: left;">仓库</view>
- <view style="float: right;">{{form.fWarehouseName}}</view>
- </view>
- <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
- <view style="float: left;">计划日期</view>
- <view style="float: right;">{{form.fInspectionDatetime}}</view>
- </view>
- <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
- <view style="float: left;">最新巡查日期</view>
- <view style="float: right;">{{form.fUpdateTime}}</view>
- </view>
- <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
- <view style="float: left;">巡检员</view>
- <view style="float: right;">{{form.fInspectorName}}</view>
- </view>
- <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
- <view style="float: left;">备注</view>
- <view style="float: right;">{{form.fRemark}}</view>
- </view>
- </view>
- <!-- <view style="width: 100%;margin: 0 auto;height: 80rpx;margin: 0 auto;line-height: 80rpx;border-top: 1rpx solid #eff4ff;" @click="expenseDetails(item)">
- <view style="float: left;"><h3>立即巡检</h3></view>
- <view style="float: right;"><u-icon name="arrow-right"></u-icon></view>
- </view> -->
- </view>
- </view>
- <view
- style="box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);width: 96%;border-top-right-radius: 10rpx;margin: 10rpx auto;padding-top: 10rpx;">
- <span
- style="width: 10rpx;height: 40rpx;background-color: #2979ff;display: block;float: left;margin-top: 20rpx;"></span>
- <!-- <h4 style="width: 140rpx;border-radius: 200rpx;text-align: center;color: #2979ff;border: 2rpx solid #1785FF;float: right;margin-right: 10rpx;margin-top: 10rpx;">2222222</h4> -->
- <view style="width: 92%;margin: 0 auto;margin: 0 auto;">
- <view
- style="display: flex;justify-content: space-between;height: 80rpx;line-height: 80rpx;border-bottom: 1rpx solid #eff4ff;">
- <h3>{{deptName == '外部用户'?fileList.length == 0?'暂无附件':'附件':'上传附件'}}</h3>
- </view>
- <view>
- <u-upload style="width: 100%;" :action="action" @on-success="success" @on-remove="remove" :file-list="fileList" :header="headers" :deletable="deptName == '外部用户'?false:true" :max-count="deptName == '外部用户'?fileList.length:99"></u-upload>
- </view>
- </view>
- </view>
- <view
- style="width: 100%;position:fixed; bottom:0;background-color: #FFFFFF;padding-left: 20px;padding-right: 20px;padding-bottom: 30rpx;">
- <u-button type="primary" @click="submit" v-if="deptName != '外部用户'">确认保存</u-button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- action: this.$u.http.config.baseUrl + '/common/upload',
- headers: {
- Authorization: 'Bearer ' + this.$store.state.vuex_token
- },
- form: {},
- deptName:'',
- fileList: [],
- pictureEist: [],
- twarehousecheckdetailList: {}
- }
- },
- onLoad(option) {
- this.deptName = uni.getStorageSync('deptName')
- this.form = JSON.parse(option.form)
- let scope = {
- row:JSON.parse(option.form)
- }
-
- this.$u.get(this.deptName != '外部用户'?'/warehouse/checkitemsdetails/list':'/warehouse/checkitemsdetails/appList', {
- fItemFid: this.form.fId
- }).then(res => {
- console.log(res)
- let data = res.rows
- if (data.length === 0) {
- this.twarehousecheckdetailList = {
- fCheckFid: scope.row.fCheckFid,
- fItemFid: scope.row.fId,
- fWarehouseid: scope.row.fWarehouseFid, //仓库名称
- fCreateTime: '',
- fInspectorid: '',
- fRemark: '',
- fPhotoUrl: []
- }
- } else {
- this.twarehousecheckdetailList = res.rows[0]
- this.twarehousecheckdetailList.fWarehouseid = scope.row.fWarehouseFid
- this.fileList = []
- for (let item in JSON.parse(res.rows[0].fPhotoUrl)) {
- this.fileList.push(JSON.parse(res.rows[0].fPhotoUrl)[item])
- }
- this.pictureEist = this.fileList
- }
- })
- },
- created() {},
- methods: {
- submit() {
- // console.log(this.twarehousecheckdetailList)
- // console.log(this.fileList)
- // console.log(this.pictureEist)
- this.twarehousecheckdetailList.fPhotoUrl = []
- for (let item in this.pictureEist) {
- if (this.pictureEist[item].response) {
- this.twarehousecheckdetailList.fPhotoUrl.push({
- url: this.pictureEist[item].response.url
- })
- } else {
- this.twarehousecheckdetailList.fPhotoUrl.push({
- url: this.pictureEist[item].url
- })
- }
- }
- this.twarehousecheckdetailList.fPhotoUrl = JSON.stringify(this.twarehousecheckdetailList.fPhotoUrl)
- if (!this.twarehousecheckdetailList.fId) {
- this.$u.post('warehouse/checkitemsdetails', this.twarehousecheckdetailList).then(res => {
- uni.showToast({
- icon: 'none',
- title: '保存成功',
- position: "bottom"
- })
- })
- } else {
- this.$u.put('warehouse/checkitemsdetails', this.twarehousecheckdetailList).then(res => {
- uni.showToast({
- icon: 'none',
- title: '保存成功',
- position: "bottom"
- })
- })
- }
- },
- success(data, index, lists, name) {
- // console.log(lists)
- this.pictureEist = lists
- },
- remove(index, lists, name) {
- // console.log(index,lists)
- this.pictureEist = lists
- }
- }
- }
- </script>
- <style>
- </style>
|