|
@@ -97,7 +97,8 @@
|
|
|
data () {
|
|
|
let validateSupplier = (rule, value, callback) => {
|
|
|
if (!this.dataForm.supplierId && !this.dataForm.supplierOther) {
|
|
|
- callback(new Error('请至少填写一项供应商信息'))
|
|
|
+ //callback(new Error('请至少填写一项供应商信息'))
|
|
|
+ callback()
|
|
|
} else {
|
|
|
// 任意值被填写,清除验证提示
|
|
|
if (!this.dataForm.supplierId || !this.dataForm.supplierOther) {
|
|
@@ -158,32 +159,41 @@
|
|
|
dataFormSubmit () {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- console.log(1111)
|
|
|
- // // 检查供应商
|
|
|
- // if (!this.dataForm.supplierId && !this.dataForm.supplierOther) {
|
|
|
- // this.$message.error('请填写供应商')
|
|
|
- // return
|
|
|
- // }
|
|
|
+ // 检查供应商
|
|
|
+ let param = {};
|
|
|
+ for(let index=0; index < this.dataForm.list.length; index++){
|
|
|
+ let item = this.dataForm.list[index]
|
|
|
+ if (!item.supplierId && !item.supplierOther) {
|
|
|
+ this.$message.error('请填写供应商')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ item.purComDetailId = item.purchaseDetailId
|
|
|
+
|
|
|
+ param[index] = item
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("param", param)
|
|
|
|
|
|
- // this.$http({
|
|
|
- // url: this.$http.adornUrl(`/biz-service/purchaseDetail/updatePurchaseDetail`),
|
|
|
- // method: 'post',
|
|
|
- // data: this.$http.adornData({...this.dataForm})
|
|
|
- // }).then(({data}) => {
|
|
|
- // if (data && data.code === '200') {
|
|
|
- // this.$message({
|
|
|
- // message: '操作成功',
|
|
|
- // type: 'success',
|
|
|
- // duration: 1500,
|
|
|
- // onClose: () => {
|
|
|
- // this.onChose()
|
|
|
- // this.$emit('refreshDataList')
|
|
|
- // }
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // this.$message.error(data.msg)
|
|
|
- // }
|
|
|
- // })
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/purchaseDetail/batch/updatePurchaseDetail`),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData(param)
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.onChose()
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|