fengdong777 2 years ago
parent
commit
fabb407108
  1. 12
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js
  2. 45
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeYuanliao/index.js
  3. 465
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/business/rawMaterialProcure/index.vue
  4. 516
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/business/rawMaterialProcure/rawMaterialProcureAdd.vue
  5. 197
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/business/rawMaterialProcure/rawMaterialProcureInfo.vue

12
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js

@ -150,4 +150,16 @@ export default {
}
})
},
// 查询原料记录
inventoryList: function(params) {
return request({
url: '/cyf/rawinventory/inventoryList',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
},
}

45
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeYuanliao/index.js

@ -0,0 +1,45 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 采购
// 查询分页列表
loadLogList: function(params) {
return request({
url: '/cyf/materialProcurement/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
},
submit: function(params) {
return request({
url: '/cyf/materialProcurement/submit',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
},
// 新增
save: function(data) {
return request({
url: '/cyf/materialProcurement/save',
method: 'post',
data: data
});
},
// 初始化
procureFetchBySid: function(sid) {
return request({
url: '/v1/warehouselocation/getWarehouseBySid/' + sid
})
},
}

465
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/business/rawMaterialProcure/index.vue

@ -1,177 +1,156 @@
<template>
<div class="app-container">
<div v-show="viewState ==1">
<button-bar view-title="采购管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<button-bar view-title="原料采购销售管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" class="tab-header">
<el-form-item label="采购订单编号">
<el-input v-model="listQuery.params.bankName" maxlength="20" placeholder="请输入采购订单编号" class="addinputw"
clearable />
</el-form-item>
<el-form-item label="采购日期">
<el-date-picker v-model="listQuery.params.date" type="date" :picker-options="pickerOptions" clearable
value-format="yyyy-MM-dd" placeholder="选择日期" />
</el-form-item>
<el-form-item label="商品名称">
<el-input v-model="listQuery.params.bankName" maxlength="20" placeholder="请输入采购商品名称" class="addinputw"
clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleReset">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleFilter">重置</el-button>
</div>
</div>
</div>
<el-row style="margin-left: 20px;margin-right: 20px;">
<el-col>
<el-tabs v-model="tabActiveName" @tab-click="handleOrder">
<el-tab-pane label="原油订单列表" name="uplog">
<div>
<el-table v-loading="tableLoading1" :data="logList" border style="width: 100%">
<el-col>
<el-tabs v-model="tabActiveName" @tab-click="handleOrder">
<el-tab-pane label="原料采购订单列表" name="uplog">
<div class="searchcon">
<el-button size="small" class="searchbtn"
@click="clicksearchShow1">{{ searchxianshitit1 }}</el-button>
<div v-show="isSearchShow1" class="search">
<el-form ref="listQueryform1" :inline="true" :model="listQuery" class="tab-header">
<el-form-item label="订单编号">
<el-input v-model="listQuery.params.orderNumber" maxlength="20" placeholder="请输入订单编号"
class="addinputw" clearable />
</el-form-item>
<el-form-item label="日期">
<el-date-picker v-model="listQuery.params.date" type="date" :picker-options="pickerOptions"
clearable value-format="yyyy-MM-dd" placeholder="选择日期" />
</el-form-item>
<el-form-item label="商品名称">
<el-input v-model="listQuery.params.tradeName" maxlength="20" placeholder="请输入采购商品名称"
class="addinputw" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleReset1">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small"
@click="handleFilter1">重置</el-button>
</div>
</div>
</div>
<div>
<el-table v-loading="tableLoading1" :data="list" border style="width: 100%">
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="操作" wid align="center" width="220">
<el-table-column label="操作" wid align="center" width="200">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toDetail(scope.row)">详情</el-button>
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="doDel(scope.row)">删除</el-button>
<el-button type="primary" size="mini" v-show="scope.row.state==1"
@click="toEdit(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" v-show="scope.row.state==1"
@click="doDel(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="订单编号" prop="orderNumber" align="center" />
<el-table-column label="合同日期" prop="contractSigningDate" width="100" align="center" />
<el-table-column label="商品类型" prop="typeName" width="100" align="center" />
<el-table-column label="商品编码" prop="productCode" width="80" align="center" />
<el-table-column label="商品名称" prop="tradeName" width="180" align="center" />
<el-table-column label="单价" prop="price" width="80" align="center" />
<el-table-column label="数量" prop="weight" width="100" align="center" />
<el-table-column label="单位" prop="weight" width="100" align="center" />
<el-table-column label="付款日期" prop="paymentDate" width="100" align="center" />
<el-table-column label="供应商名称" prop="supplierName" align="center" />
<el-table-column label="供应商" prop="supplierName" align="center" />
<el-table-column label="订单状态" prop="state" width="150" align="center" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="logListTotal > 0" :total="logListTotal" :page.sync="logListQuery.current"
:limit.sync="logListQuery.size" class="pagination" @pagination="loadLogList" />
</div>
</el-tab-pane>
<el-tab-pane label="包装物订单列表" name="k112">
<div>
<el-table v-loading="tableLoading2" :data="in112List" border style="width: 100%">
<el-table-column fixed width="100" type="index" label="序号" :index="indexMethod2" align="center" />
<el-table-column prop="supplierName" label="供应商名称" align="center" />
<el-table-column prop="code" label="商品编码" width="120" align="center" />
<el-table-column prop="proName" label="商品名称" align="center" />
<el-table-column prop="number" label="单品数量" width="100"align="center" />
<el-table-column prop="orderAmount" label="订单商品价值" width="140" align="center" />
<el-table-column prop="actualArrivalNumber" label="实际到货数量" width="140"align="center" />
<el-table-column prop="actualArrival" label="实际到货价值" width="120" align="center" />
<el-table-column prop="transitNumber" label="在途货数量" width="120" align="center" />
<el-table-column prop="transit" label="在途货价值" width="120"align="center" />
<el-table-column prop="exceed" label="超出货价值" width="120"align="center" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="in112ListTotal > 0" :total="in112ListTotal" :page.sync="in112ListQuery.current"
:limit.sync="in112ListQuery.size" class="pagination" @pagination="loadIn112List" />
</div>
</el-tab-pane>
<el-tab-pane label="原料订单列表" name="all">
<div>
<el-table v-loading="tableLoading3" :data="inallList" border style="width: 100%">
<el-table-column fixed width="100" type="index" label="序号" :index="indexMethod3" align="center" />
<el-table-column prop="supplierName" label="供应商名称" align="center" />
<el-table-column prop="code" label="订单编号" align="center" />
<el-table-column prop="orderAmount" label="订单金额" align="center" />
<el-table-column prop="purchaseDate" label="订单日期" align="center" />
<el-table-column prop="arrivalDate" label="到货日期" align="center" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="inallListTotal > 0" :total="inallListTotal" :page.sync="inallListQuery.current"
:limit.sync="inallListQuery.size" class="pagination" @pagination="loadInallList" />
<el-table-column label="总价值" prop="totalValue" width="80" align="center" />
<el-table-column label="原料数量" prop="amount" width="100" align="center" />
<el-table-column label="订单状态" prop="stateValue" width="150" align="center" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="listTotal > 0" :total="listTotal" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="loadLogList" />
</div>
</el-tab-pane>
<el-tab-pane label="原料销售订单列表" name="k112">
<div class="searchcon">
<el-button size="small" class="searchbtn"
@click="clicksearchShow2">{{ searchxianshitit2 }}</el-button>
<div v-show="isSearchShow2" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery2" class="tab-header">
<el-form-item label="订单编号">
<el-input v-model="listQuery2.params.orderNumber" maxlength="20" placeholder="请输入订单编号"
class="addinputw" clearable />
</el-form-item>
<el-form-item label="日期">
<el-date-picker v-model="listQuery2.params.date" type="date" :picker-options="pickerOptions"
clearable value-format="yyyy-MM-dd" placeholder="选择日期" />
</el-form-item>
<el-form-item label="商品名称">
<el-input v-model="listQuery2.params.tradeName" maxlength="20" placeholder="请输入采购商品名称"
class="addinputw" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleReset2">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small"
@click="handleFilter2">重置</el-button>
</div>
</div>
</el-tab-pane>
</div>
</el-tabs>
</el-col>
</el-row>
<div>
<el-table v-loading="tableLoading2" :data="list2" border style="width: 100%">
<el-table-column fixed width="100" type="index" label="序号" :index="indexMethod2" align="center" />
<el-table-column prop="supplierName" label="供应商名称" align="center" />
<el-table-column prop="code" label="商品编码" width="120" align="center" />
<el-table-column prop="proName" label="商品名称" align="center" />
<el-table-column prop="number" label="单品数量" width="100" align="center" />
<el-table-column prop="orderAmount" label="订单商品价值" width="140" align="center" />
<el-table-column prop="actualArrivalNumber" label="实际到货数量" width="140" align="center" />
<el-table-column prop="actualArrival" label="实际到货价值" width="120" align="center" />
<el-table-column prop="transitNumber" label="在途货数量" width="120" align="center" />
<el-table-column prop="transit" label="在途货价值" width="120" align="center" />
<el-table-column prop="exceed" label="超出货价值" width="120" align="center" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="listTotal2 > 0" :total="listTotal2" :page.sync="listQuery2.current"
:limit.sync="listQuery2.size" class="pagination" @pagination="loadLogList2" />
</div>
</el-tab-pane>
<div class="listtop">
<div class="tit">采购订单列表</div>
<!-- 翻页分页 -->
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> -->
</div>
<div class="">
<el-table v-loading="listLoading" :data="list" border style="width: 100%;">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="操作" wid align="center" width="220">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toDetail(scope.row)">详情</el-button>
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="doDel(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="订单编号" prop="orderNumber" align="center" />
<el-table-column label="合同日期" prop="contractSigningDate" width="100" align="center" />
<el-table-column label="商品类型" prop="typeName" width="100" align="center" />
<el-table-column label="商品编码" prop="productCode" width="80" align="center" />
<el-table-column label="商品名称" prop="tradeName" width="180" align="center" />
<el-table-column label="单价" prop="price" width="80" align="center" />
<el-table-column label="数量" prop="weight" width="100" align="center" />
<el-table-column label="单位" prop="weight" width="100" align="center" />
<el-table-column label="供应商名称" prop="supplierName" align="center" />
<el-table-column label="供应商" prop="supplierName" align="center" />
<el-table-column label="订单状态" prop="state" width="150" align="center" />
</el-table>
</div>
<div class="pages">
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div>
</el-tabs>
</el-col>
</el-row>
</div>
</div>
<rawMaterialProcureAdd v-show="viewState ==2 || viewState ==3" ref="divAdd" @doback="resetState" @reloadlist="getList" />
<rawMaterialProcureInfo v-show="viewState ==4" ref="divInfo" @doback="resetState" @reloadlist="getList" />
<oilTypeProcureAdd v-show="viewState ==2 || viewState ==3" ref="divAdd" @doback="resetState"
@reloadlist="loadLogList" />
<oilTypeProcureInfo v-show="viewState ==4" ref="divInfo" @doback="resetState" @reloadlist="loadLogList" />
</div>
</template>
<script>
import req from '@/api/rawMaterialProcure/rawMaterialProcure.js'
import req from '@/api/oilTypeYuanliao/index.js'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import rawMaterialProcureAdd from './rawMaterialProcureAdd.vue'
import rawMaterialProcureInfo from './rawMaterialProcureInfo.vue'
import oilTypeProcureAdd from './rawMaterialProcureAdd.vue'
import oilTypeProcureInfo from './rawMaterialProcureInfo.vue'
import {
parseTime
} from '@/utils/index'
export default {
name: 'CustomerManagement',
components: {
Pagination,
pageye,
ButtonBar,
rawMaterialProcureAdd,
rawMaterialProcureInfo,
oilTypeProcureAdd,
oilTypeProcureInfo,
},
data() {
return {
tabActiveName: 'uplog',
index: "0",
isSearchShow: false,
searchxianshitit: '显示查询条件',
isSearchShow1: false,
searchxianshitit1: '显示查询条件',
isSearchShow2: false,
searchxianshitit2: '显示查询条件',
btndisabled: false,
tableLoading1: false,
tableLoading2: false,
tableLoading3: false,
btnList: [{
type: 'primary',
size: 'small',
@ -188,15 +167,31 @@
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
list: [],
listTotal: 1,
listQuery: {
current: 1,
size: 10,
params: {
bankName: '',
orderNumber: '',
date: '',
tradeName: '',
// type: '1', // 1 2 3
state: "1", // 1 2 3 4 5 6 7
},
total: 0
},
list2: [],
listTotal2: 1,
listQuery2: {
current: 1,
size: 10,
params: {
orderNumber: '',
date: '',
tradeName: '',
type: '1', // 1 2 3
state: "1", // 1 2 3 4 5 6 7
},
total: 0
},
@ -212,7 +207,8 @@
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.init()
this.loadLogList()
// this.loadLogList2()
//
},
methods: {
@ -230,17 +226,61 @@
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
clicksearchShow1() {
this.isSearchShow1 = !this.isSearchShow1
if (this.isSearchShow1) {
this.searchxianshitit1 = '隐藏查询条件'
} else {
this.searchxianshitit1 = '显示查询条件'
}
},
//
clicksearchShow2() {
this.isSearchShow2 = !this.isSearchShow2
if (this.isSearchShow2) {
this.searchxianshitit2 = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
this.searchxianshitit2 = '显示查询条件'
}
},
handleOrder(tab, event) {
console.log("tab", tab)
this.index = tab.index
switch (tab.index) {
//
case "0":
if (this.list.length == 0)
this.loadLogList()
break;
//
case "1":
if (this.list2.length == 0)
this.loadIn112List()
break;
default:
break;
}
},
//
init() {
this.getList()
//
loadLogList() {
this.tableLoading1 = true
req.loadLogList(this.listQuery).then((response) => {
this.tableLoading1 = false
if (response.success) {
console.log("response.data", response.data)
this.list = response.data.records
this.listQuery.total = response.data.total
this.listTotal = response.data.total
this.listQuery.current = response.data.current
this.listQuery.size = response.data.size
} else {
this.list = []
this.listQuery.total = 0
}
})
},
//
indexMethod(index) {
@ -249,39 +289,86 @@
return pageindex
},
//
getList() {
this.listLoading = true
req.listPage(this.listQuery).then((response) => {
this.listLoading = false
loadLogList2() {
this.tableLoading2 = true
req.loadLogList2(this.listQuery2).then((response) => {
this.tableLoading2 = false
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
this.list2 = response.data.records
this.listQuery2.total = response.data.total
this.listTotal2 = response.data.total
this.listQuery2.current = response.data.current
this.listQuery2.size = response.data.size
} else {
this.list = []
this.listQuery.total = 0
this.list2 = []
this.listQuery2.total = 0
}
})
},
//
indexMethod2(index) {
var pagestart = (this.listQuery2.current - 1) * this.listQuery2.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
handleReset() {
this.listQuery.current = 1
this.getList()
handleReset1() {
this.loadLogList()
},
//
handleFilter() {
handleFilter1() {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
bankName: ""
orderNumber: '',
tradeName: '',
date: "",
type: '1',
state: "1", // 1 2 3 4 5 6 7
}
}
this.loadLogList()
},
//
handleReset2() {
this.loadIn112List()
},
//
handleFilter2() {
this.listQuery2 = {
current: 1,
size: 10,
total: 0,
params: {
orderNumber: '',
tradeName: '',
date: "",
type: '1',
state: "1", // 1 2 3 4 5 6 7
}
}
this.getList()
this.loadIn112List()
},
//
toAdd() {
this.viewState = 2
switch (this.index) {
//
case "0":
this.viewState = 2
break;
//
case "1":
this.viewState = 2
break;
default:
break;
}
},
//
toEdit(row) {
@ -296,22 +383,44 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
req.delBySids(row.sid).then((response) => {
if (response.success) {
this.$message({
showClose: true,
type: 'success',
message: '删除成功'
})
this.getList()
} else {
this.$message({
showClose: true,
type: 'error',
message: '删除失败'
})
}
})
if ("0" == this.index) {
req.procureDelBySids(row.sid).then((response) => {
if (response.success) {
this.$message({
showClose: true,
type: 'success',
message: '删除成功'
})
this.loadLogList()
} else {
this.$message({
showClose: true,
type: 'error',
message: '删除失败'
})
}
})
}
if ("1" == this.index) {
req.procureDelBySids(row.sid).then((response) => {
if (response.success) {
this.$message({
showClose: true,
type: 'success',
message: '删除成功'
})
this.loadLogList()
} else {
this.$message({
showClose: true,
type: 'error',
message: '删除失败'
})
}
})
}
})
},
toDetail(row) {
@ -330,4 +439,4 @@
}
</script>
<style scoped>
</style>
</style>

516
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/business/rawMaterialProcure/rawMaterialProcureAdd.vue

@ -1,121 +1,231 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>采购信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="app-container">
<div>
<el-card class="box-card">
<div class="item">
<span class="item_text">库房位置</span>
<el-input v-model="formobj.address" placeholder="" class="item_input" style="width: 520px;" clearable />
<div class="tab-header webtop">
<div>采购信息</div>
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submitData">提交</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" icon="el-icon-close" @click="handleReturn()">关闭</el-button>
</div>
<div class="item">
<span class="item_text">--</span>
<div class="item_input">
<el-select v-model="formobj.province" filterable placeholder="请选择省" class="addinputw" style="width:160px"
@change="getShen">
<el-option v-for="item in inputProvinceList" :key="item.sid" :label="item.name" :value="item.sid" />
</el-select>
<el-select v-model="formobj.city" filterable placeholder="请选择市" class="addinputw"
style="width:160px;margin-left: 20px;margin-right: 20px;" @change="getShi">
<el-option v-for="item in inputCityList" :key="item.sid" :label="item.name" :value="item.sid" />
</el-select>
<el-select v-model="formobj.county" filterable placeholder="请选择县" class="addinputw" style="width:160px"
@change="getXian">
<el-option v-for="item in inputCountyList" :key="item.sid" :label="item.name" :value="item.sid" />
</el-select>
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="titwu">采购信息</div>
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>主体信息</div>
</div>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">订单编号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span>{{temp.bankName}}</span> -->
<el-input v-model="formobj.orderNumber" placeholder="" style="width: 80%;" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">合同日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span>{{temp.bankAbbreviation}}</span> -->
<el-date-picker v-model="formobj.contractSigningDate" type="date" style="width: 80%;"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">供货商名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span>{{temp.province}} - {{temp.city}} - {{temp.county}}</span> -->
<el-select v-model="formobj.supplierName" filterable placeholder="请选择供货商名称" style="width: 80%;"
@change="getSupplier">
<el-option v-for="item in supplierList" :key="item.sid" :label="item.name" :value="item.sid" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">付款日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span>{{temp.address}}</span> -->
<el-date-picker v-model="formobj.paymentDate" type="date" format="yyyy-MM-dd" style="width: 80%;"
value-format="yyyy-MM-dd" placeholder="请选择" />
</el-form-item>
</el-col>
</el-row>
</div>
<div class="item">
<span class="item_text">库房面积</span>
<el-input v-model="formobj.squareMeasure" placeholder="" class="item_input" style="width: 520px;" clearable />
</div>
<div class="item">
<span class="item_text">库房层高</span>
<el-input v-model="formobj.floorHeight" placeholder="" class="item_input" style="width: 520px;" clearable />
</div>
<div class="item">
<span class="item_text">库房价格</span>
<el-input v-model="formobj.price" placeholder="" class="item_input" style="width: 520px;" clearable />
</div>
<div class="item">
<span class="item_text">库房性质</span>
<el-input v-model="formobj.properties" placeholder="" class="item_input" style="width: 520px;" clearable />
</div>
<div class="item">
<span class="item_text">房源</span>
<el-input v-model="formobj.housingResources" placeholder="" class="item_input"
style="width: 520px;" clearable />
</div>
<el-collapse v-model="activeNames">
<el-collapse-item name="1">
<template slot="title">
原料信息<span class="span" @click.stop="add()">添加</span>
</template>
<el-table v-loading="listLoading" :data="formobj.commodityList" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="操作" wid align="center" width="150">
<template slot-scope="scope">
<!-- <el-button type="primary" size="mini" @click="toPersonnelDetail(scope.row.sid)">查看</el-button> -->
<!-- <el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button> -->
<el-button type="primary" size="mini" @click="doCommoditylDel(scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="原料名称" prop="crudeName" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.crudeName" filterable placeholder="请选择原油名称"
@change="getType($event,scope.$index)">
<el-option v-for="item in crudeList" :key="item.sid" :label="item.name" :value="item.sid" />
</el-select>
</template>
</el-table-column>
<el-table-column label="原料编码" prop="crudeNumber" align="center" />
<el-table-column label="单位" prop="sss" align="center" />
<el-table-column label="单价" prop="price" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="" @input="limitInput1($event,scope.$index)"
clearable></el-input>
</template>
</el-table-column>
<el-table-column label="重量" prop="weight" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.weight" placeholder="" @input="limitInput2($event,scope.$index)"
clearable></el-input>
</template>
</el-table-column>
</el-table>
<div class="item">
<span class="item_text">联系人</span>
<el-input v-model="formobj.contacts" placeholder="" class="item_input" style="width: 520px;" clearable />
</div>
<div class="item">
<span class="item_text">联系电话</span>
<el-input v-model="formobj.telephone" placeholder="" maxlength="11" class="item_input" style="width: 520px;" clearable />
</div>
<div class="item">
<span class="item_text">备注</span>
<el-input v-model="formobj.remarks" placeholder="" class="item_input" style="width: 520px;" clearable />
</div>
</el-collapse-item>
</el-collapse>
</el-card>
</el-form>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/rawMaterialProcure/rawMaterialProcure'
import req from '@/api/oilTypeYuanliao/index'
import req2 from '@/api/oilTypeInAndOutBound/oilTypeInAndOutBound'
import req3 from '@/api/supplier/supplier'
export default {
data() {
return {
submitdisabled: false,
crudeLists: [],
crudeList: [],
supplierLists: [],
supplierList: [],
listLoading: false,
activeNames: ['1'],
formobj: {
sid: "",
address: "",
squareMeasure: "",
floorHeight: "",
properties: "",
price: "",
housingResources: "",
province: '',
city: "",
county: "",
contacts: "",
telephone: "",
remarks: ""
},
inputProvinceList: [],
inputCityList: [],
inputCountyList: [],
orderNumber: "",
contractSigningDate: "",
paymentDate: "",
supplierSid: "",
supplierName: "",
commodityList: [],
}
}
},
created() {
// this.huoquSheng()
this.supplierInfoList()
this.crudeinfoList()
},
methods: {
saveOrUpdate() {
supplierInfoList() {
req3.supplierList().then((res) => {
if (res.success) {
console.log(">>>>>>>>>2222222", res.data)
this.supplierLists = res.data
for (var i = 0; i < this.supplierLists.length; i++) {
console.log(">>>>>>>>>222222", this.formobj)
let item = {
name: this.supplierLists[i].supplierName,
sid: this.supplierLists[i].sid,
}
this.supplierList.push(item)
}
}
})
},
crudeinfoList() {
req2.inventoryList().then((res) => {
if (res.success) {
console.log(">>>>>>>>>2222222", res.data)
this.crudeLists = res.data
for (var i = 0; i < this.crudeLists.length; i++) {
let item = {
name: this.crudeLists[i].name,
sid: this.crudeLists[i].sid,
}
this.crudeList.push(item)
}
}
})
},
/**
* 1必须为数字
* 2只能有一个小数点
* 3小数点后保留两位小数
* 4当第一位输入小数点的时候自动补全补为 0.
* 5除非是小数否则数字不能以0开头
* @param {string} value - 输入的值
* @param {string} index - 匹配的对象属性 [mkPrice | slPrice]
*/
limitInput1(value, index) {
this.formobj.commodityList[index].price =
("" + value) //
.replace(/[^\d^\.]+/g, "") //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 02
},
/**
* 1必须为数字
* 2只能有一个小数点
* 3小数点后保留两位小数
* 4当第一位输入小数点的时候自动补全补为 0.
* 5除非是小数否则数字不能以0开头
* @param {string} value - 输入的值
* @param {string} index - 匹配的对象属性 [mkPrice | slPrice]
*/
limitInput2(value, index) {
this.formobj.commodityList[index].weight =
("" + value) //
.replace(/[^\d^\.]+/g, "") //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 02
},
saveOrUpdate() {
if (this.formobj.sid) {
req.updateData(this.formobj)
req.procureUpdateData(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
@ -130,7 +240,7 @@
})
.catch(() => {})
} else {
req.addInfo(this.formobj)
req.save(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
@ -147,11 +257,27 @@
}
},
submitData() {
req.submit(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn("true")
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
console.log(">>>>>>>>>")
if (isreload === 'true') this.$emit('reloadlist')
if (this.formobj.psid) {
this.$emit('close', this.formobj.psid)
if (this.formobj.sid) {
this.$emit('close', this.formobj.sid)
} else {
@ -159,26 +285,18 @@
}
this.formobj = {
sid: "",
address: "",
squareMeasure: "",
floorHeight: "",
properties: "",
price: "",
housingResources: "",
province: '',
city: "",
county: "",
contacts: "",
telephone: "",
remarks: ""
orderNumber: "",
contractSigningDate: "",
paymentDate: "",
supplierSid: "",
supplierName: "",
commodityList: [],
}
},
showAdd(sid) {
this.formobj.psid = sid
},
showAdd() {},
showEdit(row) {
req.fetchBySid(row.sid)
req.procureFetchBySid(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
@ -189,141 +307,79 @@
this.formobj = row
})
},
// --------------------------------------------------
huoquSheng() {
getProvince().then((res) => {
if (res.success) {
this.inputProvinceList = res.data
}
})
getSupplier(value) {
console.log(">>>>>>>>>getType", value)
const choose = this.supplierLists.filter((item) => item.sid === value)
console.log(">>>>>>>>>getType", choose[0])
this.formobj.supplierName = choose[0].supplierName
this.formobj.supplierSid = value
},
getShen(value) {
let bb = ''
this.inputProvinceList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
// codeprovince
this.formobj.province = bb.name
this.formobj.city = ""
this.formobj.county = ""
this.huoquShi(bb.sid)
getType(value, index) {
console.log(">>>>>>>>>getType", value)
console.log(">>>>>>>>>getType", index)
const choose = this.crudeLists.filter((item) => item.sid === value)
console.log(">>>>>>>>>getType", choose[0])
this.formobj.commodityList[index].crudeNumber = choose[0].number
this.formobj.commodityList[index].crudeName = choose[0].name
this.formobj.commodityList[index].typeSid = value
},
huoquShi(sid1) {
var sid = {
sid: sid1
}
getCity(sid).then((res) => {
if (res.success) {
this.inputCityList = res.data
}
})
},
getShi(value) {
let bb = ''
this.inputCityList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
add() {
this.formobj.commodityList.push({
})
this.formobj.city = bb.name
this.formobj.county = ""
this.huoquXian(bb.sid)
},
huoquXian(sid1) {
var sid = {
sid: sid1
}
getCounty(sid).then((res) => {
if (res.success) {
this.inputCountyList = res.data
}
doCommoditylDel(index) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.formobj.commodityList.splice(index, 1);
})
},
getXian(value) {
let bb = ''
this.inputCountyList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.formobj.county = bb.name
//
indexMethod(index) {
// var pagestart = (this.listQuery.current - 1) * this.listQuery.size
// var pageindex = index + 1 + pagestart
return index + 1
},
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
font-size: 18px;
text-align: right;
}
.item_input {
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
<style scoped>
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.item_right_list_text {
font-size: 16px;
}
.trightb_item {
padding-top: 5px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
.span {
margin-left: 50px;
font-size: 15px;
font-weight: 400;
}
}
/deep/ .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
/deep/ .el-collapse-item__content {
padding-bottom: 0;
}
</style>

197
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/business/rawMaterialProcure/rawMaterialProcureInfo.vue

@ -2,128 +2,93 @@
<div class="app-container">
<div>
<div class="tab-header webtop">
<div>查看采购信息</div>
<div>采购信息</div>
<div>
<el-button type="primary" size="small" v-show="formobj.state<=5" :disabled="submitdisabled"
@click="submitData">提交</el-button>
<!-- <el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> -->
<el-button type="info" size="small" icon="el-icon-close" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="temp" label-position="top" label-width="190px" class="formadd">
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="titwu">采购信息</div>
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>基本信息</div>
<div>主体信息</div>
</div>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库房位置</span>
<span slot="label">合同编号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.address}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">--</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.province}} - {{temp.city}} - {{temp.county}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库房面积</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.squareMeasure}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库房层高</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.floorHeight}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库房价格</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.price}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库房性质</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.properties}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">房源</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.housingResources}}</span>
<span>{{formobj.orderNumber}}</span>
<!-- <el-input v-model="formobj.orderNumber" placeholder="" style="width: 80%;" clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注</span>
<span slot="label">合同日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.remarks}}</span>
<span>{{formobj.contractSigningDate}}</span>
<!-- <el-date-picker v-model="formobj.contractSigningDate" type="date" style="width: 80%;"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">联系人</span>
<span slot="label">供货商名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.contacts}}</span>
<span>{{formobj.supplierName}}</span>
<!-- <el-select v-model="formobj.supplierName" filterable placeholder="请选择供货商名称" style="width: 80%;"
@change="getSupplier">
<el-option v-for="item in supplierList" :key="item.sid" :label="item.name" :value="item.sid" />
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">联系电话</span>
<span slot="label">到货日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span>{{temp.telephone}}</span>
<span>{{formobj.arrivalDate}}</span>
<!-- <el-date-picker v-model="formobj.arrivalDate" type="date" format="yyyy-MM-dd" style="width: 80%;"
value-format="yyyy-MM-dd" placeholder="请选择" /> -->
</el-form-item>
</el-col>
</el-row>
<el-collapse v-model="activeNames">
<el-collapse-item name="1" title="商品信息">
<!-- <template slot="title" title="商品信息">
商品信息<span class="span" @click.stop="add()">添加</span>
</template> -->
<el-table v-loading="listLoading" :data="formobj.commodityList" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="商品名称" prop="name" align="center" />
<el-table-column label="商品编码" prop="number" align="center" />
<el-table-column label="单位" prop="sss" align="center" />
<el-table-column label="单价" prop="price" align="center" />
<el-table-column label="重量" prop="weight" align="center" />
</el-table>
</el-collapse-item>
</el-collapse>
</el-form>
@ -133,34 +98,88 @@
</template>
<script>
import req from '@/api/rawMaterialProcure/rawMaterialProcure'
import req from '@/api/oilTypeProcure/oilTypeProcure'
export default {
name: 'CustomerManagementInfo',
data() {
return {
temp: {} //
submitdisabled: false,
listLoading: false,
activeNames: ['1'],
formobj: {
sid: "",
orderNumber: "",
contractSigningDate: "",
arrivalDate: "",
supplierSid: "",
supplierName: "",
commodityList: [],
}
}
},
methods: {
submitData() {
console.log(">>>>>>>>>submit", this.formobj)
if (this.formobj.state = 5) {
//
} else {
//
req.procureAddSubmitInfo(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn("true")
} else {
// resp.code
}
})
.catch(() => {})
}
methods: {
showAdd(sid) {
req.fetchBySid(sid)
},
handleReturn(isreload) {
console.log(">>>>>>>>>")
if (isreload === 'true') this.$emit('reloadlist')
this.$emit('doback')
this.formobj = {
sid: "",
orderNumber: "",
contractSigningDate: "",
arrivalDate: "",
supplierSid: "",
supplierName: "",
commodityList: [],
}
},
showAdd(row) {
console.log(">>>>>>>>>", row)
req.procureFetchBySid(row.sid)
.then(resp => {
if (resp.success) {
this.temp = resp.data
this.formobj = resp.data
}
})
.catch(e => {
this.$emit('doback')
this.formobj = row
})
},
//
handleReturn() {
this.$emit('doback')
}
//
indexMethod(index) {
// var pagestart = (this.listQuery.current - 1) * this.listQuery.size
// var pageindex = index + 1 + pagestart
return index + 1
},
}
}
</script>

Loading…
Cancel
Save