|
@@ -35,7 +35,7 @@
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<a-form-model-item label="客户" prop="customer">
|
|
|
- <a-input placeholder="请输入客户" v-model="addShipDet.customer"></a-input>
|
|
|
+ <a-input placeholder="请输入客户" v-model="addShipDet.customer" readOnly></a-input>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
|
|
@@ -63,7 +63,7 @@
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<a-form-model-item label="订单类型" prop="orderType">
|
|
|
- <a-input placeholder="请输入订单类型" v-model="addShipDet.orderType"></a-input>
|
|
|
+ <a-input placeholder="请输入订单类型" v-model="addShipDet.orderType" readOnly></a-input>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
|
|
@@ -80,11 +80,11 @@
|
|
|
</a-col> -->
|
|
|
|
|
|
<!-- U8系统适用 -->
|
|
|
- <a-col :md="12" :sm="12">
|
|
|
+ <!-- <a-col :md="12" :sm="12">
|
|
|
<a-form-model-item label="备注" prop="memo">
|
|
|
<a-input placeholder="U8系统适用" v-model="addShipDet.memo"></a-input>
|
|
|
</a-form-model-item>
|
|
|
- </a-col>
|
|
|
+ </a-col> -->
|
|
|
</a-row>
|
|
|
</a-form-model>
|
|
|
</div>
|
|
@@ -112,10 +112,16 @@
|
|
|
size="small"
|
|
|
>
|
|
|
<!-- 款号 输入框 :rules="rules.itemNumber" -->
|
|
|
- <template slot="itemNumber" slot-scope="text, record, index">
|
|
|
+ <!-- <template slot="itemNumber" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="itemNumber">
|
|
|
<a-input style="width:100%" type="text" v-model="record.itemNumber" readOnly />
|
|
|
</a-form-model-item>
|
|
|
+ </template> -->
|
|
|
+ <!-- 成衣工厂 :rules="rules.garmentFactory"-->
|
|
|
+ <template slot="garmentFactory" slot-scope="text, record, index">
|
|
|
+ <a-form-model-item prop="garmentFactory">
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.garmentFactory"/>
|
|
|
+ </a-form-model-item>
|
|
|
</template>
|
|
|
|
|
|
<!-- 发货数量 :rules="rules.shipQuantity"-->
|
|
@@ -147,14 +153,26 @@
|
|
|
<!-- 采购/委外订单号 :rules="rules.purOrSubOrder"-->
|
|
|
<template slot="purOrSubOrder" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="purOrSubOrder">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.purOrSubOrder" readOnly/>
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.purOrSubOrder" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </template>
|
|
|
+ <!-- 单价(销售) :rules="rules.salesUnitPrice"-->
|
|
|
+ <template slot="salesUnitPrice" slot-scope="text, record, index">
|
|
|
+ <a-form-model-item prop="salesUnitPrice">
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.salesUnitPrice"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </template>
|
|
|
+ <!-- 佣金 :rules="rules.ymoney"-->
|
|
|
+ <template slot="ymoney" slot-scope="text, record, index">
|
|
|
+ <a-form-model-item prop="ymoney">
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.ymoney" />
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
|
|
|
<!-- 报关单价 :rules="rules.customsDeclarationUnitPrice"-->
|
|
|
<template slot="customsDeclarationUnitPrice" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="customsDeclarationUnitPrice">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.customsDeclarationUnitPrice" readOnly/>
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.customsDeclarationUnitPrice" />
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<!-- 套装件数 :rules="rules.numberOfSets"-->
|
|
@@ -264,7 +282,7 @@ export default {
|
|
|
id: '',
|
|
|
validatorRules:{
|
|
|
documentDate:[{required: true, message: '请输入单据日期!'}],
|
|
|
- // customer:[{required: true, message: '请选择客户!'}],
|
|
|
+ customer:[{required: true, message: '请输入客户!', trigger: 'change'}],
|
|
|
// preDeliveryDate:[{required: true, message: '请选择预发货时间!'}],
|
|
|
// preCompletionDate:[{required: true, message: '请选择预完工日期!'}],
|
|
|
// orderType:[{required: true, message: '请输入订单类型!'}],
|
|
@@ -309,16 +327,17 @@ export default {
|
|
|
className: 'replacecolor',
|
|
|
|
|
|
},
|
|
|
- {
|
|
|
- title: '预完工日期',
|
|
|
- dataIndex: 'preCompletionDate',
|
|
|
- width: 100,
|
|
|
- className: 'replacecolor',
|
|
|
+ // {
|
|
|
+ // title: '预完工日期',
|
|
|
+ // dataIndex: 'preCompletionDate',
|
|
|
+ // width: 100,
|
|
|
+ // className: 'replacecolor',
|
|
|
|
|
|
- },
|
|
|
+ // },
|
|
|
{
|
|
|
title: '成衣工厂',
|
|
|
dataIndex: 'garmentFactory',
|
|
|
+ scopedSlots: { customRender: 'garmentFactory' },
|
|
|
width: 100,
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
@@ -328,13 +347,13 @@ export default {
|
|
|
width: 120,
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
- {
|
|
|
- title: '客户订单',
|
|
|
- dataIndex: 'customerOrder',
|
|
|
- width: 120,
|
|
|
+ // {
|
|
|
+ // title: '客户订单',
|
|
|
+ // dataIndex: 'customerOrder',
|
|
|
+ // width: 120,
|
|
|
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
+ // className: 'replacecolor'
|
|
|
+ // },
|
|
|
{
|
|
|
title: '小po',
|
|
|
dataIndex: 'smallPo',
|
|
@@ -361,14 +380,36 @@ export default {
|
|
|
width: 180,
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '单价(销售)',
|
|
|
+ // scopedSlots: { customRender: 'salesUnitPrice' },
|
|
|
+ dataIndex: 'salesUnitPrice',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '佣金',
|
|
|
+ // scopedSlots: { customRender: 'ymoney' },
|
|
|
+ dataIndex: 'ymoney',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
title: ' 报关单价',
|
|
|
dataIndex: 'customsDeclarationUnitPrice',
|
|
|
- scopedSlots: { customRender: 'customsDeclarationUnitPrice' },
|
|
|
+ // scopedSlots: { customRender: 'customsDeclarationUnitPrice' },
|
|
|
// fixed: 'left',
|
|
|
width: 180,
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '工厂单价',
|
|
|
+ dataIndex: 'factoryUnitPrice',
|
|
|
+ width: 120,
|
|
|
+ // scopedSlots: { customRender: 'factoryUnitPrice' },
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
|
|
|
{
|
|
|
title: '订单数量',
|
|
@@ -407,17 +448,17 @@ export default {
|
|
|
{
|
|
|
title: '物料成分',
|
|
|
dataIndex: 'materialComposition',
|
|
|
- scopedSlots: { customRender: 'materialComposition' },
|
|
|
+ // scopedSlots: { customRender: 'materialComposition' },
|
|
|
width: 140,
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
|
|
|
- {
|
|
|
- title: '销售类型',
|
|
|
- dataIndex: 'salesTypeText',
|
|
|
- width: 120,
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: '销售类型',
|
|
|
+ // dataIndex: 'salesTypeText',
|
|
|
+ // width: 120,
|
|
|
+ // className: 'replacecolor'
|
|
|
+ // },
|
|
|
{
|
|
|
title: '客户简称',
|
|
|
dataIndex: 'customerAbbreviation',
|
|
@@ -490,33 +531,16 @@ export default {
|
|
|
width: 120,
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
- {
|
|
|
- title: '佣金',
|
|
|
- dataIndex: 'ymoney',
|
|
|
- width: 120,
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- title: '单价(销售)',
|
|
|
- dataIndex: 'salesUnitPrice',
|
|
|
- width: 120,
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '工厂单价',
|
|
|
- dataIndex: 'factoryUnitPrice',
|
|
|
- width: 120,
|
|
|
- scopedSlots: { customRender: 'factoryUnitPrice' },
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '付款条件',
|
|
|
- dataIndex: 'termOfPayment',
|
|
|
- width: 160,
|
|
|
- customRender: t => ellipsis(t),
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // {
|
|
|
+ // title: '付款条件',
|
|
|
+ // dataIndex: 'termOfPayment',
|
|
|
+ // width: 160,
|
|
|
+ // customRender: t => ellipsis(t),
|
|
|
+ // className: 'replacecolor'
|
|
|
+ // },
|
|
|
{
|
|
|
title: '最终客户',
|
|
|
dataIndex: 'endCustomer',
|
|
@@ -530,20 +554,20 @@ export default {
|
|
|
customRender: t => ellipsis(t),
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
- {
|
|
|
- title: '价格备注',
|
|
|
- dataIndex: 'priceRemarks',
|
|
|
- width: 160,
|
|
|
- customRender: t => ellipsis(t),
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '订单变更说明',
|
|
|
- dataIndex: 'orderChangeDescription',
|
|
|
- width: 160,
|
|
|
- customRender: t => ellipsis(t),
|
|
|
- className: 'replacecolor'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: '价格备注',
|
|
|
+ // dataIndex: 'priceRemarks',
|
|
|
+ // width: 160,
|
|
|
+ // customRender: t => ellipsis(t),
|
|
|
+ // className: 'replacecolor'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title: '订单变更说明',
|
|
|
+ // dataIndex: 'orderChangeDescription',
|
|
|
+ // width: 160,
|
|
|
+ // customRender: t => ellipsis(t),
|
|
|
+ // className: 'replacecolor'
|
|
|
+ // },
|
|
|
|
|
|
{
|
|
|
title: '处理方式',
|
|
@@ -587,7 +611,9 @@ export default {
|
|
|
syShippingDetailsItemList: [], // 子表数据
|
|
|
msgFormSon: 'test', // 子组件传来数据的变量
|
|
|
manualYarnDisabled: false, //手工纱单价和手工纱占比可输入
|
|
|
- addShipDet: {}, // 主表信息
|
|
|
+ addShipDet: {
|
|
|
+ documentDate:moment(new Date()).format('YYYY-MM-DD'),
|
|
|
+ }, // 主表信息
|
|
|
visible: false,
|
|
|
confirmLoading: false,
|
|
|
dateFormat: 'YYYY-MM-DD',
|
|
@@ -606,34 +632,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ moment,
|
|
|
//默认预发货日期
|
|
|
defalutDate(){
|
|
|
- Date.prototype.format = function(fmt) {
|
|
|
- var o = {
|
|
|
- "M+" : this.getMonth()+1, //月份
|
|
|
- "Y+" : this.getFullYear(), //年
|
|
|
- "d+" : this.getDate(), //日
|
|
|
- "h+" : this.getHours(), //小时
|
|
|
- "m+" : this.getMinutes(), //分
|
|
|
- "s+" : this.getSeconds(), //秒
|
|
|
- "q+" : Math.floor((this.getMonth()+3)/3), //季度
|
|
|
- "S" : this.getMilliseconds() //毫秒
|
|
|
- };
|
|
|
- if(/(Y+)/.test(fmt)) {
|
|
|
- fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
|
|
|
- }
|
|
|
- for(var k in o) {
|
|
|
- if(new RegExp("("+ k +")").test(fmt)){
|
|
|
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
|
|
|
- }
|
|
|
- }
|
|
|
- return fmt;
|
|
|
- }
|
|
|
- var now = new Date(); //当前日期
|
|
|
- var nowMonth = now.getMonth(); //当前月
|
|
|
- var nowYear = now.getFullYear(); //当前年
|
|
|
- //本月的开始时间
|
|
|
- this.monthStartDate = new Date(nowYear, nowMonth, 1).format('YYYY-MM-dd');
|
|
|
+ var now = new Date(); //当前日期
|
|
|
+ var nowMonth = now.getMonth(); //当前月
|
|
|
+ var nowYear = now.getFullYear(); //当前年
|
|
|
+ this.monthStartDate = moment(new Date(nowYear, nowMonth, 1)).format('YYYY-MM-DD');
|
|
|
},
|
|
|
|
|
|
//参照数据重置,恢复默认值
|
|
@@ -646,7 +651,8 @@ export default {
|
|
|
getSon(val) {
|
|
|
this.manualYarnDisabled = false //初始化manualYarnDisabled
|
|
|
var copyValList = JSON.parse(JSON.stringify(val));
|
|
|
- this.addShipDet.customer = copyValList[0].customerName;
|
|
|
+ this.$set( this.addShipDet,'customer',copyValList[0].customerName)
|
|
|
+ // this.addShipDet.customer = copyValList[0].customerName;
|
|
|
console.log(copyValList);
|
|
|
for (var i in copyValList) {
|
|
|
copyValList[i]['orderQuantity'] = copyValList[i].quantity
|
|
@@ -664,16 +670,17 @@ export default {
|
|
|
item.manualYarnUnitPrice = null
|
|
|
item.manualYarnProportion = null
|
|
|
})
|
|
|
- this.$forceUpdate()
|
|
|
+ this.$forceUpdate()
|
|
|
},
|
|
|
// 参照订单数据
|
|
|
referOrderDataOpen() {
|
|
|
+ console.log(this.addShipDet.documentDate)
|
|
|
this.$refs.referOrderDataModal.range = []
|
|
|
if(this.syShippingDetailsItemList.length !== 0){
|
|
|
this.$refs.referOrderDataModal.fatherData.push(this.syShippingDetailsItemList[0])
|
|
|
}
|
|
|
this.$refs.referOrderDataModal.referOrderDataModVis = true
|
|
|
- this.defalutDate()
|
|
|
+ this.defalutDate()
|
|
|
this.$refs.referOrderDataModal.range.push(this.monthStartDate)
|
|
|
this.$refs.referOrderDataModal.queryParam.preDeliveryDateS = this.monthStartDate;
|
|
|
this.$refs.referOrderDataModal.queryParam.preDeliveryDateE = '';
|
|
@@ -683,12 +690,13 @@ export default {
|
|
|
// 新增 保存
|
|
|
addSave() {
|
|
|
const that = this;
|
|
|
+ console.log(this.addShipDet)
|
|
|
// 触发表单验证
|
|
|
this.$refs.form.validate(valid => {
|
|
|
if (valid) {
|
|
|
var newObj = {} // 新增对象
|
|
|
newObj.documentNo = this.addShipDet.documentNo
|
|
|
- newObj.documentDate = this.addShipDet.documentDate.format('YYYY-MM-DD')
|
|
|
+ newObj.documentDate = this.addShipDet.documentDate
|
|
|
newObj.customer = this.addShipDet.customer
|
|
|
//newObj.preDeliveryDate = this.addShipDet.preDeliveryDate.format('YYYY-MM-DD') // 预发货日期
|
|
|
//newObj.preCompletionDate = this.addShipDet.preCompletionDate.format('YYYY-MM-DD') // 预完工日期
|
|
@@ -801,16 +809,36 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //判断当是手册纱时,手册纱单价和手册纱占比是否为空
|
|
|
+ //必填项
|
|
|
for (var i=0; i<newObj.syShippingDetailsItemList.length; i++){
|
|
|
var rowData = newObj.syShippingDetailsItemList[i];
|
|
|
- if((rowData.manualYarnFlag === 1 && !rowData.manualYarnUnitPrice) || (rowData.manualYarnFlag === 1 && rowData.manualYarnUnitPrice === '')|| (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === "0") || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === 0) ){
|
|
|
- this.$message.error('手册纱单价为必填项');
|
|
|
- return
|
|
|
- }else if((rowData.manualYarnFlag === 1 && !rowData.manualYarnProportion) || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === '') || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === "0") || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === 0)){
|
|
|
- this.$message.error('手册纱占比为必填项');
|
|
|
- return
|
|
|
+ if(rowData.purOrSubOrder == '' || !rowData.purOrSubOrder){
|
|
|
+ this.$message.error('第'+(i+1)+'行采购委外订单号未填!');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(rowData.garmentFactory == '' || !rowData.garmentFactory){
|
|
|
+ this.$message.error('第'+(i+1)+'行成衣工厂未填!');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(rowData.shipmentQuantity == '' || !rowData.shipmentQuantity || rowData.shipmentQuantity == 0){
|
|
|
+ this.$message.error('第'+(i+1)+'行发货数量未填!');
|
|
|
+ return
|
|
|
}
|
|
|
+ if(rowData.numberOfSets == '' || !rowData.numberOfSets || rowData.numberOfSets == 0){
|
|
|
+ this.$message.error('第'+(i+1)+'行套装件数未填!');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!rowData.hasOwnProperty("isTc") || rowData.isTc == ""){
|
|
|
+ this.$message.error('第'+(i+1)+'行是否TC功能未选择!');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // if((rowData.manualYarnFlag === 1 && !rowData.manualYarnUnitPrice) || (rowData.manualYarnFlag === 1 && rowData.manualYarnUnitPrice === '')|| (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === "0") || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === 0) ){
|
|
|
+ // this.$message.error('手册纱单价为必填项');
|
|
|
+ // return
|
|
|
+ // }else if((rowData.manualYarnFlag === 1 && !rowData.manualYarnProportion) || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === '') || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === "0") || (rowData.manualYarnFlag === 1 && rowData.manualYarnProportion === 0)){
|
|
|
+ // this.$message.error('手册纱占比为必填项');
|
|
|
+ // return
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
addShipmentList(newObj).then(res => {
|
|
@@ -818,8 +846,8 @@ export default {
|
|
|
this.$message.success('新增成功');
|
|
|
this.close();
|
|
|
// 清空信息
|
|
|
- this.addShipDet = {};
|
|
|
- this.addShipDet.syShippingDetailsItemList = [];
|
|
|
+ // this.addShipDet = {};
|
|
|
+ // this.addShipDet.syShippingDetailsItemList = [];
|
|
|
// this.fatherList(); // 调用父组件 查询方法
|
|
|
// this.msgFormSon = {} 清空子表信息
|
|
|
}else{
|
|
@@ -899,7 +927,9 @@ export default {
|
|
|
close() {
|
|
|
this.$emit('close');
|
|
|
this.visible = false;
|
|
|
- this.addShipDet = {};
|
|
|
+ this.addShipDet = {
|
|
|
+ documentDate:moment(new Date()).format('YYYY-MM-DD')
|
|
|
+ };
|
|
|
this.syShippingDetailsItemList = [];
|
|
|
},
|
|
|
|