|
@@ -16,23 +16,23 @@
|
|
|
<el-button v-if="selected.length <= 0" type="primary" :disabled="true">未选择</el-button>
|
|
|
<el-button v-else type="primary" @click="toExport">发车</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" class="card" v-for="(item, index) in 8" :key="index">
|
|
|
+ <el-col :span="12" class="card" v-for="(item, index) in list" :key="index">
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<el-row :gutter="10">
|
|
|
- <el-col class="card-header1" :span="24">订单号:1111111111111111111111111111111111</el-col>
|
|
|
- <el-col class="card-header1" :span="24">客户:xxxxxxxxxxxxxxxxxx</el-col>
|
|
|
- <el-col class="card-header1" :span="24">线路:xxxxxxxxxxxxxxxxxx</el-col>
|
|
|
+ <el-col class="card-header1" :span="24">订单号:{{ item.order_no }}</el-col>
|
|
|
+ <el-col class="card-header1" :span="24">客户:{{ getclient(item.client) }}</el-col>
|
|
|
+ <el-col class="card-header1" :span="24">线路:{{ getroute(item.route) }}</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <data-table height="200px" :fields="fields" :data="list[0].goods" :usePage="false" :opera="opera" @handleSelect="toSelect" :select="true">
|
|
|
+ <data-table height="200px" :fields="fields" :data="item.goods" :usePage="false" :opera="opera" @handleSelect="toSelect" :select="true">
|
|
|
</data-table>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-col :span="24" class="detail" v-else>
|
|
|
<el-col :span="24" class="top">
|
|
|
- <el-button size="mini" type="primary" @click="$router.go(-1)">返回</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="back()">返回</el-button>
|
|
|
<span>填写装车单</span>
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="form">
|
|
@@ -90,6 +90,10 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: order } = createNamespacedHelpers('order');
|
|
|
+const { mapActions: client } = createNamespacedHelpers('client');
|
|
|
+const { mapActions: route } = createNamespacedHelpers('route');
|
|
|
+
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -99,7 +103,13 @@ export default {
|
|
|
components: {},
|
|
|
data: function() {
|
|
|
return {
|
|
|
+ // 显示
|
|
|
dialog: false,
|
|
|
+ // 客户列表
|
|
|
+ clientList: [],
|
|
|
+ // 线路列表
|
|
|
+ routeList: [],
|
|
|
+ // 订单列表
|
|
|
fields: [
|
|
|
{ label: '货物', model: 'name' },
|
|
|
{ label: '数量', model: 'number' },
|
|
@@ -107,26 +117,9 @@ export default {
|
|
|
{ label: '体积', model: 'volume' },
|
|
|
{ label: '备注', model: 'remark' },
|
|
|
],
|
|
|
- list: [
|
|
|
- {
|
|
|
- order_no: '111111',
|
|
|
- client: '张三',
|
|
|
- goods: [
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- { name: '天窗', number: 20, weight: 10, volume: 5, remark: '11' },
|
|
|
- ],
|
|
|
- rq_send_time: '2020-9-19',
|
|
|
- },
|
|
|
- ],
|
|
|
- opera: [{ label: '拆分', method: 'splice' }],
|
|
|
+ list: [],
|
|
|
total: 0,
|
|
|
+ opera: [],
|
|
|
selected: [],
|
|
|
form: {
|
|
|
number: 123566,
|
|
@@ -162,8 +155,34 @@ export default {
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ ...order(['query', 'create', 'update', 'delete', 'fetch']),
|
|
|
+ ...client({ clientQuery: 'query' }),
|
|
|
+ ...route({ routeQuery: 'query' }),
|
|
|
+ async search({ skip = 0, limit = 8, ...info } = {}) {
|
|
|
+ //查订单
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ const { data, total } = res;
|
|
|
+ this.$set(this, `list`, data);
|
|
|
+ this.$set(this, `total`, total);
|
|
|
+ }
|
|
|
+ //查客户列表
|
|
|
+ res = await this.clientQuery({ type: '客户' });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ const { data, total } = res;
|
|
|
+ this.$set(this, `clientList`, data);
|
|
|
+ }
|
|
|
+ // 查询线路列表
|
|
|
+ res = await this.routeQuery();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ const { data, total } = res;
|
|
|
+ this.$set(this, `routeList`, data);
|
|
|
+ }
|
|
|
+ },
|
|
|
toSelect(data) {
|
|
|
// console.log(data);
|
|
|
this.selected = data;
|
|
@@ -177,6 +196,21 @@ export default {
|
|
|
create(data, detailList) {
|
|
|
console.log(data, detailList);
|
|
|
},
|
|
|
+ // 查询客户
|
|
|
+ getclient(value) {
|
|
|
+ const res = this.clientList.find(i => i.id === value);
|
|
|
+ if (res) return res.name;
|
|
|
+ },
|
|
|
+ // 查询线路
|
|
|
+ getroute(value) {
|
|
|
+ const res = this.routeList.find(i => i.id === value);
|
|
|
+ if (res) return res.name;
|
|
|
+ },
|
|
|
+ // 返回列表
|
|
|
+ back() {
|
|
|
+ this.selected = [];
|
|
|
+ this.dialog = false;
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|