|
|
@@ -0,0 +1,766 @@
|
|
|
+@extends('layouts.app')
|
|
|
+@section('title')开单入库-创建@endsection
|
|
|
+@section('head')
|
|
|
+ <link href="{{ mix('css/element-ui.css') }}" rel="stylesheet">
|
|
|
+ <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
|
|
+@endsection
|
|
|
+
|
|
|
+@section('content')
|
|
|
+ <div id="list" class="d-none">
|
|
|
+ <div class="container-fluid ">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body">
|
|
|
+ <form name="receiving-task-form" id="receiving-task-form">
|
|
|
+ <div class="form-group row">
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="warehouse_id">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 仓库
|
|
|
+ </label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <select class="form-control form-control-sm col-12" name="warehouse_id"
|
|
|
+ @change="clearError('warehouse_id')"
|
|
|
+ id="warehouse_id"
|
|
|
+ :class="{'is-invalid':errors.warehouse_id}"
|
|
|
+ v-model="receiving_task.warehouse_id">
|
|
|
+ <option v-for="item in ware_house"
|
|
|
+ :value="item.value"
|
|
|
+ v-text="item.name"></option>
|
|
|
+ </select>
|
|
|
+ <div id="validation-warehouse" class="invalid-feedback"
|
|
|
+ v-show="errors.warehouse_id">
|
|
|
+ <span v-text="errors.warehouse_id"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="for_single_member">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 投单员</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="text" class="form-control form-control-sm col-12" placeholder=""
|
|
|
+ id="for_single_member" name="for_single_member"
|
|
|
+ :class="{'is-invalid':errors.for_single_member}"
|
|
|
+ @change="clearError('for_single_member')"
|
|
|
+
|
|
|
+ v-model="receiving_task.for_single_member">
|
|
|
+ <div id="validation-for-single-member" class="invalid-feedback"
|
|
|
+ v-show="errors.for_single_member">
|
|
|
+ <span v-text="errors.for_single_member"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="owner_id">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 货主</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <select class="form-control form-control-sm col-12" name="owner_id" id="owner_id"
|
|
|
+ :class="{'is-invalid':errors.owner_id}"
|
|
|
+ @change="getASNDetails"
|
|
|
+ @input="clearError('owner_id')"
|
|
|
+ v-model="receiving_task.owner_id">
|
|
|
+ <option v-for="item in owners" :value="item.id" v-text="item.name"></option>
|
|
|
+ </select>
|
|
|
+ <div id="validation-owner-id" class="invalid-feedback" v-show="errors.owner_id">
|
|
|
+ <span v-text="errors.owner_id"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="driver_name">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 司机姓名</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="text" class="form-control form-control-sm col-12" placeholder=""
|
|
|
+ name="driver_name" id="driver_name"
|
|
|
+ :class="{'is-invalid':errors.driver_name}"
|
|
|
+ @change="clearError('driver_name')"
|
|
|
+ v-model="receiving_task.driver_name">
|
|
|
+ <div id="validation-driver-name" class="invalid-feedback"
|
|
|
+ v-show="errors.driver_name">
|
|
|
+ <span v-text="errors.driver_name"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="driver-phone">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 司机电话</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="text" class="form-control form-control-sm col-12" placeholder=""
|
|
|
+ name="driver_phone" id="driver-phone"
|
|
|
+ :class="{'is-invalid':errors.driver_phone}"
|
|
|
+ @change="clearError('driver_phone')"
|
|
|
+ v-model="receiving_task.driver_phone">
|
|
|
+ <div id="validation-driver-phone" class="invalid-feedback"
|
|
|
+ v-show="errors.driver_name">
|
|
|
+ <span v-text="errors.driver_phone"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="appointment_number">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 预约单号</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="text" class="form-control form-control-sm col-12" placeholder=""
|
|
|
+ name="appointment_number" id="appointment_number"
|
|
|
+ :class="{'is-invalid':errors.appointment_number}"
|
|
|
+ @change="clearError('appointment_number')"
|
|
|
+ v-model="receiving_task.appointment_number">
|
|
|
+ <div id="validation-delivery-appointment-number" class="invalid-feedback"
|
|
|
+ v-show="errors.appointment_number">
|
|
|
+ <span v-text="errors.appointment_number"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block" for="plate_number">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 车牌号</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="text" class="form-control form-control-sm col-12" placeholder=""
|
|
|
+ name="plate_number" id="plate_number"
|
|
|
+ :class="{'is-invalid':errors.plate_number}"
|
|
|
+ @change="clearError('plate_number')"
|
|
|
+ :disabled="receiving_task.logistics_single_number"
|
|
|
+ v-model="receiving_task.plate_number">
|
|
|
+ <div id="validation-plate-number" class="invalid-feedback"
|
|
|
+ v-show="errors.plate_number">
|
|
|
+ <span v-text="errors.plate_number"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block" for="driving_license_no">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 驾驶证号</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="text" class="form-control form-control-sm col-12" placeholder=""
|
|
|
+ name="driving_license_no" id="driving_license_no"
|
|
|
+ :class="{'is-invalid':errors.driving_license_no}"
|
|
|
+ @change="clearError('driving_license_no')"
|
|
|
+ :disabled="receiving_task.logistics_single_number"
|
|
|
+ v-model="receiving_task.driving_license_no">
|
|
|
+ <div id="validation-driving-license-no" class="invalid-feedback"
|
|
|
+ v-show="errors.driving_license_no">
|
|
|
+ <span v-text="errors.driving_license_no"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block"
|
|
|
+ for="logistics_single_number">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 物流单号</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="text" class="form-control form-control-sm col-12" placeholder=""
|
|
|
+ name="logistics_single_number" id="logistics_single_number"
|
|
|
+ :class="{'is-invalid':errors.logistics_single_number}"
|
|
|
+ @change="clearError('logistics_single_number')"
|
|
|
+ :disabled="checkLogisticsSingleIsWrite()"
|
|
|
+ v-model="receiving_task.logistics_single_number">
|
|
|
+ <div id="validation-driving-license-no" class="invalid-feedback"
|
|
|
+ v-show="errors.logistics_single_number">
|
|
|
+ <span v-text="errors.logistics_single_number"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="plate_number">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 是否提供清单</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <select name="provide_list" id="provide_list"
|
|
|
+ class="form-control form-control-sm col-12"
|
|
|
+ :class="{'is-invalid':errors.provide_list}"
|
|
|
+ @change="clearError('provide_list')"
|
|
|
+ v-model="receiving_task.provide_list">
|
|
|
+ <option v-for="item in provide_lists" :value="item" v-text="item"></option>
|
|
|
+ </select>
|
|
|
+ <div id="validation-provide_list" class="invalid-feedback"
|
|
|
+ v-show="errors.provide_list">
|
|
|
+ <span v-text="errors.provide_list"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="receiving_type">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 收货类型</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <select name="receiving_type" id="receiving_type"
|
|
|
+ class="form-control form-control-sm col-12"
|
|
|
+ :class="{'is-invalid':errors.receiving_type}"
|
|
|
+ @change="clearError('provide_list')"
|
|
|
+ v-model="receiving_task.receiving_type">
|
|
|
+ <option v-for="item in receiving_types" :value="item" v-text="item"></option>
|
|
|
+ </select>
|
|
|
+ <div id="validation-receiving-type" class="invalid-feedback"
|
|
|
+ v-show="errors.receiving_type">
|
|
|
+ <span v-text="errors.receiving_type"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <div class="form-inline col-4 row">
|
|
|
+ <label class="col-4 col-form-label text-right d-inline-block text-primary"
|
|
|
+ for="driving_license_image">
|
|
|
+ <span class="text-danger">*</span>
|
|
|
+ 驾驶证扫描件</label>
|
|
|
+ <div class="form-inline col-8">
|
|
|
+ <input type="file" class="form-control form-control-file col-12" placeholder=""
|
|
|
+ name="driving_license_image" id="driving_license_image">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="card-body mb-0 pt-0 pm-0">
|
|
|
+ <el-table
|
|
|
+ :key="asn_headers_table_key"
|
|
|
+ size="small"
|
|
|
+ highlight-current-row
|
|
|
+ ref="asn_headers_table"
|
|
|
+ :data="asn_headers"
|
|
|
+ height="350"
|
|
|
+ border
|
|
|
+ @row-click="showAsnDetails"
|
|
|
+ row-key="asn_no"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ style="width: 100%">
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="customer_id" label="货主">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="asn_no" label="ASN号">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="asn_type" label="ASN类型">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="asn_status" label="订单状态">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="up_stream_number"
|
|
|
+ label="上游单号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="anticipated_sum_number"
|
|
|
+ label="预期总数">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="number1"
|
|
|
+ label="参考编号1"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="number2"
|
|
|
+ label="参考编号2">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="number3"
|
|
|
+ label="参考编号3">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="receiving_time"
|
|
|
+ label="接收时间">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="card-body mt-0 pt-0 pm-0">
|
|
|
+ <el-table
|
|
|
+ ref="asn_details_table"
|
|
|
+ size="small"
|
|
|
+ border
|
|
|
+ :data="asn_details"
|
|
|
+ style="width: 100%"
|
|
|
+ height="300">
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="line_status"
|
|
|
+ label="行状态"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="产品名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="code1"
|
|
|
+ label="条码1"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="code2"
|
|
|
+ label="条码2"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="code3"
|
|
|
+ label="条码3">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="anticipated_number"
|
|
|
+ label="预期数量"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="number"
|
|
|
+ label="已收取"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <el-button type="primary" class="col-12" @click="submit" v-if="!submit_loading">提 交</el-button>
|
|
|
+ <el-button type="primary" class="col-12" :loading="true" v-if="submit_loading">提 交 中</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ @can('入库管理-开单入库-打印任务单')
|
|
|
+ <el-button type="primary" class="col-12" @click="printLodop">打 印</el-button>
|
|
|
+ @endcan
|
|
|
+ </div>
|
|
|
+ @include("store.receivingTasks._receiving_task_print")
|
|
|
+ @include("store.receivingTasks._clodop_print")
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+@endsection
|
|
|
+@section('lastScript')
|
|
|
+
|
|
|
+ <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
|
|
|
+ <script type="text/javascript" src="{{ mix('js/element-ui.js') }}"></script>
|
|
|
+ <script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
|
|
+ <script type="text/javascript" src="{{mix('js/lodop/LodopFuncs.js')}}"></script>
|
|
|
+
|
|
|
+ <script src='http://localhost:18000/CLodopfuncs.js?name=CLODOPA'></script>
|
|
|
+ <script>
|
|
|
+ let vue = new Vue({
|
|
|
+ el: "#list",
|
|
|
+ data: {
|
|
|
+ receiving_task: {
|
|
|
+ warehouse_id: null,
|
|
|
+ owner_id: null,
|
|
|
+ appointment_number: null,
|
|
|
+ driver_name: null,
|
|
|
+ driver_phone: null,
|
|
|
+ for_single_member: null,
|
|
|
+ plate_number: null,
|
|
|
+ driving_license_no: null,
|
|
|
+ logistics_single_number: null,
|
|
|
+ provide_list: null,
|
|
|
+ receiving_type: null,
|
|
|
+ },
|
|
|
+ provide_lists: ['是', '否'],
|
|
|
+ receiving_types: ['正常', '盲收'],
|
|
|
+ owners: [
|
|
|
+ @foreach($owners as $owner)
|
|
|
+ {
|
|
|
+ name: '{{$owner->name}}', value: '{{$owner->code}}', id: '{{$owner->id}}'
|
|
|
+ },
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ ware_house: [
|
|
|
+ @foreach($wareHouse as $item)
|
|
|
+ {
|
|
|
+ name: '{{$item->name}}', value: '{{$item->id}}'
|
|
|
+ },
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ driving_license_image: null,
|
|
|
+ asn_headers: [],
|
|
|
+ asn_details: [],
|
|
|
+ asn_detail: [],
|
|
|
+ loading_tag: false,
|
|
|
+ not_found_tag: false,
|
|
|
+ asn_headers_table_key: 1,
|
|
|
+ errors: {
|
|
|
+ warehouse_id: '',
|
|
|
+ owner_id: '',
|
|
|
+ appointment_number: '',
|
|
|
+ driver_name: '',
|
|
|
+ driver_phone: '',
|
|
|
+ for_single_member: '',
|
|
|
+ plate_number: '',
|
|
|
+ driving_license_no: '',
|
|
|
+ logistics_single_number: '',
|
|
|
+ provide_list: '',
|
|
|
+ receiving_type: '',
|
|
|
+ },
|
|
|
+ error_message: null,
|
|
|
+ selected_asn_nos: [],
|
|
|
+ submit_loading: false,
|
|
|
+ receiving_task_print: {
|
|
|
+ number: null, // 收货任务号
|
|
|
+ warehouse: null, // 仓库
|
|
|
+ for_single_member: null, // 投单员
|
|
|
+ driver_name: null, // 司机姓名
|
|
|
+ driver_phone: null, // 司机电话
|
|
|
+ plate_number: null, // 车号牌
|
|
|
+ driving_license_no: null, // 驾驶证号
|
|
|
+ provide_list: null, // 是否提供清单
|
|
|
+ receiving_type: null, // 收货类型
|
|
|
+ owner: null, // 货主
|
|
|
+ appointment_number: null, // 预约号
|
|
|
+ },
|
|
|
+ clodop:null,
|
|
|
+ clodopPrintDialogVisible: false,
|
|
|
+ printerList: [],
|
|
|
+ print_setting: {
|
|
|
+ printer_index: 0,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ $("#list").removeClass('d-none');
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ waitingTempTip(message) {
|
|
|
+ window.tempTip.setIndex(2005);
|
|
|
+ window.tempTip.waitingTip(message);
|
|
|
+ },
|
|
|
+ successTempTip(message) {
|
|
|
+ window.tempTip.setDuration(1500);
|
|
|
+ window.tempTip.setIndex(2005);
|
|
|
+ window.tempTip.showSuccess(message);
|
|
|
+ },
|
|
|
+ errorTempTip(message) {
|
|
|
+ window.tempTip.setDuration(2000);
|
|
|
+ window.tempTip.setIndex(2005);
|
|
|
+ window.tempTip.show(message);
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ let result = this.checkSubmitData();
|
|
|
+ if (!result.success) {
|
|
|
+ this.error_message = result.message;
|
|
|
+ this.errors[result.field] = result.message;
|
|
|
+ this.errorTempTip(result.message);
|
|
|
+ this.scrollToTop();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let url = "{{route("store.receivingMask.storeApi")}}";
|
|
|
+ let form = document.getElementById("receiving-task-form");
|
|
|
+ let formData = new FormData(form);
|
|
|
+ this.selected_asn_nos.forEach(e => {
|
|
|
+ if (e) formData.append('asn_nos[]', e);
|
|
|
+ });
|
|
|
+ this.submit_loading = true;
|
|
|
+ window.axios.post(url, formData, {
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
+ }).then(res => {
|
|
|
+ this.submit_loading = false;
|
|
|
+ if (res.data.success) {
|
|
|
+ this.successTempTip("创建成功");
|
|
|
+ this.conversion(res.data.data);
|
|
|
+ } else {
|
|
|
+ if (res.data.errors) {
|
|
|
+ let error = null;
|
|
|
+ for (const key in res.data.errors) {
|
|
|
+ this.errors[key] = res.data.errors[key].find(e => e);
|
|
|
+ if (!error) error = res.data.errors[key].find(e => e);
|
|
|
+ }
|
|
|
+ this.errorTempTip(error ? error : "创建异常请检查后提交");
|
|
|
+ this.scrollToTop();
|
|
|
+ } else if (res.data.message) {
|
|
|
+ this.errorTempTip(res.data.message ? res.data.message : '提交异常,请刷新重试');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.errorTempTip(err);
|
|
|
+ this.submit_loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getASNDetails() {
|
|
|
+ let {owner_id} = this.receiving_task;
|
|
|
+ let owner = this.owners.filter(e => e.id === owner_id).find(e => e);
|
|
|
+ if (!owner) return;
|
|
|
+ let url = '{{route('oracle.asn.getToBeProcessApi')}}';
|
|
|
+ let data = {customer_id: owner.value};
|
|
|
+ window.axios.post(url, data).then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.asn_headers = this.formatAsnHeaderDetails(res.data.data);
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.errorTempTip(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ formatAsnHeaderDetails(asnHeaderDetails) {
|
|
|
+ return asnHeaderDetails.map(e => this.formatAsnHeaderDetail(e));
|
|
|
+ },
|
|
|
+ formatAsnHeaderDetail(asnHeaderDetail) {
|
|
|
+ let asn_details = asnHeaderDetail.asn_details ? asnHeaderDetail.asn_details : [];
|
|
|
+ let anticipated_sum_number = this.getAnticipatedSumNumber(asn_details);
|
|
|
+ return {
|
|
|
+ customer_id: asnHeaderDetail.bas_customer ? asnHeaderDetail.bas_customer.descr_c : '',
|
|
|
+ asn_no: asnHeaderDetail.asnno ? asnHeaderDetail.asnno : '',
|
|
|
+ asn_type: asnHeaderDetail.asn_type ? asnHeaderDetail.asn_type.codename_c : '',
|
|
|
+ asn_status: asnHeaderDetail.asn_status ? asnHeaderDetail.asn_status.codename_c : '',
|
|
|
+ up_stream_number: asnHeaderDetail.asnreference1 ? asnHeaderDetail.asnreference1 : '',
|
|
|
+ anticipated_sum_number: anticipated_sum_number,
|
|
|
+ number1: asnHeaderDetail.asnreference1 ? asnHeaderDetail.asnreference1 : '',
|
|
|
+ number2: asnHeaderDetail.asnreference2 ? asnHeaderDetail.asnreference2 : '',
|
|
|
+ number3: asnHeaderDetail.asnreference3 ? asnHeaderDetail.asnreference3 : '',
|
|
|
+ receiving_time: asnHeaderDetail.asncreationtime ? asnHeaderDetail.asncreationtime : '',
|
|
|
+ details: this.formatAsnDetails(asn_details),
|
|
|
+ };
|
|
|
+ },
|
|
|
+ formatAsnDetails(asnDetails) {
|
|
|
+ return asnDetails.map(e => this.formatAsnDetail(e));
|
|
|
+ },
|
|
|
+ formatAsnDetail(asnDetail) {
|
|
|
+ return {
|
|
|
+ line_status: asnDetail.line_status ? asnDetail.line_status.codename_c : '',
|
|
|
+ name: asnDetail.bas_sku ? asnDetail.bas_sku.descr_c : '',
|
|
|
+ code1: asnDetail.bas_sku ? asnDetail.bas_sku.alternate_sku1 : '',
|
|
|
+ code2: asnDetail.bas_sku ? asnDetail.bas_sku.alternate_sku2 : '',
|
|
|
+ code3: asnDetail.bas_sku ? asnDetail.bas_sku.alternate_sku3 : '',
|
|
|
+ anticipated_number: asnDetail.expectedqty ? asnDetail.expectedqty : '',
|
|
|
+ number: asnDetail.receivedqty ? asnDetail.receivedqty : 0,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getAnticipatedSumNumber(asnDetails) {
|
|
|
+ if (asnDetails.length === 0) return 0;
|
|
|
+ let sum = asnDetails.reduce((total, e) => {
|
|
|
+ return total + Number(e.expectedqty);
|
|
|
+ }, 0);
|
|
|
+ return sum ? sum : 0;
|
|
|
+ },
|
|
|
+ showAsnDetails(row, column, event) {
|
|
|
+ this.$refs.asn_headers_table.setCurrentRow(row);
|
|
|
+ this.asn_details = row.details;
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.selected_asn_nos = val.map(e => e.asn_no);
|
|
|
+ },
|
|
|
+ checkSubmitData() {
|
|
|
+ let result = {success: true, message: '', field: '',};
|
|
|
+ let {
|
|
|
+ warehouse_id, owner_id,
|
|
|
+ driver_name, driver_phone, for_single_member,
|
|
|
+ plate_number, driving_license_no, logistics_single_number,
|
|
|
+ provide_list, receiving_type, appointment_number
|
|
|
+ } = this.receiving_task;
|
|
|
+
|
|
|
+ if (!warehouse_id) {
|
|
|
+ result = {success: false, message: "仓库为必选项", field: 'warehouse_id'};
|
|
|
+ } else if (!for_single_member) {
|
|
|
+ result = {success: false, message: "投单员不能为空", field: 'for_single_member'};
|
|
|
+ } else if (!owner_id) {
|
|
|
+ result = {success: false, message: "货主为必选项", field: 'owner_id'};
|
|
|
+ } else if (!driver_name) {
|
|
|
+ result = {success: false, message: "司机姓名不能为空", field: 'driver_name'};
|
|
|
+ } else if (!driver_phone) {
|
|
|
+ result = {success: false, message: "司机电话不能为空", field: 'driver_phone'};
|
|
|
+ } else if (!appointment_number) {
|
|
|
+ result = {success: false, message: "预约单号不能为空", field: 'appointment_number'};
|
|
|
+ }
|
|
|
+ if (!result.success) return result;
|
|
|
+ if (!logistics_single_number) {
|
|
|
+ if (!plate_number) {
|
|
|
+ result = {success: false, message: "车牌号不能为空", field: 'plate_number'};
|
|
|
+ } else if (!driving_license_no) {
|
|
|
+ result = {success: false, message: "驾驶证号", field: 'driving_license_no'};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!result.success) return result;
|
|
|
+ if (!provide_list) {
|
|
|
+ result = {success: false, message: "是否提供清单为必填项", field: 'provide_list'};
|
|
|
+ } else if (!receiving_type) {
|
|
|
+ result = {success: false, message: "收货类型不能为空", field: 'provide_list'};
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ },
|
|
|
+ clearError(field) {
|
|
|
+ this.errors[field] ? this.errors[field] = '' : null;
|
|
|
+ },
|
|
|
+ checkLogisticsSingleIsWrite() {
|
|
|
+ if (this.receiving_task.plate_number) return true;
|
|
|
+ else if (this.receiving_task.driving_license_no) return true;
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ checkLogisticsSingleNumber() {
|
|
|
+ if (this.receiving_task.plate_number) return true;
|
|
|
+ else if (this.receiving_task.driving_license_no) return true;
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ scrollToTop() {
|
|
|
+ const c = document.documentElement.scrollTop || document.body.scrollTop;
|
|
|
+ if (c > 0) {
|
|
|
+ window.requestAnimationFrame(this.scrollToTop);
|
|
|
+ window.scrollTo(0, c - c / 8);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ conversion(receivingTask) {
|
|
|
+ this.receiving_task_print = {
|
|
|
+ number: receivingTask.number,
|
|
|
+ warehouse: receivingTask.warehouse ? receivingTask.warehouse.name : '',
|
|
|
+ for_single_member: receivingTask.for_single_member,
|
|
|
+ driver_name: receivingTask.driver_name,
|
|
|
+ driver_phone: receivingTask.driver_phone,
|
|
|
+ plate_number: receivingTask.plate_number,
|
|
|
+ driving_license_no: receivingTask.driving_license_no,
|
|
|
+ provide_list: receivingTask.provide_list,
|
|
|
+ receiving_type: receivingTask.receiving_type,
|
|
|
+ owner: receivingTask.owner ? receivingTask.owner.name : '',
|
|
|
+ appointment_number: receivingTask.delivery_appointment_car ? receivingTask.delivery_appointment_car.appointment_number : ''
|
|
|
+ };
|
|
|
+ },
|
|
|
+ printLodop() {
|
|
|
+ this.clodop = null;
|
|
|
+ try {
|
|
|
+ this.clodop = getLodop();
|
|
|
+ if ((this.clodop != null) && (typeof (this.clodop.VERSION) != "undefined")) {
|
|
|
+ this.showPrintDialog();
|
|
|
+ } else {
|
|
|
+ this.downloadClodopConfirm();
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ this.errorTempTip('getLodop error');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ downloadClodopConfirm() {
|
|
|
+ this.$confirm('打印组件确实,是否下在?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ // 下载
|
|
|
+ this.downloadLodop();
|
|
|
+ }).catch(() => {
|
|
|
+ // 取消下载
|
|
|
+ });
|
|
|
+ },
|
|
|
+ downloadLodop() {
|
|
|
+ let url = "{{mix('/js/lodop/CLodop_Setup_for_Win32NT.exe')}}"
|
|
|
+ window.open(url, '_target');
|
|
|
+ },
|
|
|
+ showPrintDialog() { //
|
|
|
+ this.getPrinterList();
|
|
|
+ this.clodopPrintDialogVisible = true;
|
|
|
+ },
|
|
|
+ getPrinterList() { // 获取打印机列表
|
|
|
+ this.printerList = [];
|
|
|
+ let count = this.clodop.GET_PRINTER_COUNT();
|
|
|
+ for (let i = 0; i < count; i++) {
|
|
|
+ this.printerList.push({
|
|
|
+ name: this.clodop.GET_PRINTER_NAME(i),
|
|
|
+ value: i,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ clodopPrint(){
|
|
|
+ let {
|
|
|
+ number, // 收货任务号
|
|
|
+ warehouse, // 仓库
|
|
|
+ for_single_member, // 投单员
|
|
|
+ driver_name, // 司机姓名
|
|
|
+ driver_phone, // 司机电话
|
|
|
+ plate_number, // 车号牌
|
|
|
+ driving_license_no, // 驾驶证号
|
|
|
+ provide_list, // 是否提供清单
|
|
|
+ receiving_type, // 收货类型
|
|
|
+ owner, // 货主
|
|
|
+ appointment_number, // 预约号
|
|
|
+ } = this.receiving_task_print;
|
|
|
+ this.clodop.PRINT_INITA(2,0,0,0,"");
|
|
|
+ this.clodop.SET_PRINT_PAGESIZE(2,'76mm','130mm');
|
|
|
+ this.clodop.ADD_PRINT_BARCODE(20,70,350,50,"Code39",number);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(100,15,100,20,"收货任务号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,15,100,20,"仓库");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,15,100,20,"司机姓名");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,15,100,20,"是否提供清单");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,15,100,20,"货主");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,245,100,20,"投单员");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,245,100,20,"司机电话");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,245,100,20,"驾驶证号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,245,100,20,"收货类型");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,245,100,20,"预约号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(100,115,250,20,number); // number
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,115,130,20,warehouse); // warehouse
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,115,100,20,driver_name); //driver_name
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,115,130,20,plate_number); //plate_number
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,115,100,20,provide_list); //provide_list
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,115,130,20,owner); // owner
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,345,100,20,for_single_member); // for_single_member
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,345,140,20,driver_phone); // driver_phone
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,345,140,20,driving_license_no); // driving_license_no
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,345,100,20,receiving_type); // receiving_type
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,345,140,20,appointment_number); //appointment_number
|
|
|
+ this.clodop.PREVIEW();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+ <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
|
|
|
+ <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
|
|
|
+ </object>
|
|
|
+@endsection
|