|
@@ -5,7 +5,7 @@
|
|
|
<!-- 主表信息 编辑 :rules="validatorRules"-->
|
|
|
<a-card :bordered="true">
|
|
|
<div class="table-page-search-wrapper">
|
|
|
- <a-form-model layout="inline" ref="form" :model="editShipDet">
|
|
|
+ <a-form-model layout="inline" ref="form" :model="editShipDet" :rules="validatorRules">
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<!-- required必填项 disabled 禁用 -->
|
|
@@ -31,27 +31,6 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="预发货日期" prop="preDeliveryDate">
|
|
|
- <a-date-picker
|
|
|
- placeholder="请选择预发货时间"
|
|
|
- :format="dateFormat"
|
|
|
- style="width:100%;"
|
|
|
- v-model="editShipDet.preDeliveryDate"
|
|
|
- />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
-
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="预完工日期" prop="preCompletionDate">
|
|
|
- <a-date-picker
|
|
|
- placeholder="请选择预完工日期"
|
|
|
- :format="dateFormat"
|
|
|
- style="width:100%;"
|
|
|
- v-model="editShipDet.preCompletionDate"
|
|
|
- />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<a-form-model-item label="订单类型" prop="orderType">
|
|
@@ -59,43 +38,8 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="HScode" prop="hsCode">
|
|
|
- <a-input placeholder="HScode" v-model="editShipDet.hsCode"></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="中文品名" prop="chineseName">
|
|
|
- <a-input placeholder="请输入中文品名" v-model="editShipDet.chineseName"></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
-
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="英文品名" prop="englishProductName">
|
|
|
- <a-input placeholder="请输入英文品名" v-model="editShipDet.englishProductName"></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
-
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="报关品名" prop="declarationName">
|
|
|
- <a-input placeholder="请输入报关品名" v-model="editShipDet.declarationName"></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
-
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="成衣工厂" prop="garmentFactory">
|
|
|
- <a-input placeholder="请输入成衣工厂" v-model="editShipDet.garmentFactory"></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
-
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-model-item label="整单合计" prop="wholeOrderTotal">
|
|
|
- <a-input placeholder="请输入整单合计" v-model="editShipDet.wholeOrderTotal"></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
-
|
|
|
- <a-col :md="18" :sm="18">
|
|
|
+ <a-col :md="12" :sm="12">
|
|
|
<a-form-model-item label="备注" prop="memo">
|
|
|
<a-input placeholder="请输入备注" v-model="editShipDet.memo"></a-input>
|
|
|
</a-form-model-item>
|
|
@@ -282,6 +226,13 @@ export default {
|
|
|
let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
|
|
|
return {
|
|
|
id: '',
|
|
|
+ validatorRules:{
|
|
|
+ documentDate:[{required: true, message: '请输入单据日期!'}],
|
|
|
+ // customer:[{required: true, message: '请选择客户!'}],
|
|
|
+ // preDeliveryDate:[{required: true, message: '请选择预发货时间!'}],
|
|
|
+ // preCompletionDate:[{required: true, message: '请选择预完工日期!'}],
|
|
|
+ // orderType:[{required: true, message: '请输入订单类型!'}],
|
|
|
+ },
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{
|
|
@@ -625,16 +576,35 @@ export default {
|
|
|
},
|
|
|
// 编辑 保存
|
|
|
editSave() {
|
|
|
- // console.log('提交编辑、刷新发运明细列表')
|
|
|
- editById(this.editShipDet).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.$message.success('编辑成功');
|
|
|
- this.addShipDet = {};
|
|
|
- this.addShipDet.syShippingDetailsItemList = [];
|
|
|
- this.close();
|
|
|
- this.fatherList(); // 调用父组件的查询方法
|
|
|
+ const that = this;
|
|
|
+ // 触发表单验证
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ // 必须选择子表 --- 参照订单数据
|
|
|
+ if (this.editShipDet.syShippingDetailsItemList.length == 0) {
|
|
|
+ this.$message.error('请选择参照订单数据')
|
|
|
+ } else {
|
|
|
+ for (var i=0; i<this.editShipDet.syShippingDetailsItemList.length; i++){
|
|
|
+ var rowData = this.editShipDet.syShippingDetailsItemList[i];
|
|
|
+ if (rowData.shipmentQuantity > rowData.orderRemainingQuantity){
|
|
|
+ this.$message.error('第'+(i+1)+'行超发货数量超过订单剩余数量,无法保存');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ editById(this.editShipDet).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('编辑成功');
|
|
|
+ this.addShipDet = {};
|
|
|
+ this.addShipDet.syShippingDetailsItemList = [];
|
|
|
+ this.close();
|
|
|
+ this.fatherList(); // 调用父组件的查询方法
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
+ }else{
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
// 参照订单数据
|
|
|
referOrderDataOpen() {
|
|
@@ -688,12 +658,14 @@ export default {
|
|
|
return this.syShippingDetailsItemList.splice(index, 1)
|
|
|
},
|
|
|
// 操作 复制
|
|
|
- copy(record) {},
|
|
|
+ copy(record) {
|
|
|
+ var newRecord = JSON.parse(JSON.stringify(record));
|
|
|
+ this.syShippingDetailsItemList.push(newRecord)
|
|
|
+ },
|
|
|
|
|
|
// --------------------------------------
|
|
|
// 抽屉 取消
|
|
|
handleCancel() {
|
|
|
- console.log('点击抽屉取消')
|
|
|
this.close()
|
|
|
},
|
|
|
|