|
|
@@ -43,6 +43,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="row mt-4 ml-1">
|
|
|
+ <label class="col-2" for="ownerId">货主</label>
|
|
|
+ <select id="ownerId" v-model="model.owner_id" class="col-6 form-control">
|
|
|
+ <option v-for="owner in owners" :value="owner.id">@{{ owner.name }}</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
<div class="row mt-4 ml-1">
|
|
|
<label class="col-2" for="procurementNumber">采购单号</label>
|
|
|
<input class="col-6 form-control" type="text" id="procurementNumber" v-model="model.procurement_number">
|
|
|
@@ -64,7 +70,9 @@
|
|
|
<div class="row mt-2 ml-1">
|
|
|
<label class="col-2" for="isUpload">是否上传明细单</label>
|
|
|
<input content="col-3" id="isUpload" type="checkbox" class="switch" v-model="model.is_upload">
|
|
|
- <button v-if="model.is_upload" type="button" class="col-2 offset-1 btn btn-info text-white" @click="openFile()">
|
|
|
+ <button data-toggle="tooltip" id="openFile" type="button" class="col-2 offset-1 btn btn-info text-white"
|
|
|
+ title="表头必须包含:商品名称 数量 条码"
|
|
|
+ v-show="model.is_upload" @click="openFile()">
|
|
|
<span class="fa fa-cloud-upload"></span> 选择文件</button>
|
|
|
<span v-if="model.is_upload" class="text-secondary mt-1"> @{{ fileName }}</span>
|
|
|
<label hidden><input type="file" id="file" accept=".csv, .xlsx, .xls" @change="selectedFile($event)"></label>
|
|
|
@@ -87,15 +95,19 @@
|
|
|
model:{
|
|
|
cars:[{number:"",id:"",name:"",phone:""}],
|
|
|
},
|
|
|
- owners:JSON.parse("{{$owners->toJson() ?? '{}'}}"),
|
|
|
+ owners:@json($owners),
|
|
|
fileName:""
|
|
|
},
|
|
|
mounted(){
|
|
|
-
|
|
|
+ if (this.owners.length === 1)this.model.owner_id = this.owners[0].id;
|
|
|
+ $('#openFile').tooltip();
|
|
|
},
|
|
|
methods:{
|
|
|
openFile(){
|
|
|
- $('#file').click();
|
|
|
+ if (!this.model.owner_id){
|
|
|
+ window.tempTip.setDuration(2000);
|
|
|
+ window.tempTip.show("必须先选定货主");
|
|
|
+ }else $('#file').click();
|
|
|
},
|
|
|
selectedFile(e){
|
|
|
let file=e.target.files[0];
|
|
|
@@ -107,7 +119,7 @@
|
|
|
}
|
|
|
let formData = new FormData();
|
|
|
formData.append("file",file);
|
|
|
- window.axios.post('{{url('maintenance/priceModel/logistic/import')}}',formData,{
|
|
|
+ window.axios.post('{{url('store/checkingReceive/appointment/import')}}',formData,{
|
|
|
'Content-Type':'multipart/form-data'
|
|
|
}).then(res=>{
|
|
|
window.tempTip.setDuration(3000);
|