Files
liche/admin/views/items/transfer/get.php
T
2022-01-04 16:18:53 +08:00

142 lines
7.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div id="vue-edit" class="am-form am-form-horizontal" style="width: 100%;padding-top: 10px">
<div class="am-form-group">
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="30%"><span>车辆</span></th>
<th width="20%"><span>车架号</span></th>
<th width="10%"><span>颜色</span></th>
<th width="25%"><span>存放信息</span></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{info.items_info.title}}</td>
<td>{{info.items_info.vin}}</td>
<td>{{info.items_info.cor}}</td>
<td>{{info.items_info.address}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="am-panel am-panel-default">
<div class="am-panel-hd"><span style="font-size: 20px">调拨信息</span></div>
<div class="am-panel-bd am-g" style="margin: 10px">
<? foreach ($fields as $key => $value) { ?>
<? if ($value['title'] == '车辆异常' && $abnormal) { ?>
<div class="am-form-inline" style="line-height: 37px;font-size: 1.6rem;">
<?= $value['title'] ?><?= $value['value'] ?>
<button type="button" class="am-btn am-btn-default am-btn-sm" data-file="99"
data-type="jpg,png,gif,png,jpeg" data-uptype="qiniu"
data-field="img_rheight" data-params-source="vue_obj.abnormal.imgs"
v-if="opt_btn.type" style="margin-left: 8px;">
<i class="am-icon-cloud-upload"></i> 上传异常图片
</button>
</div>
<div class="am-form-inline" style="margin-top: 8px;" v-if="abnormal.imgs && abnormal.imgs.length>0">
<div class="photo-upload">
<div class="photo-upload-item" v-for="(v,i) in abnormal.imgs">
<img :src="v.src" class="img-thumbnail" :data-value="v.value" data-tips-image
style="width:100px;height:100px;">
<span class="photo-upload-item-remove" v-if="opt_btn.type">
<i class="fa fa-remove" data-rm-vue="vue_obj.abnormal.imgs" :data-index="i"></i>
</span>
</div>
</div>
</div>
<div class="am-form-inline" v-if="opt_btn.type" style="margin-top: 8px;">
<textarea v-if="opt_btn.type" rows="5" style="width: 50%" v-model="abnormal.note"
placeholder="请填写异常备注"></textarea>
</div>
<div class="am-form-inline" v-else-if="abnormal.note">
<textarea rows="5" disabled style="width: 50%" v-model="abnormal.note"></textarea>
</div>
<? } else if ($value['title'] == '运输人员' && $transport) { ?>
<div class="am-form-inline" style="line-height: 37px;font-size: 1.6rem;">
<?= $value['title'] ?><?= $value['value'] ?>
<button type="button" class="am-btn am-btn-default am-btn-sm" data-file="99"
data-type="jpg,png,gif,png,jpeg" data-uptype="qiniu"
data-field="img_rheight" data-params-source="vue_obj.transport.imgs"
v-if="opt_btn.type" style="margin-left: 8px;">
<i class="am-icon-cloud-upload"></i> 上传运输单号
</button>
</div>
<div class="am-form-inline" style="margin-top: 8px;" v-if="transport.imgs && transport.imgs.length>0">
<div class="photo-upload">
<div class="photo-upload-item" v-for="(v,i) in transport.imgs">
<img :src="v.src" class="img-thumbnail" :data-value="v.value" data-tips-image
style="width:100px;height:100px;">
<span class="photo-upload-item-remove" v-if="opt_btn.type">
<i class="fa fa-remove" data-rm-vue="vue_obj.transport.imgs" :data-index="i"></i>
</span>
</div>
</div>
</div>
<? } else { ?>
<div class="am-form-inline" style="line-height: 37px;font-size: 1.6rem;">
<?= $value['title'] ?><?= $value['value'] ?>
</div>
<? } ?>
<? } ?>
</div>
</div>
<div class="am-form-group" v-if="opt_btn.type">
<a href="javascript:void(0);" @click='saveEdit();' style="margin-left: 3.5rem;margin-top: 2rem;"
class="am-btn ml20 am-btn-sm am-btn-success w100">{{opt_btn.title}}</a>
</div>
</div>
<script>
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {'items_info': {}},
abnormal: {},
transport: {},
opt_btn: {},
},
mounted: function () {
var vm = this;
vm.info = <?=json_encode($info)?>;
vm.opt_btn = <?=json_encode($opt_btn)?>;
vm.abnormal = <?=json_encode($abnormal)?>;
vm.transport = <?=json_encode($transport)?>;
},
methods: {
saveEdit: function () {
var vm = this;
$.ajax({
url: '/items/transfer/edit',
type: 'post',
dataType: 'json',
data: {opt_btn: vm.opt_btn, abnormal: vm.abnormal, transport: vm.transport},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
window.location.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
}
});
}
},
watch: {}
});
});
</script>