|
@@ -9,33 +9,43 @@
|
|
<div class="mymain-container">
|
|
<div class="mymain-container">
|
|
<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
|
|
<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
|
|
<el-row :gutter="20" justify="start">
|
|
<el-row :gutter="20" justify="start">
|
|
- <el-col :span="12">
|
|
|
|
|
|
+ <el-col :span="8" v-if="id">
|
|
|
|
+ <el-form-item label="单据状态">
|
|
|
|
+ <el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'OK'?'审核通过':formData.flag == 'OK'?'FAIL':''" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8" v-if="id">
|
|
|
|
+ <el-form-item label="单据编号">
|
|
|
|
+ <el-input type="text" :value="formData.salesId" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
<el-form-item label="所属商户" :required="true" >
|
|
<el-form-item label="所属商户" :required="true" >
|
|
<el-input type="text" :value="companyName" disabled></el-input>
|
|
<el-input type="text" :value="companyName" disabled></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="网点名称" prop="websitId" :required="true">
|
|
<el-form-item label="网点名称" prop="websitId" :required="true">
|
|
- <el-select v-model="formData.websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
|
|
|
|
|
|
+ <el-select v-model="formData.websit" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in websitList"
|
|
v-for="item in websitList"
|
|
:key="item.websitId"
|
|
:key="item.websitId"
|
|
:label="item.name"
|
|
:label="item.name"
|
|
- :value="item.websitId">
|
|
|
|
|
|
+ :value="item">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<el-form-item label="师傅姓名" prop="worker" :required="true">
|
|
<el-form-item label="师傅姓名" prop="worker" :required="true">
|
|
- <el-select v-model="formData.worker" @focus="()=>{
|
|
|
|
|
|
+ <el-select v-model="formData.worker" value-key="nickName" @focus="()=>{
|
|
if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
|
|
if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
|
|
}" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
|
|
}" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in workerList"
|
|
v-for="item in workerList"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
:label="item.nickName"
|
|
:label="item.nickName"
|
|
- :value="item.nickName">
|
|
|
|
|
|
+ :value="item">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -50,14 +60,39 @@
|
|
<el-input type="text" v-model="formData.phone" placeholder="请输入"></el-input>
|
|
<el-input type="text" v-model="formData.phone" placeholder="请输入"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
|
+ <el-form-item label="单据金额">
|
|
|
|
+ <el-input type="text" :value="formData.createBy" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
|
+ <el-form-item label="制单人">
|
|
|
|
+ <el-input type="text" :value="formData.createBy" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
|
+ <el-form-item label="制单时间">
|
|
|
|
+ <el-input type="text" :value="formData.createTime" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
|
+ <el-form-item label="审核人">
|
|
|
|
+ <el-input type="text" :value="formData.confirmBy" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6" v-if="id">
|
|
|
|
+ <el-form-item label="审核时间">
|
|
|
|
+ <el-input type="text" :value="formData.confirmTime" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="订单来源" prop="source" :required="true">
|
|
<el-form-item label="订单来源" prop="source" :required="true">
|
|
<el-select v-model="formData.source" placeholder="请选择" style="width: 100%;">
|
|
<el-select v-model="formData.source" placeholder="请选择" style="width: 100%;">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in [{name: '在线订单',id: 'ONLINE'},{name: '自建订单',id: 'SELF'}]"
|
|
v-for="item in [{name: '在线订单',id: 'ONLINE'},{name: '自建订单',id: 'SELF'}]"
|
|
- :key="item.workerId"
|
|
|
|
|
|
+ :key="item.id"
|
|
:label="item.name"
|
|
:label="item.name"
|
|
- :value="item.workerId">
|
|
|
|
|
|
+ :value="item.id">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -95,7 +130,7 @@
|
|
<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
<el-table-column label="大类名称" align="center">
|
|
<el-table-column label="大类名称" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-select v-model="scope.row.productCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
|
|
|
|
|
|
+ <el-select v-model="scope.row.parentCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in mainList"
|
|
v-for="item in mainList"
|
|
:key="item.categoryId"
|
|
:key="item.categoryId"
|
|
@@ -108,10 +143,10 @@
|
|
<el-table-column label="小类名称" align="center">
|
|
<el-table-column label="小类名称" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
|
|
<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
|
|
- if(!scope.row.productCategory){return this.$message.warning('请先选择大类!');}
|
|
|
|
|
|
+ if(!scope.row.parentCategory){return this.$message.warning('请先选择大类!');}
|
|
}" :disabled="isEdit != scope.$index" value-key="categoryId" placeholder="请选择" style="width: 100%;">
|
|
}" :disabled="isEdit != scope.$index" value-key="categoryId" placeholder="请选择" style="width: 100%;">
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in smallList"
|
|
|
|
|
|
+ v-for="item in scope.row.parentCategory.items"
|
|
:key="item.categoryId"
|
|
:key="item.categoryId"
|
|
:label="item.categoryName"
|
|
:label="item.categoryName"
|
|
:value="item">
|
|
:value="item">
|
|
@@ -121,27 +156,27 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="辅材名称" align="center">
|
|
<el-table-column label="辅材名称" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-select v-model="scope.row.goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
|
|
|
|
|
|
+ <el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in materialsList"
|
|
|
|
- :key="item.id"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.id">
|
|
|
|
|
|
+ v-for="item in scope.row.goodsList"
|
|
|
|
+ :key="item.goodsId"
|
|
|
|
+ :label="item.goodsName"
|
|
|
|
+ :value="item">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="goodsSalesUnit" align="center" label="单位" ></el-table-column>
|
|
|
|
|
|
+ <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
|
|
<el-table-column prop="" align="center" label="数量" >
|
|
<el-table-column prop="" align="center" label="数量" >
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-input type="number" v-model="scope.row.salesQty" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
|
|
<el-input type="number" v-model="scope.row.salesQty" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="" align="center" label="商品代码"></el-table-column>
|
|
|
|
- <el-table-column prop="" align="center" label="规格型号"></el-table-column>
|
|
|
|
- <el-table-column prop="" align="center" label="销售价格"></el-table-column>
|
|
|
|
- <el-table-column prop="" align="center" label="销售金额"></el-table-column>
|
|
|
|
- <el-table-column prop="" align="center" label="库存数量"></el-table-column>
|
|
|
|
|
|
+ <el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
|
|
|
|
+ <el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
|
|
|
|
+ <el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
|
|
|
|
+ <el-table-column prop="goods.saleAmount" align="center" label="销售金额" ></el-table-column>
|
|
|
|
+ <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
|
|
<el-table-column label="操作" align="right" width="140">
|
|
<el-table-column label="操作" align="right" width="140">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
|
|
<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
|
|
@@ -163,26 +198,34 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { getWebsit } from "@/api/customerManagement";
|
|
import { getWebsit } from "@/api/customerManagement";
|
|
- import { getWorker, getCategory, getGoods } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
|
|
|
|
|
|
+ import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
|
|
export default {
|
|
export default {
|
|
- props: ['id','title'],
|
|
|
|
|
|
+ props: ['id','title','formType'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dataList: [],
|
|
dataList: [],
|
|
websitList: [],
|
|
websitList: [],
|
|
workerList: [],
|
|
workerList: [],
|
|
mainList: [],
|
|
mainList: [],
|
|
- smallList: [],
|
|
|
|
- materialsList: [],
|
|
|
|
formData: {
|
|
formData: {
|
|
|
|
+ websit: {},
|
|
websitId: '',
|
|
websitId: '',
|
|
- worker: '',
|
|
|
|
|
|
+ websitName: '',
|
|
|
|
+ file_url: [],
|
|
|
|
+ salesId: '',
|
|
|
|
+ flag: '',
|
|
|
|
+ createBy: '',
|
|
|
|
+ createTime: '',
|
|
|
|
+ confirmBy: '',
|
|
|
|
+ confirmTime: '',
|
|
|
|
+ worker: {},
|
|
|
|
+ workerName: '',
|
|
|
|
+ workerId: '',
|
|
idcard: '',
|
|
idcard: '',
|
|
phone: '',
|
|
phone: '',
|
|
- source: ''
|
|
|
|
|
|
+ source: '',
|
|
|
|
+ payType: ''
|
|
},
|
|
},
|
|
- productCategory: {},
|
|
|
|
- goodsCategory: {},
|
|
|
|
isEdit: 0,
|
|
isEdit: 0,
|
|
companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
rules: {
|
|
rules: {
|
|
@@ -209,6 +252,9 @@
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
created() {
|
|
created() {
|
|
|
|
+ if(this.id){
|
|
|
|
+ this.getDetail()
|
|
|
|
+ }
|
|
this.getWebsit()
|
|
this.getWebsit()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -216,63 +262,203 @@
|
|
goBack() {
|
|
goBack() {
|
|
this.$emit('back');
|
|
this.$emit('back');
|
|
},
|
|
},
|
|
|
|
+ async getDetail(){
|
|
|
|
+ const that = this
|
|
|
|
+ getDetail({salesId: this.id}).then(res => {
|
|
|
|
+ this.formData.flag = res.data.flag
|
|
|
|
+ this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
|
|
|
|
+ this.formData.websitId = res.data.websitId
|
|
|
|
+ this.formData.websitName = res.data.websitName
|
|
|
|
+ this.getWorker()
|
|
|
|
+ this.formData.salesId = res.data.salesId
|
|
|
|
+ this.formData.createBy = res.data.createBy
|
|
|
|
+ this.formData.createTime = res.data.createTime
|
|
|
|
+ this.formData.confirmBy = res.data.confirmBy
|
|
|
|
+ this.formData.confirmTime = res.data.confirmTime
|
|
|
|
+ this.formData.worker = {nickName: res.data.workerName,userId: res.data.workerId}
|
|
|
|
+ this.formData.workerName = res.data.workerName
|
|
|
|
+ this.formData.workerId = res.data.workerId
|
|
|
|
+ this.formData.idcard = res.data.identity
|
|
|
|
+ this.formData.phone = res.data.workerMobile
|
|
|
|
+ this.formData.source = res.data.source
|
|
|
|
+ this.formData.payType = res.data.payType
|
|
|
|
+ this.getCategory(res.data.websitId)
|
|
|
|
+ this.formData.remark = res.data.remark
|
|
|
|
+ res.data.items.forEach(item=>{
|
|
|
|
+ item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
|
|
|
|
+ item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
|
|
|
|
+ that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
|
|
|
|
+ item.goods = {...ress.data,oldPrice:ress.data.price}
|
|
|
|
+ item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.dataList = res.data.items
|
|
|
|
+ },200)
|
|
|
|
+ console.log(this.dataList)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getWebsit(){
|
|
getWebsit(){
|
|
getWebsit().then(res => {
|
|
getWebsit().then(res => {
|
|
this.websitList = res.data
|
|
this.websitList = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- changeWebsit(websitId){
|
|
|
|
|
|
+ changeWebsit(e){
|
|
|
|
+ this.formData.websitId = e.websitId
|
|
|
|
+ this.formData.websitName = e.name
|
|
this.getWorker()
|
|
this.getWorker()
|
|
|
|
+ this.getCategory(e.websitId)
|
|
|
|
+ },
|
|
|
|
+ getCategory(websitId){
|
|
getCategory({websitId}).then(res => {
|
|
getCategory({websitId}).then(res => {
|
|
this.mainList = res.data
|
|
this.mainList = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getWorker(name){
|
|
|
|
|
|
+ async getGoods(categoryId,goodsName,type){
|
|
const that = this
|
|
const that = this
|
|
- getWorker({pageNum: 1,pageSize: -1,params: [{param: 'a.nick_name',compare: '=',value: name},{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
|
|
|
|
- if(name){
|
|
|
|
- that.formData.idcard = res.data.records[0].idCard
|
|
|
|
- that.formData.phone = res.data.records[0].mobile
|
|
|
|
- }else{
|
|
|
|
- this.workerList = res.data.records
|
|
|
|
- }
|
|
|
|
|
|
+ if(type == 1){
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName}).then(res => {
|
|
|
|
+ resolve({
|
|
|
|
+ data: res.data[0]
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M'}).then(res => {
|
|
|
|
+ that.dataList[that.isEdit].goodsList = res.data
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getWorker(){
|
|
|
|
+ getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
|
|
|
|
+ this.workerList = res.data.records
|
|
})
|
|
})
|
|
},
|
|
},
|
|
changeWorker(e){
|
|
changeWorker(e){
|
|
- this.getWorker(e)
|
|
|
|
|
|
+ this.formData.idcard = e.idCard
|
|
|
|
+ this.formData.phone = e.mobile
|
|
|
|
+ this.formData.workerId = e.userId
|
|
|
|
+ this.formData.workerName = e.nickName
|
|
},
|
|
},
|
|
workerBlur(e){
|
|
workerBlur(e){
|
|
this.formData.worker = e.target.value
|
|
this.formData.worker = e.target.value
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
},
|
|
},
|
|
changeMain(e){
|
|
changeMain(e){
|
|
- this.dataList[this.isEdit].goodsCategoryId = ''
|
|
|
|
- this.dataList[this.isEdit].goodsCategoryName = ''
|
|
|
|
- this.dataList[this.isEdit].goodsCategory = {}
|
|
|
|
- this.dataList[this.isEdit].parentCategoryId = e.categoryId
|
|
|
|
- this.dataList[this.isEdit].parentCategoryName = e.categoryName
|
|
|
|
- this.smallList = e.items
|
|
|
|
|
|
+ this.dataList[this.isEdit].goodsList = [],
|
|
|
|
+ this.dataList[this.isEdit].parentCategory = e,
|
|
|
|
+ this.dataList[this.isEdit].parentCategoryId = e.categoryId,
|
|
|
|
+ this.dataList[this.isEdit].parentCategoryName = e.categoryName,
|
|
|
|
+ this.dataList[this.isEdit].goodsCategory = {},
|
|
|
|
+ this.dataList[this.isEdit].goodsCategoryName = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsCategoryId = '',
|
|
|
|
+ this.dataList[this.isEdit].goods = {},
|
|
|
|
+ this.dataList[this.isEdit].goodsId = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsName = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsSalesUnit = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsSpecification = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsCode = '',
|
|
|
|
+ this.dataList[this.isEdit].price = '',
|
|
|
|
+ this.dataList[this.isEdit].saleAmount = '',
|
|
|
|
+ this.dataList[this.isEdit].salesQty = ''
|
|
|
|
+ this.dataList[this.isEdit].qty = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsType = 'M'
|
|
},
|
|
},
|
|
- changeSmall(e){
|
|
|
|
|
|
+ async changeSmall(e){
|
|
|
|
+ this.dataList[this.isEdit].goods = {},
|
|
|
|
+ this.dataList[this.isEdit].goodsId = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsName = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsSalesUnit = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsSpecification = '',
|
|
|
|
+ this.dataList[this.isEdit].goodsCode = '',
|
|
|
|
+ this.dataList[this.isEdit].price = '',
|
|
|
|
+ this.dataList[this.isEdit].saleAmount = '',
|
|
|
|
+ this.dataList[this.isEdit].salesQty = ''
|
|
|
|
+ this.dataList[this.isEdit].qty = '',
|
|
this.dataList[this.isEdit].goodsCategoryId = e.categoryId
|
|
this.dataList[this.isEdit].goodsCategoryId = e.categoryId
|
|
this.dataList[this.isEdit].goodsCategoryName = e.categoryName
|
|
this.dataList[this.isEdit].goodsCategoryName = e.categoryName
|
|
- getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M',goodsName: e.categoryName}).then(res => {
|
|
|
|
-
|
|
|
|
|
|
+ getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M'}).then(res => {
|
|
|
|
+ this.dataList[this.isEdit].goodsList = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ changeGoods(e){
|
|
|
|
+ console.log(e)
|
|
|
|
+ this.dataList[this.isEdit].goodsId = e.goodsId
|
|
|
|
+ this.dataList[this.isEdit].goodsName = e.goodsName
|
|
|
|
+ this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
|
|
|
|
+ this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
|
|
|
|
+ this.dataList[this.isEdit].price = e.price
|
|
|
|
+ this.dataList[this.isEdit].goodsCode = e. goodsCode
|
|
|
|
+ this.dataList[this.isEdit].qty = e.qty
|
|
|
|
+ },
|
|
add(){
|
|
add(){
|
|
this.dataList.push({
|
|
this.dataList.push({
|
|
- productCategory: {},
|
|
|
|
|
|
+ goodsList: [],
|
|
|
|
+ parentCategory: {},
|
|
parentCategoryId: '',
|
|
parentCategoryId: '',
|
|
parentCategoryName: '',
|
|
parentCategoryName: '',
|
|
goodsCategory: {},
|
|
goodsCategory: {},
|
|
goodsCategoryName: '',
|
|
goodsCategoryName: '',
|
|
goodsCategoryId: '',
|
|
goodsCategoryId: '',
|
|
- goodsSalesUnit: '',
|
|
|
|
- salesQty: '',
|
|
|
|
|
|
+ goods: {},
|
|
goodsId: '',
|
|
goodsId: '',
|
|
|
|
+ goodsName: '',
|
|
|
|
+ goodsSalesUnit: '',
|
|
goodsSpecification: '',
|
|
goodsSpecification: '',
|
|
- saleAmount: ''
|
|
|
|
|
|
+ goodsCode: '',
|
|
|
|
+ price: '',
|
|
|
|
+ saleAmount: '',
|
|
|
|
+ salesQty: 1,
|
|
|
|
+ qty: '',
|
|
|
|
+ goodsType: 'M'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ confirm(){
|
|
|
|
+ this.$refs.formData.validate((valid, invalidFields, errLabels) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if(this.formType == 0){
|
|
|
|
+ add({
|
|
|
|
+ goodsType: 'M',
|
|
|
|
+ source: this.formData.source,
|
|
|
|
+ payType: this.formData.payType,
|
|
|
|
+ remark: this.formData.remark,
|
|
|
|
+ websitId: this.formData.websitId,
|
|
|
|
+ websitName: this.formData.websitName,
|
|
|
|
+ workerName: this.formData.workerName,
|
|
|
|
+ workerId: this.formData.workerId,
|
|
|
|
+ identity: this.formData.idcard,
|
|
|
|
+ workerMobile: this.formData.phone,
|
|
|
|
+ items: this.dataList
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.$message.success('提交成功!')
|
|
|
|
+ this.goBack()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else if(this.formType == 1){
|
|
|
|
+ edit({
|
|
|
|
+ salesId: this.formData.salesId,
|
|
|
|
+ goodsType: 'M',
|
|
|
|
+ source: this.formData.source,
|
|
|
|
+ payType: this.formData.payType,
|
|
|
|
+ remark: this.formData.remark,
|
|
|
|
+ websitId: this.formData.websitId,
|
|
|
|
+ websitName: this.formData.websitName,
|
|
|
|
+ workerName: this.formData.workerName,
|
|
|
|
+ workerId: this.formData.workerId,
|
|
|
|
+ identity: this.formData.idcard,
|
|
|
|
+ workerMobile: this.formData.phone,
|
|
|
|
+ items: this.dataList
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.dataList = []
|
|
|
|
+ this.$message.success('提交成功!')
|
|
|
|
+ this.goBack()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|