|
@@ -0,0 +1,191 @@
|
|
|
+<template>
|
|
|
+ <vxe-modal v-model="value" id="purchaseModel" @show="show" width="70%" height="80%" min-width="460" min-height="320"
|
|
|
+ show-zoom resize transfer show-footer @hide="hide" v-loading="load">
|
|
|
+ <template #title>
|
|
|
+ <span>选择商品</span>
|
|
|
+ </template>
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
+ <el-collapse-item title="基本信息" name="1" class="add-order-item">
|
|
|
+ <by-form :propConfig="baseConfig" ref="baseform">
|
|
|
+ <template v-slot:organizationName='{ value }'>
|
|
|
+ <el-input placeholder="请选择供应商" v-model="value.organizationName" class="input-organizationName" size="mini" clearable>
|
|
|
+ <el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </by-form>
|
|
|
+ </el-collapse-item>
|
|
|
+
|
|
|
+ <el-collapse-item title="商品信息" name="2" class="add-order-item">
|
|
|
+ <by-table :propConfig="tableConfig" ref="table"></by-table>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ <supplier-modal ref="supplierModal" @confirm="confirm" />
|
|
|
+ </vxe-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
+import { addOrder,saveBaseOrder } from '@/api/omsOrder'
|
|
|
+import { add,multiply,subtract,divide } from '@/benyun/utils/accuracy'
|
|
|
+import SupplierModal from "@/components/supplierModal/supplierModal.vue";
|
|
|
+@Component({components:{SupplierModal}})
|
|
|
+export default class PurchaseModel extends Vue {
|
|
|
+ value=false;
|
|
|
+ load = false;
|
|
|
+ activeNames:Array<any>=['1','2']
|
|
|
+ baseConfig:any={
|
|
|
+ attr:{
|
|
|
+ size:'mini',
|
|
|
+ rules:{
|
|
|
+ organizationName:[{
|
|
|
+ required: true, message: '供应商不能为空!', trigger: 'blur'
|
|
|
+ }],
|
|
|
+ deliveryAddress:[{
|
|
|
+ required: true, message: '交货地点不能为空!', trigger: 'blur'
|
|
|
+ }],
|
|
|
+ deliveryData:[{
|
|
|
+ required: true, message: '交货时间不能为空!', trigger: 'blur'
|
|
|
+ }],
|
|
|
+ delivery:[{
|
|
|
+ required: true, message: '交货人不能为空!', trigger: 'blur'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ columns:[
|
|
|
+ [{
|
|
|
+ span:6,
|
|
|
+ label:'供应商',
|
|
|
+ prop:'organizationName',
|
|
|
+ slot:true
|
|
|
+ },{
|
|
|
+ span:6,
|
|
|
+ label:'交货地点',
|
|
|
+ prop:'deliveryAddress',
|
|
|
+ component:'by-input',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ placeholder:'请输入交货地点',
|
|
|
+ clearable:true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ span:6,
|
|
|
+ label:'交货时间',
|
|
|
+ prop:'deliveryData',
|
|
|
+ component:'by-date-picker',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ placeholder:'交货时间',
|
|
|
+ type:'datetime',
|
|
|
+ clearable:true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ span:6,
|
|
|
+ label:'交货人',
|
|
|
+ prop:'delivery',
|
|
|
+ component:'by-input',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ placeholder:'请输入交货人',
|
|
|
+ clearable:true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ [{
|
|
|
+ span:6,
|
|
|
+ label:'交货人手机',
|
|
|
+ prop:'deliveryPhone',
|
|
|
+ component:'by-input',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ placeholder:'请输入交货人',
|
|
|
+ clearable:true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ span:6,
|
|
|
+ label:'交货方式',
|
|
|
+ prop:'deliveryWay',
|
|
|
+ component:'by-input',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ placeholder:'请输入交货方式',
|
|
|
+ clearable:true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ span:6,
|
|
|
+ label:'物流分类',
|
|
|
+ prop:'logisticClass',
|
|
|
+ component:'by-input',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ placeholder:'请输入物流分类',
|
|
|
+ clearable:true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ ]
|
|
|
+ }
|
|
|
+
|
|
|
+ tableConfig:any={
|
|
|
+ attr:{
|
|
|
+ size:'small',
|
|
|
+ align:'center'
|
|
|
+ },
|
|
|
+ columns:[{
|
|
|
+ title:'商品',
|
|
|
+ field:'name',
|
|
|
+ width:100,
|
|
|
+ slot:true
|
|
|
+ },{
|
|
|
+ title:'数量',
|
|
|
+ field:'qty',
|
|
|
+ width:100,
|
|
|
+ components:'by-input',
|
|
|
+ compConfig:{
|
|
|
+ attr:{
|
|
|
+ type:'number'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ title:'可采购数量',
|
|
|
+ field:'num'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+
|
|
|
+ show(){}
|
|
|
+ hide(){}
|
|
|
+
|
|
|
+ setShow(v:boolean){
|
|
|
+ this.value = v;
|
|
|
+ }
|
|
|
+
|
|
|
+ handleSupplier(){
|
|
|
+ (this.$refs.supplierModal as any).setShow(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ confirm(data:Array<any>){
|
|
|
+ if(data.length == 0){
|
|
|
+ this.$message('请选择供应商!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let value:any = (this.$refs.baseform as any).getValue();
|
|
|
+ value.organizationName = data[0].name;
|
|
|
+ value.organizationId = data[0].id;
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+</style>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.input-organizationName{
|
|
|
+ .el-input-group__append{
|
|
|
+ background-color: #fff !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|