add:新增销售单
This commit is contained in:
@@ -55,4 +55,12 @@ export function materialSync(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMaterOptType, isAlongMaterType, getProductSeries, materialSync }
|
||||
export function queryMater(data) {
|
||||
return request({
|
||||
url: 'api/Materia/queryMater',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMaterOptType, isAlongMaterType, getProductSeries, materialSync, queryMater }
|
||||
|
||||
@@ -24,4 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function getSupp(data) {
|
||||
return request({
|
||||
url: 'api/supplierbase/getSupp',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getSupp }
|
||||
|
||||
344
wms/nladmin-ui/src/views/wms/st/saleorder/index.vue
Normal file
344
wms/nladmin-ui/src/views/wms/st/saleorder/index.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="销售单编码">
|
||||
<el-input
|
||||
v-model="query.sale_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码">
|
||||
<el-input
|
||||
v-model="query.supp_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="客户编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售单状态">
|
||||
<el-select
|
||||
v-model="query.sale_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.SALE_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="checkIos"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createOutIos"
|
||||
>
|
||||
创建出库单
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @change="queryMater" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="客户编码" prop="supp_code">
|
||||
<el-select
|
||||
v-model="form.supp_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in suppList"
|
||||
:key="item.supp_code"
|
||||
:label="item.supp_name"
|
||||
:value="item.supp_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="销售重量" prop="sale_qty">
|
||||
<el-input-number v-model="form.sale_qty" :precision="0" :controls="false" :min="1" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="sale_code" label="单据编码" :min-width="flexWidth('sale_code',crud.data,'单据编码')" />
|
||||
<el-table-column prop="sale_status" label="单据状态" :formatter="formattStatus" :min-width="flexWidth('sale_status',crud.data,'单据状态')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="supp_code" label="客户编码" :min-width="flexWidth('supp_code',crud.data,'客户编码')" />
|
||||
<el-table-column prop="supp_name" label="客户名称" :min-width="flexWidth('supp_name',crud.data,'客户名称')" />
|
||||
<el-table-column prop="sale_qty" label="销售数量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||
<el-table-column prop="check_name" label="审核人" :min-width="flexWidth('check_name',crud.data,'审核人')" />
|
||||
<el-table-column prop="check_time" label="审核时间" :min-width="flexWidth('check_time',crud.data,'审核时间')" />
|
||||
<el-table-column prop="confirm_name" label="完成人" :min-width="flexWidth('confirm_name',crud.data,'完成人')" />
|
||||
<el-table-column prop="confirm_time" label="完成时间" :min-width="flexWidth('confirm_time',crud.data,'完成时间')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
lign="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSaleorder from '@/views/wms/st/saleorder/saleorder'
|
||||
import crudSupplierbase from '@/views/wms/basedata/supp/supplierbase'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudGroup from '@/views/wms/basedata/material/material'
|
||||
|
||||
const defaultForm = {
|
||||
sale_id: null,
|
||||
sale_code: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
supp_code: null,
|
||||
supp_name: null,
|
||||
sale_qty: null,
|
||||
qty_unit_id: null,
|
||||
qty_unit_name: null,
|
||||
sale_status: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
check_id: null,
|
||||
check_name: null,
|
||||
check_time: null,
|
||||
confirm_id: null,
|
||||
confirm_name: null,
|
||||
confirm_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'SalesOrder',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['SALE_STATUS'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '销售单管理',
|
||||
url: 'api/salesorder',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'sale_id',
|
||||
sort: 'sale_id,desc',
|
||||
crudMethod: { ...crudSaleorder }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ViewDialog: false,
|
||||
openParam: null,
|
||||
permission: {},
|
||||
suppList: [],
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
bom_type: [
|
||||
{ required: true, message: '工单类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
call_qty: [
|
||||
{ required: true, message: '叫料重量不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudSupplierbase.getSupp({}).then(res => {
|
||||
this.suppList = res
|
||||
})
|
||||
this.initQuery()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
/* 搜索框创建时间默认最近一周*/
|
||||
initQuery() {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
const endYear = end.getFullYear()
|
||||
var endMonth = end.getMonth() + 1
|
||||
if (end.getMonth() + 1 < 10) {
|
||||
endMonth = '0' + endMonth.toString()
|
||||
}
|
||||
var endDay = end.getDate()
|
||||
if (end.getDate() < 10) {
|
||||
endDay = '0' + endDay.toString()
|
||||
}
|
||||
const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59'
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
const startYear = start.getFullYear()
|
||||
var startMonth = start.getMonth() + 1
|
||||
if (start.getMonth() + 1 < 10) {
|
||||
startMonth = '0' + startMonth.toString()
|
||||
}
|
||||
var startDay = start.getDate()
|
||||
if (start.getDate() < 10) {
|
||||
startDay = '0' + startDay.toString()
|
||||
}
|
||||
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
|
||||
this.$set(this.query, 'createTime', [startDate, endDate])
|
||||
this.crud.toQuery()
|
||||
},
|
||||
queryMater(value) {
|
||||
crudGroup.queryMater({ 'material_code': value }).then(row => {
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_code = row.material_code
|
||||
}).catch(() => {
|
||||
this.form.material_spec = ''
|
||||
this.form.material_name = ''
|
||||
this.form.material_code = ''
|
||||
})
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.SALE_STATUS[row.sale_status]
|
||||
},
|
||||
checkIos() {
|
||||
const data = this.$refs.table.selection[0]
|
||||
if (data.sale_status !== '1') {
|
||||
this.crud.notify('当前状态不为生成状态!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudSaleorder.checkIos(data).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
createOutIos() {
|
||||
const data = this.$refs.table.selection[0]
|
||||
if (data.sale_status !== '2') {
|
||||
this.crud.notify('当前状态不为审核状态!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudSaleorder.createOutIos(data).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
43
wms/nladmin-ui/src/views/wms/st/saleorder/saleorder.js
Normal file
43
wms/nladmin-ui/src/views/wms/st/saleorder/saleorder.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/salesorder',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/salesorder/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/salesorder',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function checkIos(data) {
|
||||
return request({
|
||||
url: 'api/salesorder/checkIos',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function createOutIos(data) {
|
||||
return request({
|
||||
url: 'api/salesorder/createOutIos',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, checkIos, createOutIos }
|
||||
Reference in New Issue
Block a user