更新代码
This commit is contained in:
parent
1faedc0334
commit
1aad791aa2
src
api/repair/stockOperate
views/repair
Components
stockOperate/Components
@ -2,6 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
const preUrl = "/repair/so"
|
const preUrl = "/repair/so"
|
||||||
|
|
||||||
|
// 采购单\领料单 新增
|
||||||
export function createRepairSo(data){
|
export function createRepairSo(data){
|
||||||
return request({
|
return request({
|
||||||
url: preUrl + "/create",
|
url: preUrl + "/create",
|
||||||
@ -9,3 +10,11 @@ export function createRepairSo(data){
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getRepairSoPage(params){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/page",
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -10,6 +10,12 @@ import {getStaffList} from "@/api/company/staff";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "StaffChoose",
|
name: "StaffChoose",
|
||||||
|
props:{
|
||||||
|
value: {
|
||||||
|
type: Object,
|
||||||
|
defaultValue: null
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
staffList: [],
|
staffList: [],
|
||||||
@ -19,7 +25,14 @@ export default {
|
|||||||
watch:{
|
watch:{
|
||||||
staffSelected(val) {
|
staffSelected(val) {
|
||||||
const staff = this.staffList.find(item => item.id === val);
|
const staff = this.staffList.find(item => item.id === val);
|
||||||
this.$emit("selected", staff);
|
this.$emit("input", staff);
|
||||||
|
},
|
||||||
|
value(newVal){
|
||||||
|
if (newVal){
|
||||||
|
this.staffSelected = newVal.id
|
||||||
|
}else {
|
||||||
|
this.staffSelected = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -11,16 +11,29 @@ import {getBaseSupplierList} from "@/api/repair/supplier";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SupplierChoose",
|
name: "SupplierChoose",
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: Object,
|
||||||
|
defaultValue: null
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
supplierSelected: undefined,
|
supplierSelected: undefined,
|
||||||
supplierList: null
|
supplierList: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
supplierSelected(val) {
|
supplierSelected(val) {
|
||||||
const supplier = this.supplierList.find(item => item.id === val);
|
const supplier = this.supplierList.find(item => item.id === val)
|
||||||
this.$emit("selected", supplier);
|
this.$emit("input", supplier);
|
||||||
|
},
|
||||||
|
value(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.supplierSelected = newVal.id
|
||||||
|
} else {
|
||||||
|
this.supplierSelected = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -51,7 +51,8 @@ export default {
|
|||||||
return JSON.parse(JSON.stringify(result))
|
return JSON.parse(JSON.stringify(result))
|
||||||
},
|
},
|
||||||
handleNodeClick(node){
|
handleNodeClick(node){
|
||||||
this.$emit("selected", node)
|
this.$emit("input", node.name)
|
||||||
|
this.$emit("change")
|
||||||
this.warehouseSelected = node.name
|
this.warehouseSelected = node.name
|
||||||
this.$refs.selectTree.blur()
|
this.$refs.selectTree.blur()
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="soByType && !goodsYes" label="供应商" prop="supplierId">
|
<el-form-item v-if="soByType && !goodsYes" label="供应商" prop="supplierId">
|
||||||
<SupplierChoose />
|
<SupplierChoose/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="goodsYes" label="关键字" prop="soNo">
|
<el-form-item v-if="goodsYes" label="关键字" prop="soNo">
|
||||||
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
|
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<el-option v-for="item in getStatus"
|
<el-option v-for="item in getStatus"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value" />
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="!soByType" label="领料人" prop="userId">
|
<el-form-item v-if="!soByType" label="领料人" prop="userId">
|
||||||
@ -55,19 +55,19 @@
|
|||||||
<span>{{ scope.$index + 1 }}</span>
|
<span>{{ scope.$index + 1 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单号" align="center" prop="soNo" width="180" />
|
<el-table-column label="单号" align="center" prop="soNo" width="180"/>
|
||||||
<el-table-column label="商品名称" align="center" width="180" prop="name" />
|
<el-table-column label="商品名称" align="center" width="180" prop="name"/>
|
||||||
<el-table-column label="规格" align="center" width="180" prop="name" />
|
<el-table-column label="规格" align="center" width="180" prop="name"/>
|
||||||
<el-table-column label="商品编码" align="center" width="180" prop="name" />
|
<el-table-column label="商品编码" align="center" width="180" prop="name"/>
|
||||||
<el-table-column label="所属分类" align="center" width="150" prop="name" />
|
<el-table-column label="所属分类" align="center" width="150" prop="name"/>
|
||||||
<el-table-column label="数量" align="center" width="150" prop="name" />
|
<el-table-column label="数量" align="center" width="150" prop="name"/>
|
||||||
<el-table-column label="单位" align="center" width="150" prop="name" />
|
<el-table-column label="单位" align="center" width="150" prop="name"/>
|
||||||
<el-table-column label="成本" align="center" width="150" prop="name" />
|
<el-table-column label="成本" align="center" width="150" prop="name"/>
|
||||||
<el-table-column label="供应商" align="center" width="180" prop="name" />
|
<el-table-column label="供应商" align="center" width="180" prop="name"/>
|
||||||
<el-table-column label="仓库" align="center" width="150" prop="name" />
|
<el-table-column label="仓库" align="center" width="150" prop="name"/>
|
||||||
<el-table-column label="状态" align="center" width="150" prop="name" />
|
<el-table-column label="状态" align="center" width="150" prop="name"/>
|
||||||
<el-table-column label="时间" align="center" width="150" prop="name" />
|
<el-table-column label="时间" align="center" width="150" prop="name"/>
|
||||||
<el-table-column label="门店" align="center" width="180" prop="name" />
|
<el-table-column label="门店" align="center" width="180" prop="name"/>
|
||||||
<el-table-column label="操作" align="center" width="180" fixed="right">
|
<el-table-column label="操作" align="center" width="180" fixed="right">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit"
|
<el-button size="mini" type="text" icon="el-icon-edit"
|
||||||
@ -84,16 +84,16 @@
|
|||||||
<span>{{ scope.$index + 1 }}</span>
|
<span>{{ scope.$index + 1 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单号" align="center" prop="soNo" width="180" />
|
<el-table-column label="单号" align="center" prop="soNo" width="180"/>
|
||||||
<el-table-column label="数量" align="center" prop="itemCount" width="150" />
|
<el-table-column label="数量" align="center" prop="itemCount" width="150"/>
|
||||||
<el-table-column label="金额" align="center" prop="totalPrice" width="150" />
|
<el-table-column label="金额" align="center" prop="totalPrice" width="150"/>
|
||||||
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150" />
|
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150"/>
|
||||||
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="150" />
|
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="150"/>
|
||||||
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150" />
|
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150"/>
|
||||||
<el-table-column label="登记时间" align="center" prop="createTime" width="150" />
|
<el-table-column label="登记时间" align="center" prop="createTime" width="150"/>
|
||||||
<el-table-column label="门店" align="center" prop="corpName" width="180" />
|
<el-table-column label="门店" align="center" prop="corpName" width="180"/>
|
||||||
<el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150" />
|
<el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150"/>
|
||||||
<el-table-column label="备注" align="center" prop="remark" width="180" />
|
<el-table-column label="备注" align="center" prop="remark" width="180"/>
|
||||||
<el-table-column label="操作" fixed="right" width="180" align="center">
|
<el-table-column label="操作" fixed="right" width="180" align="center">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit"
|
<el-button size="mini" type="text" icon="el-icon-edit"
|
||||||
@ -117,21 +117,22 @@ import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
|
|||||||
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
|
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
|
||||||
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
||||||
import {DICT_TYPE} from "@/utils/dict";
|
import {DICT_TYPE} from "@/utils/dict";
|
||||||
|
import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SoIndex",
|
name: "SoIndex",
|
||||||
computed: {
|
computed: {
|
||||||
getStatus(){
|
getStatus() {
|
||||||
const data = this.getDictDatas(DICT_TYPE.REPAIR_SO_STATUS)
|
const data = this.getDictDatas(DICT_TYPE.REPAIR_SO_STATUS)
|
||||||
return data.filter(item => item.label.toString().indexOf("领料") === -1)
|
return data.filter(item => item.label.toString().indexOf("领料") === -1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components:{
|
components: {
|
||||||
StaffChoose,
|
StaffChoose,
|
||||||
SupplierChoose,
|
SupplierChoose,
|
||||||
CorpChoose
|
CorpChoose
|
||||||
},
|
},
|
||||||
props:{
|
props: {
|
||||||
soByType: {
|
soByType: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
@ -145,17 +146,18 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParams:{
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
searchTimeArray:[],
|
searchTimeArray: [],
|
||||||
soNo: null,
|
soNo: null,
|
||||||
supplierId: null,
|
supplierId: null,
|
||||||
supplierName: null,
|
supplierName: null,
|
||||||
soStatus: null,
|
soStatus: null,
|
||||||
corpId: null,
|
corpId: null,
|
||||||
userId: null,
|
userId: null,
|
||||||
userName: null
|
userName: null,
|
||||||
|
soType: this.soByType ? "01" : "02"
|
||||||
},
|
},
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
list: [],
|
list: [],
|
||||||
@ -163,21 +165,36 @@ export default {
|
|||||||
total: 0
|
total: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.pageSo();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 分页
|
||||||
|
async pageSo() {
|
||||||
|
try {
|
||||||
|
this.loading = true
|
||||||
|
const res = await getRepairSoPage(this.queryParams)
|
||||||
|
this.list = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
// 搜索按钮
|
// 搜索按钮
|
||||||
handleQuery(){},
|
handleQuery() {
|
||||||
|
},
|
||||||
// 搜索重置
|
// 搜索重置
|
||||||
resetQuery(){
|
resetQuery() {
|
||||||
this.resetForm('queryForm')
|
this.resetForm('queryForm')
|
||||||
this.handleQuery()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
// 员工选择组件的回调
|
// 员工选择组件的回调
|
||||||
getStaff(data){
|
getStaff(data) {
|
||||||
this.queryParams.userId = data.id
|
this.queryParams.userId = data.id
|
||||||
this.queryParams.userName = data.name
|
this.queryParams.userName = data.name
|
||||||
},
|
},
|
||||||
// 门店选择
|
// 门店选择
|
||||||
getCompany(data){
|
getCompany(data) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<!-- 供应商 组件 -->
|
<!-- 供应商 组件 -->
|
||||||
<el-form-item v-if="soByType" label="供应商" prop="supplierId">
|
<el-form-item v-if="soByType" label="供应商" prop="supplier">
|
||||||
<SupplierChoose @selected="getSupplier"/>
|
<SupplierChoose v-model="formData.supplier"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 日期 内嵌 -->
|
<!-- 日期 内嵌 -->
|
||||||
<el-form-item label="日期" prop="soTime">
|
<el-form-item label="日期" prop="soTime">
|
||||||
@ -20,8 +20,8 @@
|
|||||||
<el-input disabled v-model="formData.soNo" style="width: 20rem"/>
|
<el-input disabled v-model="formData.soNo" style="width: 20rem"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 采购员/领料人 组件 -->
|
<!-- 采购员/领料人 组件 -->
|
||||||
<el-form-item :label="staffRole" prop="userId">
|
<el-form-item :label="staffRole" prop="user">
|
||||||
<StaffChoose @selected="getStaff"/>
|
<StaffChoose v-model="formData.user"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<!-- 按钮操作 -->
|
<!-- 按钮操作 -->
|
||||||
<el-col :span="6" style="text-align: right">
|
<el-col :span="6" style="text-align: right">
|
||||||
<el-button v-if="soByType" type="danger" @click="handleSubmit">结算</el-button>
|
<el-button v-if="soByType" type="danger" @click="handleSubmit">结算</el-button>
|
||||||
<el-button v-else type="primary">确定</el-button>
|
<el-button v-else type="primary" @click="handleSubmit">确定</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -89,12 +89,10 @@ export default {
|
|||||||
return {
|
return {
|
||||||
formData: {
|
formData: {
|
||||||
soNo: null,
|
soNo: null,
|
||||||
supplierId: null,
|
supplier: null,
|
||||||
supplierName: null,
|
|
||||||
soTime: Date.now(),
|
soTime: Date.now(),
|
||||||
userId: null,
|
user: null,
|
||||||
userName: null,
|
goodsList: [],
|
||||||
partList: [],
|
|
||||||
totalPrice: null,
|
totalPrice: null,
|
||||||
soType: this.soByType ? "01" : "02",
|
soType: this.soByType ? "01" : "02",
|
||||||
purchaseType: "01",
|
purchaseType: "01",
|
||||||
@ -107,8 +105,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
|
this.init()
|
||||||
this.staffRole = this.soByType ? this.staffRole : "领料人"
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 得到选择的员工
|
// 得到选择的员工
|
||||||
@ -142,11 +139,61 @@ export default {
|
|||||||
tableData(data){
|
tableData(data){
|
||||||
this.formData.totalPrice = data.reduce((x, y) => {return x + y.totalPrice}, 0)
|
this.formData.totalPrice = data.reduce((x, y) => {return x + y.totalPrice}, 0)
|
||||||
this.formData.itemCount = data.reduce((x, y) => {return x + y.count}, 0)
|
this.formData.itemCount = data.reduce((x, y) => {return x + y.count}, 0)
|
||||||
this.formData.partList = data
|
this.formData.goodsList = data.map(item => {
|
||||||
|
return {
|
||||||
|
goodsId: item.id,
|
||||||
|
goodsType: "0",
|
||||||
|
wareId: "0",
|
||||||
|
goodsCount: item.count,
|
||||||
|
goodsPrice: item.newPrice,
|
||||||
|
remark: item.remark
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
// 提交
|
||||||
async handleSubmit(){
|
async handleSubmit(){
|
||||||
const res = await createRepairSo(this.formData)
|
try {
|
||||||
console.log(res)
|
this.createInit()
|
||||||
|
await createRepairSo(this.formData)
|
||||||
|
this.$modal.msgSuccess("新增成功")
|
||||||
|
this.init()
|
||||||
|
}catch{
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 初始化
|
||||||
|
init(){
|
||||||
|
this.formData = {
|
||||||
|
soNo: null,
|
||||||
|
supplier: null,
|
||||||
|
soTime: Date.now(),
|
||||||
|
user: null,
|
||||||
|
goodsList: [],
|
||||||
|
totalPrice: null,
|
||||||
|
soType: this.soByType ? "01" : "02",
|
||||||
|
purchaseType: "01",
|
||||||
|
itemCount: 0,
|
||||||
|
soStatus: this.soByType ? "01" : "04",
|
||||||
|
remark: null,
|
||||||
|
}
|
||||||
|
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
|
||||||
|
this.staffRole = this.soByType ? this.staffRole : "领料人"
|
||||||
|
this.partList = []
|
||||||
|
},
|
||||||
|
// 提交前的构建
|
||||||
|
createInit(){
|
||||||
|
const data = this.formData
|
||||||
|
this.formData = {
|
||||||
|
...data,
|
||||||
|
userId: data.user.id,
|
||||||
|
userName: data.user.name,
|
||||||
|
}
|
||||||
|
if (this.soByType){
|
||||||
|
this.formData = {
|
||||||
|
...data,
|
||||||
|
supplierId: data.supplier.id,
|
||||||
|
supplierName: data.supplier.name
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,16 @@
|
|||||||
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
|
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
|
||||||
<el-table-column label="规格" align="center" width="180" prop="model"/>
|
<el-table-column label="规格" align="center" width="180" prop="model"/>
|
||||||
<el-table-column label="商品编码" align="center" width="180" prop="code"/>
|
<el-table-column label="商品编码" align="center" width="180" prop="code"/>
|
||||||
<el-table-column label="仓库" align="center" width="150" prop="warehouse"/>
|
<el-table-column label="仓库" align="center" width="150" prop="warehouse">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<WarehouseChoose v-if="scope.row[scope.column.property + 'isShow'] && soByType"
|
||||||
|
:ref="scope.column.property"
|
||||||
|
v-model="scope.row.warehouse"
|
||||||
|
@change="alterData(scope.row,scope.column)"
|
||||||
|
/>
|
||||||
|
<span v-else>{{ scope.row.warehouse }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="库存" align="center" width="150" prop="stock"/>
|
<el-table-column label="库存" align="center" width="150" prop="stock"/>
|
||||||
<el-table-column label="单位" align="center" width="150" prop="unit"/>
|
<el-table-column label="单位" align="center" width="150" prop="unit"/>
|
||||||
<el-table-column label="数量" align="center" width="150" prop="count">
|
<el-table-column label="数量" align="center" width="150" prop="count">
|
||||||
@ -31,7 +40,7 @@
|
|||||||
<el-table-column :label="soByType ? '上次进价' : '成本'" align="center" width="150" prop="price"/>
|
<el-table-column :label="soByType ? '上次进价' : '成本'" align="center" width="150" prop="price"/>
|
||||||
<el-table-column v-if="soByType" label="采购单价" align="center" width="150" prop="newPrice">
|
<el-table-column v-if="soByType" label="采购单价" align="center" width="150" prop="newPrice">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-if="scope.row[scope.column.property + 'isShow']"
|
<el-input v-if="scope.row[scope.column.property + 'isShow'] && soByType"
|
||||||
:ref="scope.column.property"
|
:ref="scope.column.property"
|
||||||
v-model="scope.row.newPrice"
|
v-model="scope.row.newPrice"
|
||||||
@blur="alterData(scope.row,scope.column)"></el-input>
|
@blur="alterData(scope.row,scope.column)"></el-input>
|
||||||
@ -59,8 +68,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SoTable",
|
name: "SoTable",
|
||||||
|
components: {WarehouseChoose},
|
||||||
props: {
|
props: {
|
||||||
soByType: {
|
soByType: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -83,15 +95,20 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
partList(val) {
|
partList(val) {
|
||||||
const data = val[val.length - 1]
|
if (val && val.length > 0) {
|
||||||
const newData = {
|
const data = val[val.length - 1]
|
||||||
...data,
|
const newData = {
|
||||||
count: 1,
|
...data,
|
||||||
totalPrice: data.price * 1,
|
count: 1,
|
||||||
remark: '',
|
totalPrice: data.price * 1,
|
||||||
newPrice: data.price,
|
remark: '',
|
||||||
|
newPrice: data.price,
|
||||||
|
}
|
||||||
|
this.list.push(newData)
|
||||||
|
}else {
|
||||||
|
this.list = []
|
||||||
|
this.refreshTable()
|
||||||
}
|
}
|
||||||
this.list.push(newData)
|
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
@ -133,9 +150,9 @@ export default {
|
|||||||
row[column.property + "isShow"] = true
|
row[column.property + "isShow"] = true
|
||||||
//refreshTable是table数据改动时,刷新table的
|
//refreshTable是table数据改动时,刷新table的
|
||||||
this.refreshTable()
|
this.refreshTable()
|
||||||
this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
this.$refs[column.property] && this.$refs[column.property].focus()
|
// this.$refs[column.property] && this.$refs[column.property].focus()
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
alterData(row, column) {
|
alterData(row, column) {
|
||||||
row[column.property + "isShow"] = false
|
row[column.property + "isShow"] = false
|
||||||
|
Loading…
Reference in New Issue
Block a user