|
@@ -23,12 +23,12 @@
|
|
|
filterable
|
|
|
>
|
|
|
<div slot="empty">无匹配数据</div>
|
|
|
- <Option :value="999">全部</Option>
|
|
|
+ <Option value="">全部</Option>
|
|
|
<Option
|
|
|
v-for="(i, index) in selectPurposeList"
|
|
|
- :value="index"
|
|
|
+ :value="i"
|
|
|
:key="index"
|
|
|
- >{{ i.purpose }}</Option
|
|
|
+ >{{ i }}</Option
|
|
|
>
|
|
|
</Select>
|
|
|
</Form-item>
|
|
@@ -36,8 +36,8 @@
|
|
|
<Select v-model="params.accountDate" style="width:150px" >
|
|
|
<div slot="empty">无匹配数据</div>
|
|
|
<Option value="">全部</Option>
|
|
|
- <Option v-for="(i,index) in accountDateList" :value="i.accountDate" :key="index">
|
|
|
- {{ i.accountDate + '天(' }}{{i.count}})
|
|
|
+ <Option v-for="(i,index) in accountDateList" :value="i.value" :key="index">
|
|
|
+ {{ i.label }}
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
@@ -45,8 +45,8 @@
|
|
|
<Select v-model="params.type" style="width:150px">
|
|
|
<div slot="empty">无匹配数据</div>
|
|
|
<Option value="">全部</Option>
|
|
|
- <Option v-for="(i,index) in safetyWarnDayList" :value="i.type" :key="index">
|
|
|
- {{ i.name + '(' }}{{i.count}})
|
|
|
+ <Option v-for="(i,index) in safetyWarnDayList" :value="i.value" :key="index">
|
|
|
+ {{ i.label }}
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
@@ -62,7 +62,7 @@
|
|
|
@click="params.type = i.value;changePage(1);"
|
|
|
:class="params.type == i.value ? 'active' : ''"
|
|
|
v-for="i in statisticsClassifyData"
|
|
|
- :key="i.value || 99">
|
|
|
+ :key="i.value">
|
|
|
{{i.label}}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -319,7 +319,7 @@ export default {
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '对公户名',
|
|
|
- key: 'bankAccoutName',
|
|
|
+ key: 'accountName',
|
|
|
placeholder: '请输入对公户名',
|
|
|
span: 12
|
|
|
},
|
|
@@ -344,21 +344,21 @@ export default {
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '对私户名',
|
|
|
- key: 'priOpenBank',
|
|
|
+ key: 'privateAccountName',
|
|
|
placeholder: '请输入对私户名',
|
|
|
span: 12
|
|
|
},
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '开户银行',
|
|
|
- key: 'priBankAccout',
|
|
|
+ key: 'privateOpenBank',
|
|
|
placeholder: '请输入开户银行',
|
|
|
span: 12
|
|
|
},
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '对私账号',
|
|
|
- key: 'priBankAccoutName',
|
|
|
+ key: 'privateBankAccount',
|
|
|
placeholder: '请输入对私账号',
|
|
|
span: 12
|
|
|
}
|
|
@@ -367,12 +367,12 @@ export default {
|
|
|
{
|
|
|
title: '维护记录',
|
|
|
type: 'picList',
|
|
|
- key: 'facPicList'
|
|
|
+ key: 'supplierKeepList'
|
|
|
},
|
|
|
{
|
|
|
title: '其他资质',
|
|
|
type: 'quaList',
|
|
|
- key: 'facquaList'
|
|
|
+ key: 'otherQualifications'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -559,7 +559,7 @@ export default {
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '对公户名',
|
|
|
- key: 'bankAccoutName',
|
|
|
+ key: 'accountName',
|
|
|
placeholder: '请输入对公户名',
|
|
|
span: 12
|
|
|
},
|
|
@@ -584,21 +584,21 @@ export default {
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '对私户名',
|
|
|
- key: 'priOpenBank',
|
|
|
+ key: 'privateAccountName',
|
|
|
placeholder: '请输入对私户名',
|
|
|
span: 12
|
|
|
},
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '开户银行',
|
|
|
- key: 'priBankAccout',
|
|
|
+ key: 'privateOpenBank',
|
|
|
placeholder: '请输入开户银行',
|
|
|
span: 12
|
|
|
},
|
|
|
{
|
|
|
type: 'input',
|
|
|
label: '对私账号',
|
|
|
- key: 'priBankAccoutName',
|
|
|
+ key: 'privateBankAccount',
|
|
|
placeholder: '请输入对私账号',
|
|
|
span: 12
|
|
|
}
|
|
@@ -833,7 +833,7 @@ export default {
|
|
|
type: 'input',
|
|
|
label: '对公户名',
|
|
|
disabled: true,
|
|
|
- key: 'bankAccoutName',
|
|
|
+ key: 'accountName',
|
|
|
placeholder: '请输入对公户名',
|
|
|
span: 12
|
|
|
},
|
|
@@ -861,7 +861,7 @@ export default {
|
|
|
type: 'input',
|
|
|
label: '对私户名',
|
|
|
disabled: true,
|
|
|
- key: 'priOpenBank',
|
|
|
+ key: 'privateAccountName',
|
|
|
placeholder: '请输入对私户名',
|
|
|
span: 12
|
|
|
},
|
|
@@ -869,7 +869,7 @@ export default {
|
|
|
type: 'input',
|
|
|
label: '开户银行',
|
|
|
disabled: true,
|
|
|
- key: 'priBankAccout',
|
|
|
+ key: 'privateOpenBank',
|
|
|
placeholder: '请输入开户银行',
|
|
|
span: 12
|
|
|
},
|
|
@@ -877,7 +877,7 @@ export default {
|
|
|
type: 'input',
|
|
|
label: '对私账号',
|
|
|
disabled: true,
|
|
|
- key: 'priBankAccoutName',
|
|
|
+ key: 'privateBankAccount',
|
|
|
placeholder: '请输入对私账号',
|
|
|
span: 12
|
|
|
}
|
|
@@ -918,7 +918,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '供应商名称',
|
|
|
- key: 'materialCode',
|
|
|
+ key: 'supplierName',
|
|
|
minWidth: 300,
|
|
|
render(h,p){
|
|
|
return h(renderListimgs,{
|
|
@@ -1025,8 +1025,8 @@ export default {
|
|
|
on: {
|
|
|
click: () => {
|
|
|
|
|
|
- axios.get('/cloudApi/supplier/detail?id=' + params.row.id,{}).then(res=>{
|
|
|
- this.formData = res.data.data
|
|
|
+ this.$post('/api/storage-restructure/supplier/details',{id:params.row.id}).then(res=>{
|
|
|
+ this.formData = res.data
|
|
|
|
|
|
this.formType = 'edit'
|
|
|
this.title = '修改'
|
|
@@ -1139,17 +1139,17 @@ export default {
|
|
|
methods: {
|
|
|
getSafetyWarnDayList(){
|
|
|
const v = this
|
|
|
- axios.post('/cloudApi/supplier/getSafetyWarnDayList',{}).then(res=>{
|
|
|
+ this.$post('/api/storage-restructure/supplier/getSafetyWarnDay',{}).then(res=>{
|
|
|
console.log(res)
|
|
|
- v.safetyWarnDayList = res.data.data
|
|
|
+ v.safetyWarnDayList = res.data
|
|
|
})
|
|
|
|
|
|
},
|
|
|
getAccountDateList(){
|
|
|
const v = this
|
|
|
- axios.post('/cloudApi/supplier/getAccountDateList',{}).then(res=>{
|
|
|
+ this.$post('/api/storage-restructure/supplier/getAccountDate',{}).then(res=>{
|
|
|
console.log(res)
|
|
|
- v.accountDateList = res.data.data
|
|
|
+ v.accountDateList = res.data
|
|
|
})
|
|
|
|
|
|
},
|
|
@@ -1165,18 +1165,36 @@ export default {
|
|
|
},
|
|
|
cfm (type, formData) {
|
|
|
if (type === 'add') {
|
|
|
- this.$post('/api/storage-restructure/supplier/add',formData).then(res=>{
|
|
|
+ const formDataCopy = {
|
|
|
+ ...formData,
|
|
|
+ supplierBank:{
|
|
|
+ accountName:formData.accountName,
|
|
|
+ openBank:formData.openBank,
|
|
|
+ bankAccount:formData.bankAccount,
|
|
|
+ privateAccountName:formData.privateAccountName,
|
|
|
+ privateOpenBank:formData.privateOpenBank,
|
|
|
+ privateBankAccount:formData.privateBankAccount,
|
|
|
+ },
|
|
|
+ supplierContacts:{
|
|
|
+ linkMen:formData.linkMen,
|
|
|
+ mobile:formData.mobile,
|
|
|
+ telephone:formData.telephone,
|
|
|
+ email:formData.email,
|
|
|
+ fax:formData.fax,
|
|
|
+ },
|
|
|
+ supplierKeepList:[],
|
|
|
+ otherQualifications:[],
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$post('/api/storage-restructure/supplier/add',formDataCopy).then(res=>{
|
|
|
this.show = false
|
|
|
this.$Message.info(res.data.msg)
|
|
|
- this.getList()
|
|
|
+ if(res.code === 200){
|
|
|
+ this.show = false
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
})
|
|
|
- // FactoryAdd(formData).then(res => {
|
|
|
- // if (res.code === 0) {
|
|
|
- // this.show = false
|
|
|
- // this.$Message.info(res.msg)
|
|
|
- // this.getList()
|
|
|
- // }
|
|
|
- // })
|
|
|
} else if (type === 'edit') {
|
|
|
|
|
|
axios.post('/cloudApi/supplier/edit',formData).then(res=>{
|
|
@@ -1216,19 +1234,22 @@ export default {
|
|
|
this.getList()
|
|
|
},
|
|
|
getMaterialCategoryZTree () {
|
|
|
- GetMaterialCategoryZTree().then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- let list = res.result.map(item => {
|
|
|
- return {
|
|
|
- label: item.name,
|
|
|
- value: item.value
|
|
|
- }
|
|
|
- })
|
|
|
- this.formConfig[2].list = list
|
|
|
- this.editFormConfig[2].list = list
|
|
|
- this.showFormConfig[2].list = list
|
|
|
- }
|
|
|
- })
|
|
|
+ this
|
|
|
+ .$post(
|
|
|
+ '/api/storage-restructure/materialClassify/tree')
|
|
|
+ .then((res) => {
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ const element = res.data[i];
|
|
|
+ element.label = element.name
|
|
|
+ element.value = element.id
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(res.data)
|
|
|
+ this.formConfig[2].list = res.data
|
|
|
+ this.editFormConfig[2].list = res.data
|
|
|
+ this.showFormConfig[2].list = res.data
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
getUserPageList () {
|
|
|
GetUserPageList({
|
|
@@ -1264,15 +1285,10 @@ export default {
|
|
|
getMaterialSelectPurposeList(){
|
|
|
const v = this
|
|
|
v.loading = true
|
|
|
- v.$post('/api/storage-restructure/supplier/getStatistics' + '', {})
|
|
|
+ v.$post('/api/storage-restructure/material/getPurpose', {})
|
|
|
.then((res) => {
|
|
|
- for (let i = 0; i < res.data.data.length; i++) {
|
|
|
- const element = res.data.data[i];
|
|
|
- if(element == ''){
|
|
|
- res.data.data.splice(i,1)
|
|
|
- }
|
|
|
- }
|
|
|
- v.selectPurposeList = res.data.data
|
|
|
+
|
|
|
+ v.selectPurposeList = res.data
|
|
|
v.loading = false
|
|
|
})
|
|
|
},
|
|
@@ -1293,25 +1309,55 @@ export default {
|
|
|
.$post(
|
|
|
'/api/storage-restructure/supplier/getStatistics',this.params)
|
|
|
.then((res) => {
|
|
|
- res.data.map(item => {
|
|
|
- if(!item.value) item.value = null
|
|
|
- })
|
|
|
+
|
|
|
this.statisticsClassifyData = res.data
|
|
|
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ //获取物料类型树
|
|
|
+ socketInit(){
|
|
|
+ var ws = new WebSocket("ws://36.134.91.96:10001/api/storage-restructure/webStock/123123");
|
|
|
+ //申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
|
|
|
+ ws.onopen = function(){
|
|
|
+ //当WebSocket创建成功时,触发onopen事件
|
|
|
+ console.log("open");
|
|
|
+ ws.send("hello"); //将消息发送到服务端
|
|
|
+ }
|
|
|
+ ws.onmessage = function(e){
|
|
|
+ //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
|
|
|
+ console.log(e.data,'1111111111111111111111111111')
|
|
|
+ var msg = JSON.parse(e.data)
|
|
|
+ if(msg.type == 1){
|
|
|
+
|
|
|
+ msg.data.instructions = 'test'
|
|
|
+ msg.data.type = '2'
|
|
|
+ msg.type = '2'
|
|
|
+ ws.send(JSON.stringify(msg));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ ws.onclose = function(e){
|
|
|
+ //当客户端收到服务端发送的关闭连接请求时,触发onclose事件
|
|
|
+ console.log("close");
|
|
|
+ }
|
|
|
+ ws.onerror = function(e){
|
|
|
+ //如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
},
|
|
|
mounted () {
|
|
|
this.getList()
|
|
|
// this.getUserPageList()
|
|
|
- // this.getMaterialCategoryZTree()
|
|
|
+ this.getMaterialCategoryZTree()
|
|
|
this.getStatisticsClassify()
|
|
|
// this.getSupplierSelectList()
|
|
|
- // this.getMaterialSelectPurposeList()
|
|
|
- // this.getAccountDateList()
|
|
|
- // this.getSafetyWarnDayList()
|
|
|
+ this.getMaterialSelectPurposeList()
|
|
|
+ this.getAccountDateList()
|
|
|
+ this.getSafetyWarnDayList()
|
|
|
+ //this.socketInit()
|
|
|
}
|
|
|
}
|
|
|
</script>
|