Browse Source

文件上传组件,批量修改有效期

master
[li_she] 5 years ago
parent
commit
695aca4547
  1. 3
      src/api/crollinfo/crollinfo.js
  2. 8
      src/views/modules/common/column.vue
  3. 14
      src/views/modules/common/search.vue
  4. 10
      src/views/modules/common/upload.vue
  5. 72
      src/views/modules/finishedProductWarehouse/expirationTimeModification.vue
  6. 2
      src/views/modules/finishedProductWarehouse/sluggishMaterialWarning.vue
  7. 10
      src/views/modules/oss/oss-upload.vue
  8. 1
      src/views/modules/oss/oss.vue
  9. 64
      src/views/modules/rawMaterials/expirationTimeModification.vue
  10. 2
      src/views/modules/rawMaterials/sluggishMaterialWarning.vue

3
src/api/crollinfo/crollinfo.js

@ -8,3 +8,6 @@ export const updateExpireddate = data => createAPI(`/finishedProduct/crollinfo/u
// 获取详情
export const infoRollno = data => createAPI(`/finishedProduct/crollinfo/infoRollno`,'post',data)
//批量修改有效期
export const batchUpdateExpireddate = data => createAPI(`/finishedProduct/crollinfo/batchUpdateExpireddate`,'post',data)

8
src/views/modules/common/column.vue

@ -50,6 +50,14 @@
<el-option value="date" label="date"></el-option>
</el-select>
</el-form-item>
<el-form-item>
位置
<el-select v-model="item.align" >
<el-option value="left" label="居左"></el-option>
<el-option value="center" label="居中"></el-option>
<el-option value="right" label="居右"></el-option>
</el-select>
</el-form-item>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">

14
src/views/modules/common/search.vue

@ -178,16 +178,16 @@ export default {
methods: {
//
searchCriteria() {
const loading = this.$loading({
lock: true,
text: '查询中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// const loading = this.$loading({
// lock: true,
// text: '',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
// });
var filter = this.userColumnList.filter(item => item.queryValue!="");
this.$emit('childByValue', filter)
setTimeout(() => {
loading.close();
// loading.close();
}, 2000);
},
//

10
src/views/modules/common/upload.vue

@ -28,16 +28,16 @@
},
methods: {
init (id) {
this.url = this.$http.adornUrl(`/sys/oss/upload?token=${this.$cookie.get('token')}`)
this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token')}`)
console.log(this.url)
this.visible = true
},
//
beforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error('只支持jpg、png、gif格式的图片!')
return false
}
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
// this.$message.error('jpgpnggif')
// return false
// }
this.num++
},
//

72
src/views/modules/finishedProductWarehouse/expirationTimeModification.vue

@ -6,16 +6,21 @@
</span>
</div>
<el-button @click="searchList()" type="primary">{{ buttons.search }}</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }}
</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button>
<el-button @click="updateExpDate()" type="primary">{{ buttons.updateExp }}
</el-button>
<el-table
ref="rollInfo"
:height="height"
:data="dataList"
border
:cell-style="{ padding: '2px' }"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
@ -40,23 +45,42 @@
width="150"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.rollno,scope.row.site)">修改失效日</a>
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.rollno,scope.row.site)">修改有效</a>
</template>
</el-table-column>
</el-table>
<!-- 设置查询条件 -->
<search v-if="searchVisible" v-on:childByValue="childByValue" ref="search" @refreshDataList="getDataList"></search>
<!-- 设置列 -->
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-dialog
:title="'修改有效期'"
:close-on-click-modal="false"
width="350px"
:visible.sync="updateExp">
<el-form ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-form-item label="失效日期" prop="expireddate">
<el-date-picker value-format="yyyy-MM-dd" v-model="expireddate" placeholder="失效日期"></el-date-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateExpSubmit()">确定</el-button>
<el-button @click="updateExp = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import AddOrUpdate from './crollinfo-add-or-update'
import {getCRollInfoList} from '@/api/crollinfo/crollinfo.js'
import {getCRollInfoList,batchUpdateExpireddate} from '@/api/crollinfo/crollinfo.js'
import column from "../common/column";
import search from "../common/search";
import {
@ -75,6 +99,8 @@ export default {
data() {
return {
searchVisible: false,
updateExp: false,
expireddate:'',
// table
height: 450,
//
@ -85,13 +111,10 @@ export default {
languageCode: this.$i18n.locale,
visible: false,
showDefault: false,
query:{
},
query: {},
//
sysLanguageParams: [],
columnList: [
],
columnList: [],
dataList: [],
buttons: {
add: '添加',
@ -102,7 +125,8 @@ export default {
search: '搜索',
download: '导出',
settingTable: '设置列表',
defaultTable: '设置默认配置'
defaultTable: '设置默认配置',
updateExp: '修改有效期'
},
dataListLoading: false,
dataListSelections: [],
@ -123,6 +147,36 @@ export default {
this.getDataList()
},
methods: {
//
updateExpDate() {
this.updateExp = true
},
//
updateExpSubmit() {
let rollInfoList = this.$refs.rollInfo.selection.map(item =>{
let rollInfo = {
site:item.site,
rollno: item.rollno,
expireddate: this.expireddate
}
return rollInfo;
})
batchUpdateExpireddate(rollInfoList).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.updateExp = false
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
},
childByValue(childValue) {
this.getDataList(childValue)
},

2
src/views/modules/finishedProductWarehouse/sluggishMaterialWarning.vue

@ -90,7 +90,7 @@
visible: false,
showDefault: false,
queryData: {
day: 30,
day: '',
rollno: '',
partno: ''
},

10
src/views/modules/oss/oss-upload.vue

@ -32,16 +32,16 @@
},
methods: {
init (id) {
this.url = this.$http.adornUrl(`/sys/oss/upload?token=${this.$cookie.get('token')}`)
this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token')}`)
console.log(this.url)
this.visible = true
},
//
beforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error('只支持jpg、png、gif格式的图片!')
return false
}
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
// this.$message.error('jpgpnggif')
// return false
// }
this.num++
},
//

1
src/views/modules/oss/oss.vue

@ -13,6 +13,7 @@
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column
prop="url"
header-align="center"

64
src/views/modules/rawMaterials/expirationTimeModification.vue

@ -9,12 +9,15 @@
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{buttons.defaultTable}}
</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button>
<el-button @click="updateExpDate()" type="primary">{{ buttons.updateExp }}</el-button>
<el-table
ref="rawRollInfo"
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
@ -39,7 +42,7 @@
width="150"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="update(scope.row)">修改有效期天数</a>
<a type="text" size="small" @click="update(scope.row)">修改有效期</a>
</template>
</el-table-column>
@ -50,12 +53,30 @@
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-dialog
:title="'修改有效期'"
:close-on-click-modal="false"
width="350px"
:visible.sync="updateExp">
<el-form ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-form-item label="失效日期" prop="expireddate">
<el-date-picker value-format="yyyy-MM-dd" v-model="expireddate" placeholder="失效日期"></el-date-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateExpSubmit()">确定</el-button>
<el-button @click="updateExp = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import AddOrUpdate from './crollinfo-add-or-update'
import {getCRollInfoList} from '@/api/crollinfo/crollinfo.js'
import {getCRollInfoList,batchUpdateExpireddate} from '@/api/crollinfo/crollinfo.js'
import column from "../common/column";
import search from "../common/search";
import {
@ -75,6 +96,8 @@ export default {
return {
searchVisible: false,
visible: false,
updateExp: false,
expireddate:'',
addOrUpdateVisible: false,
CRollInfo: {},
// table
@ -104,7 +127,8 @@ export default {
search: '搜索',
download: '导出',
settingTable: '设置列表',
defaultTable: '设置默认配置'
defaultTable: '设置默认配置',
updateExp: '修改有效期'
},
dataListLoading: false,
dataListSelections: [],
@ -125,6 +149,37 @@ export default {
this.getDataList()
},
methods: {
//
updateExpDate() {
this.updateExp = true
},
//
updateExpSubmit() {
let rollInfoList = this.$refs.rawRollInfo.selection.map(item =>{
let rollInfo = {
site:item.site,
rollno: item.rollno,
expireddate: this.expireddate
}
return rollInfo;
})
batchUpdateExpireddate(rollInfoList).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.updateExp = false
this.expireddate = ''
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
},
//
update(val){
this.CRollInfo = val
@ -167,9 +222,8 @@ export default {
//
childByValue(childValue) {
// childValue
console.log(childValue)
this.getDataList(childValue)
this.searchVisible = false;
},
//
favoriteIsOk(){

2
src/views/modules/rawMaterials/sluggishMaterialWarning.vue

@ -92,7 +92,7 @@ export default {
visible: false,
showDefault: false,
queryData: {
day: 30,
day: '',
rollno: '',
partno: ''
},

Loading…
Cancel
Save