|
|
|
@ -305,37 +305,11 @@ |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-section"> |
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="创建日期"> |
|
|
|
<el-input v-model="currentSupplier.createDate" :disabled="true"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="创建者"> |
|
|
|
<el-input v-model="currentSupplier.createBy" :disabled="true"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="更新日期"> |
|
|
|
<el-input v-model="currentSupplier.updateDate" :disabled="true"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="更新者"> |
|
|
|
<el-input v-model="currentSupplier.updateBy" :disabled="true"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-section"> |
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-col :span="16"> |
|
|
|
<el-col :span="20"> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-input v-model="currentSupplier.memo" type="textarea" :rows="2" resize="none"></el-input> |
|
|
|
<el-input v-model="currentSupplier.memo" type="textarea" :rows="2" resize="none" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -1101,14 +1075,11 @@ export default { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
}, |
|
|
|
supplierRules: { |
|
|
|
site: [ |
|
|
|
{ required: true, message: 'Site is required', trigger: 'blur' } |
|
|
|
], |
|
|
|
supplierNo: [ |
|
|
|
{ required: true, message: 'Supplier No is required', trigger: 'blur' } |
|
|
|
{ required: true, message: ' ', trigger: 'blur' } |
|
|
|
], |
|
|
|
supplierName: [ |
|
|
|
{ required: true, message: 'Supplier Name is required', trigger: 'blur' } |
|
|
|
{ required: true, message: ' ', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1347,7 +1318,7 @@ export default { |
|
|
|
// 编辑供应商 |
|
|
|
editSupplier() { |
|
|
|
if (!this.currentRow) { |
|
|
|
this.$message.warning('Please select a supplier to edit') |
|
|
|
this.$message.warning('请选择一个供应商修改') |
|
|
|
return |
|
|
|
} |
|
|
|
this.isAdd = false |
|
|
|
@ -1362,37 +1333,37 @@ export default { |
|
|
|
|
|
|
|
apiCall.then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success(this.isAdd ? 'Supplier added successfully' : 'Supplier updated successfully') |
|
|
|
this.$message.success(this.isAdd ? '新增供应商成功' : '修改供应商成功') |
|
|
|
this.supplierDialogVisible = false |
|
|
|
this.getMainData() // 重新加载数据 |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || 'Operation failed') |
|
|
|
this.$message.error(data.msg || '操作失败') |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.$message.error('Operation failed: ' + error.message) |
|
|
|
this.$message.error('操作失败: ' + error.message) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message.warning('Please fill in the required fields') |
|
|
|
this.$message.warning('请填写必填字段') |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除供应商 |
|
|
|
deleteSupplier(row) { |
|
|
|
this.$confirm('Are you sure you want to delete this supplier?', 'Confirm Delete', { |
|
|
|
confirmButtonText: 'Confirm', |
|
|
|
cancelButtonText: 'Cancel', |
|
|
|
this.$confirm('你确定删除该供应商?', '确认删除', { |
|
|
|
confirmButtonText: '确认', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteSrmSupplier(row.id).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('Supplier deleted successfully') |
|
|
|
this.$message.success('供应商删除成功') |
|
|
|
this.getMainData() // 重新加载数据 |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || 'Delete failed') |
|
|
|
this.$message.error(data.msg || '删除失败') |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.$message.error('Delete failed: ' + error.message) |
|
|
|
this.$message.error('删除失败: ' + error.message) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
@ -1460,11 +1431,11 @@ export default { |
|
|
|
|
|
|
|
/* 表单分组样式 */ |
|
|
|
.form-section { |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
.form-section:last-child { |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 输入框样式 */ |
|
|
|
|