Authored by htoooth

fix

... ... @@ -16,6 +16,10 @@
value: {
type: [Number, String],
default: 0
},
selectWhenOnlyOne: {
type: Boolean,
default: false
}
},
created() {
... ... @@ -23,6 +27,12 @@
this.brandService.getBrand().then((res) => {
this.optionList = res.data;
if (this.selectWhenOnlyOne) {
if (this.optionList.length === 1) {
this.brandId = this.optionList[0].brandId;
}
}
});
},
data() {
... ...
... ... @@ -2,23 +2,23 @@
<layout-body>
<layout-filter>
<filter-item :label="filters.id.label">
<Input v-model.trim="filters.id.model" :number="true"
:placeholder="filters.id.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.id.model"
:placeholder="filters.id.holder" ></Input>
</filter-item>
<filter-item :label="filters.expressNumber.label">
<Input v-model.trim="filters.expressNumber.model" :number="true"
:placeholder="filters.expressNumber.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.expressNumber.model"
:placeholder="filters.expressNumber.holder" ></Input>
</filter-item>
<filter-item :label="filters.productSkn.label">
<Input v-model.trim="filters.productSkn.model" :number="true"
:placeholder="filters.productSkn.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.productSkn.model"
:placeholder="filters.productSkn.holder"></Input>
</filter-item>
<filter-item :label="filters.skuFactoryCode.label">
<Input v-model.trim="filters.skuFactoryCode.model" :number="true"
:placeholder="filters.skuFactoryCode.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.skuFactoryCode.model"
:placeholder="filters.skuFactoryCode.holder"></Input>
</filter-item>
<filter-item>
... ...
... ... @@ -13,11 +13,12 @@
</Form-item>
<Form-item label="预计到货时间">
<Date-picker v-model="createDate" type="date" placeholder="选择日期"></Date-picker>
<!--<Date-picker v-model="createDate" type="date" placeholder="选择日期"></Date-picker>-->
<date-pick v-model="createDate"></date-pick>
</Form-item>
<Form-item label="品牌">
<select-brand v-model="brandId"></select-brand>
<select-brand v-model="brandId" :selectWhenOnlyOne="true"></select-brand>
</Form-item>
</Form>
</div>
... ... @@ -33,6 +34,8 @@
<script>
import InvoiceService from 'services/repository/invoice-service';
import DatePick from './date-pick';
import moment from 'moment';
export default {
name: 'create-modal',
... ... @@ -49,8 +52,8 @@ export default {
};
},
computed: {
hanldeDate() {
return this.createDate.getTime() / 1000;
handleDate() {
return moment(this.createDate, 'YYYY-MM-DD').unix();
}
},
methods: {
... ... @@ -111,7 +114,7 @@ export default {
}
this.modal_loading = true;
return this.invoiceService.createOrder(this.storageId, this.hanldeDate, this.brandId).then((result) => {
return this.invoiceService.createOrder(this.storageId, this.handleDate, this.brandId).then((result) => {
if (result.code === 200) {
this.$Message.info('创建成功');
} else {
... ... @@ -124,7 +127,11 @@ export default {
emitEvent() {
this.$emit('on-success');
}
},
components: {
DatePick
}
};
</script>
... ...
<template>
<Date-picker
:value="value"
:type="type"
:options="options"
@on-change="updateHandle"
clearable
placeholder="选择日期">
</Date-picker>
</template>
<script>
const DAY_MS = 86400000;
export default {
props: {
value: {
type: Object,
default: null
},
type: {
type: String,
default: 'date'
},
options: {
type: Object,
default() {
return {
disabledDate(date) {
return date && date.valueOf() < Date.now() - DAY_MS;
}
};
}
}
},
methods: {
updateHandle(newValue) {
this.$emit('input', newValue);
}
},
watch: {
value(newValue) {
this.value = newValue;
}
}
};
</script>
... ...
... ... @@ -63,7 +63,7 @@
brandId: this.brandId
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.records.map((i) => {
this.tableData = (res.data.records || []).map((i) => {
i.buyingNums = null;
return i;
});
... ... @@ -77,7 +77,7 @@
brandId: this.brandId
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.goodsList.map((i) => {
this.tableData = (res.data.goodsList || []).map((i) => {
i.editable = false;
return i;
});
... ...
... ... @@ -6,7 +6,7 @@
</filter-item>
<filter-item label="预计到货">
<Date-picker v-model="arrival" type="date" placeholder="选择日期"></Date-picker>
<Date-Pick v-model="arrival"></Date-Pick>
</filter-item>
<filter-item >
... ... @@ -41,7 +41,9 @@
import ProductList from './components/product-list';
import OrderInfo from './components/order-info';
import DatePick from './components/date-pick';
import InvoiceService from 'services/repository/invoice-service';
import moment from 'moment';
export default {
props: ['isEdit'],
... ... @@ -50,7 +52,7 @@
count: 0,
id: '',
storeId: '',
arrivalTime: new Date().getTime() / 1000,
arrivalTime: null,
brandId: '',
info: null
};
... ... @@ -63,10 +65,10 @@
computed: {
arrival: {
get() {
return new Date(this.arrivalTime * 1000);
return moment.unix(this.arrivalTime).format('YYYY-MM-DD');
},
set(newVal) {
this.arrivalTime = newVal.getTime() / 1000;
this.arrivalTime = moment(newVal, 'YYYY-MM-DD').unix();
}
}
},
... ... @@ -101,7 +103,8 @@
},
components: {
ProductList,
OrderInfo
OrderInfo,
DatePick
}
};
</script>
... ...
... ... @@ -73,7 +73,7 @@ let tableCols = function() {
key: 'editTime',
align: 'center',
renderHeader() {
return '发货进度<br/> 已发数/采购数 ';
return '发货进度<br/> 已发数/需发总数 ';
},
render: (h, params) => {
let percent = 0;
... ... @@ -102,7 +102,7 @@ let tableCols = function() {
key: 'editTime',
align: 'center',
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
return '入库进度<br/> 已入库数/需发总数';
},
render: (h, params) => {
let percent = 0;
... ...
... ... @@ -112,7 +112,7 @@ let cols = function() {
if (!params.row.hasAdded) {
return (
<div class="action-btn-row">
<i-button type='warning' size="small" onClick={() => this.create(params)}> 保存 </i-button>
<i-button type='warning' size="small" onClick={() => this.create(params)}> 添加 </i-button>
</div>
);
} else {
... ...