Commit 69564844 authored by 徐来柯's avatar 徐来柯

update

parent 6bcd53fc
......@@ -136,4 +136,9 @@
margin-left:10px;
}
}
}
.el-table .warning-row td {
background: #ff4949 !important;
color: #fff !important;
}
\ No newline at end of file
......@@ -111,6 +111,7 @@ const productManage = () =>
import('@/views/education/productManage.vue');
const ProductionPlan = () =>
import('@/views/education/ProductionPlan.vue');
// 生产排程统计页面
const ManageList = () =>
import('@/views/education/ManageList.vue');
const ProducSchedule = () =>
......
<!--
* @Description: 这是***页面(组件)
* @Date: 2020-08-10 09:10:53
* @Author: Tao
* @LastEditors: Tao
* @LastEditTime: 2020-08-27 11:01:37
-->
<template>
<div class="lineBox">
<div class="LineCenten">
<Head type="12"></Head>
<div class="conterFool_middle" style="width:98%;margin:auto">
<el-table
border
height="675"
class="conterFool_middle"
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
style="width: 100%">
<el-table-column
label="序号"
:show-overflow-tooltip="true"
width="185"
prop="NO">
</el-table-column>
<el-table-column
label="生产计划编号"
:show-overflow-tooltip="true"
width="185"
prop="PlanNO">
</el-table-column>
<el-table-column
label="产品编号"
:show-overflow-tooltip="true"
width="185"
prop="Num">
</el-table-column>
<el-table-column
label="产品名称"
:show-overflow-tooltip="true"
prop="ProductName"
width="300">
</el-table-column>
<el-table-column
prop="ProductDescirbe"
label="产品描述"
:show-overflow-tooltip="true"
width="310">
</el-table-column>
<el-table-column
prop="unit"
label="单位"
:show-overflow-tooltip="true"
width="310">
</el-table-column>
<el-table-column
label="计划交货日期"
:show-overflow-tooltip="true"
prop="PlanDay"
width="310">
</el-table-column>
<el-table-column
label="计划数量"
:show-overflow-tooltip="true"
prop="PlanCount"
width="185">
</el-table-column>
<el-table-column
label="排程数量"
:show-overflow-tooltip="true"
prop="PaiCount"
width="185">
</el-table-column>
<el-table-column
label="完工数量"
:show-overflow-tooltip="true"
prop="FinishCount"
width="185">
</el-table-column>
<el-table-column
label="实际完工日期"
:show-overflow-tooltip="true"
prop="finishDay"
width="300">
</el-table-column>
<el-table-column
label="生产计划状态"
:show-overflow-tooltip="true"
prop="status"
width="210"
>
</el-table-column>
</el-table>
</div>
<div class="box-container">
<div class="wrap">
<search-form :formList="[1,2]" :searchList="searchList" :formData="formData" @searchData="searchData" />
<el-table
border
height="675"
ref="multipleTable"
:data="tableData"
class="table-style"
tooltip-effect="dark"
style="width: 100%"
:row-class-name="tableRowClassName"
>
<el-table-column
label="序号"
:show-overflow-tooltip="true"
width="80"
prop="NO">
</el-table-column>
<el-table-column
label="生产排程编号"
:show-overflow-tooltip="true"
prop="PlanID"
width="180">
</el-table-column>
<el-table-column
prop="ProductID"
label="产品编号"
:show-overflow-tooltip="true"
width="180">
</el-table-column>
<el-table-column
label="产品名称"
:show-overflow-tooltip="true"
prop="ProductName"
width="180">
</el-table-column>
<el-table-column
label="产品描述"
:show-overflow-tooltip="true"
prop="Pdesc"
width="180">
</el-table-column>
<el-table-column
label="单位"
:show-overflow-tooltip="true"
prop="Prounit"
width="180">
</el-table-column>
<el-table-column
label="计划交货日期"
:show-overflow-tooltip="true"
prop="DeliveryDt"
width="210">
</el-table-column>
<el-table-column
label="排程数量"
:show-overflow-tooltip="true"
prop="Quantity"
width="140">
</el-table-column>
<el-table-column
label="完工数量"
:show-overflow-tooltip="true"
prop="FinishQuantity"
width="180">
<template slot-scope="scope" >
<span>{{scope.row.FinishQuantity}}</span>
<span @click="openRelate('FinishQuantity',scope.row)" class="relateBtn plan_relateBtn" >选 择</span>
</template>
</el-table-column>
<el-table-column
label="实际开工日期"
:show-overflow-tooltip="true"
prop="StartDt"
width="180"
>
</el-table-column>
<el-table-column
label="实际完工日期"
:show-overflow-tooltip="true"
prop="EndDt"
width="180"
>
</el-table-column>
<el-table-column
label="生产排程状态"
:show-overflow-tooltip="true"
prop="TextStatus"
width="180">
</el-table-column>
</el-table>
<div class="conterFool_bottom">
<div @click="jump" class="bottom_jump">跳转</div>
<div class="bottom_input">
<span></span>
<input v-model="num" @input="jumpInp()" class="text" type="text"/>
<span></span>
</div>
<div @click="end" class="bottom_end"> 末页</div>
<div ref="next" @click="next" class="bottom_next">下一页</div>
<div ref="last" @click="last" class="bottom_last">上一页</div>
<div @click="firest" class="bottom_firest">首页</div>
<div class="bottom_text">
<span>{{TotalCount}}条记录 当前第{{PageIndex}}页 共{{TotalPage}}页 每页{{PageSize}}条记录</span>
</div>
</div>
</div>
<Pagination ref="page" :totalCount="totalCount" :totalPage="totalPage" @pageFun="pageFun" />
<deletePop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></deletePop>
<div v-if="popShow || deleteShow" class="box"></div>
</div>
<delete-pop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></delete-pop>
<relate-dialog v-if="relateShow" :relateType="relateType" @conserve="saveData" @closeDialog="closeDialog" />
</div>
</template>
<script>
import Head from './component/head.vue'
import searchForm from './component/searchForm'
import deletePop from './component/deletePop'
import Pagination from './component/Pagination.vue'
import relateDialog from './component/relateDialog'
export default {
components:{
Head,
deletePop
},
data() {
return {
tableData:[],
AllTableData:[],
ss:'',
num:1,
TotalCount:1,
PageIndex:1,
TotalPage:1,
PageSize:50,
deleteShow:false,
popShow:false,
CheckDeleteShow:true,
argKeyWord:'',
deletetext:'',
itemdata:[],
deleteRowData:[],
deleteManyData:[],
typeV:'',
type:'',
}
},
props:[],
watch:{},
created(){
this.query()
components: { searchForm, relateDialog, Pagination },
data () {
return {
tableData: [],
AllTableData: [],
cloneData: [],
popShow: false,
relateShow: false,
checkList: [],
ID: null,
searchList: [
{
id: '不限',
name: ''
},
{
id: '生产计划编号',
name: '生产计划编号'
},
{
id: '产品编号',
name: '产品编号'
},
{
id: '产品名称',
name: '产品名称'
},
{
id: '产品描述',
name: '产品描述'
},
{
id: '计划交货日期',
name: '计划交货日期'
},
{
id: '实际完工日期',
name: '实际完工日期'
},
{
id: '生产计划状态',
name: '生产计划状态'
},
],
deletetext: '',
deleteShow: false,
typeV: '',
relateType: '',
formData: {
argKeyWord: '',
argWhere: '',
dateValue: [this.$moment().format('YYYY-MM-DD 00:00:00'), this.$moment().format('YYYY-MM-DD 23:59:59')],
scanValue: '',
},
methods:{
//查询
query(){
console.log('请求')
this.$axios({
method:"post",
url:`/api/TJStatistics/Statistics_Query?argKeyWord=${this.argKeyWord}`,
}).then((res)=>{
console.log('res==>',res)
if(res.data.data.length != 0 ){
for(let i=0;i<res.data.data.length;i++){
res.data.data[i].UpdateTime = this.$moment(res.data.data[i].UpdateTime).format('YYYY-MM-DD HH:mm:ss')
}
this.AllTableData = res.data.data
if(this.AllTableData.length >50){
this.tableData = this.AllTableData.slice(0,50)
}else{
this.tableData = this.AllTableData
}
this.TotalCount = this.AllTableData.length
this.PageIndex = 1
this.TotalPage = Math.ceil(this.AllTableData.length / 50)
}else{
this.tableData = []
this.TotalCount = 0
this.PageIndex = 1
this.TotalPage = 1
}
}).catch(function(err){
console.log('err',err)
})
},
//查询值
textFun(text){
this.argKeyWord=text
},
// 分页方法
pageFun(num){
if(num == 1){
this.tableData = this.AllTableData.slice(0,50)
}else{
this.tableData = this.AllTableData.slice((num-1)*this.PageSize + 1,this.PageSize*num)
}
},
//上一页颜色
lastColor(text){
if(text == '1'){
this.$refs.last.style.color = '#F9D79C'
this.$refs.last.style.borderColor = '#F8CA7A'
this.$refs.last.style.background = '#F9F9F9'
}else{
this.$refs.last.style.color = '#FDA100'
this.$refs.last.style.borderColor = '#FDA100'
this.$refs.last.style.background = '#fff'
}
},
//下一页颜色
nextColor(text){
if(text == '1'){
this.$refs.next.style.color = '#F9D79C'
this.$refs.next.style.borderColor = '#F8CA7A'
this.$refs.next.style.background = '#F9F9F9'
// 分页数据
totalCount: 0,
// pageIndex: 1,
totalPage: 1
}
},
created() {
this.searchData()
},
methods: {
searchData () {
var $this = this
var postData = this.resetData()
this.$axios({
method:"post",
url:`/api/StatisticsManage/StatisticsManage_Query?argKeyWord=${postData.argKeyWord}&argWhere=${postData.argWhere}&Stime=${postData.Stime}&Etime=${postData.Etime}`,
}).then((res)=>{
if(res.data.data.length != 0 ){
this.AllTableData = res.data.data.map(item => ({
...item,
DeliveryDt: item.DeliveryDt ? this.$moment(item.DeliveryDt).format('YYYY-MM-DD HH:mm:ss') : '',
EndDt: item.EndDt ? this.$moment(item.EndDt ).format('YYYY-MM-DD HH:mm:ss') : ''
}))
// 克隆一份tableData数据
this.cloneData= JSON.parse(JSON.stringify(this.AllTableData))
if(this.AllTableData.length > this.$refs.page.pageSize){
this.tableData = this.AllTableData.slice(0, this.$refs.page.pageSize)
}else{
this.$refs.next.style.color = '#FDA100'
this.$refs.next.style.borderColor = '#FDA100'
this.$refs.next.style.background = '#fff'
}
},
//跳转
jump(){
if(this.PageIndex != this.num){
if(this.num>this.TotalPage || this.num < 1){
this.typeV = '3'
this.deleteShow = true
}else{
this.PageIndex = this.num
this.pageFun(this.PageIndex)
}
if(this.PageIndex == 1){
this.lastColor('1')
this.nextColor('2')
}
if(this.PageIndex == this.TotalPage){
this.nextColor('1')
this.lastColor('2')
}
}
},
//末页
end(){
this.PageIndex = this.TotalPage
this.num = this.PageIndex
this.nextColor('1')
this.lastColor('2')
this.pageFun(this.PageIndex)
},
//下一页
next(){
if(this.PageIndex<this.TotalPage){
this.nextColor('2')
this.lastColor('2')
this.PageIndex = this.PageIndex + 1
this.num = this.PageIndex
this.pageFun(this.PageIndex)
if(this.PageIndex == this.TotalPage){
this.nextColor('1')
}
this.tableData = this.AllTableData
}
},
//上一页
last(){
if(this.PageIndex>1){
this.nextColor('2')
this.lastColor('2')
this.PageIndex = this.PageIndex - 1
this.num = this.PageIndex
this.pageFun(this.PageIndex)
if(this.PageIndex == 1){
this.lastColor('1')
}
}
},
//首页
firest(){
this.PageIndex = 1
this.num = this.PageIndex
this.nextColor('2')
this.lastColor('1')
this.pageFun(this.PageIndex)
},
jumpInp(){
this.num = parseInt(this.num)
if(String(this.num) == 'NaN'){
this.num = ''
}
},
this.totalCount = this.AllTableData.length
// this.pageIndex = 1
this.totalPage = Math.ceil(this.AllTableData.length / this.$refs.page.pageSize)
}else{
this.tableData = []
this.totalCount = 0
// this.pageIndex = 1
this.totalPage = 1
}
this.pageFun(1)
}).catch(function(err){
console.log('err',err)
})
},
tableRowClassName({row, rowIndex}) {
row.EndDt = row.EndDt === '' ? 0: row.EndDt
row.DeliveryDt = row.DeliveryDt === '' ? 0 : row.DeliveryDt
if (new Date(row.EndDt).getTime() > new Date(row.DeliveryDt).getTime()) {
return 'warning-row'
}
}
</script>
<style lang="scss">
.LineCenten{
.el-table__header-wrapper{
background: #5A6C98;
}
.el-table th.is-leaf{
background: #5A6C98;
color:#fff;
return '';
},
closeDialog () {
this.relateShow = false
},
saveData (data) {
var $this = this
this.$axios({
method:"post",
url:`/api/ProductStorage/ProductStorage_WindowAddSave?ID=${this.ID}&VFinish=${data.Name}`,
data:data
}).then((res)=>{
$this.relateShow = false
var postData = $this.resetData()
$this.searchData(postData)
})
},
openRelate (type, row ) {
this.ID = row.ID
this.relateType = type
this.relateShow = true
},
// 分页方法
pageFun(num){
if(num == 1){
this.tableData = this.cloneData.slice(0, this.$refs.page.pageSize)
}else{
this.tableData = this.cloneData.slice((num-1)*this.$refs.page.pageSize,this.$refs.page.pageSize*num)
}
},
resetData () {
return {
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
},
//关闭提示弹窗
cancel_delete(){
this.deleteShow = false
},
conserve (data) {
var $this = this
this.$axios({
method:"post",
url:`/api/ProductStorage/ProductStorage_WindowAddSave`,
data:data
}).then((res)=>{
if(res.data.code != 0){
$this.typeV = '5'
$this.deleteShow = true
}else{
$this.typeV = '6'
$this.popShow = false
}
$this.deletetext = res.data.msg
var postData = $this.resetData()
$this.searchData(postData)
}).catch(function(err){
console.log('err',err)
})
}
}
.el-table td, .el-table th.is-leaf{
text-align: center;
}
.el-table--border th{
border:1px solid #EBEEF5;
}
}
</style>
</script>
<style lang="scss" scoped>
.lineBox{
position: relative;
margin-top:100px;
width:100%;
height:calc(100vh - 130px);
background: #EEEEEE;
padding-top:10px;
.box{
width:100%;
height:100%;
position: absolute;
top: 0;
left:0;
right:0;
bottom:0;
margin: auto;
z-index: 9;
}
.table_remove,.table_edit{
width:60px;
height:30px;
background:rgba(255,255,255,1);
border:2px solid rgba(228,228,228,1);
border-radius:15px;
position: relative;
.relateBtn {
width: 75px;
height: 35px;
display: inline-block;
margin-left:8px;
margin-left: 20px;
text-align: center;
line-height: 35px;
cursor: pointer;
}
.remove_img{
position: absolute;
top:0;
left:0;
bottom:0;
right:0;
margin:auto;
width:20px;
height: 20px;
background: url('../../assets/images/icon_dell.png');
background-size:cover ;
}
.edit_img{
position: absolute;
top:0;
left:0;
bottom:0;
right:0;
margin:auto;
width:18px;
height:20px;
background: url('../../assets/images/icon_pensoil.png');
background-size:cover ;
}
.LineCenten{
width:98%;
height: 98%;
margin:auto;
background: #fff;
padding-top:24px;
}
.head{
margin-bottom:20px;
box-sizing: border-box;
}
}
.conterFool_bottom{
width:97%;
margin: auto;
height:60px;
padding-top:15px;
user-select: none;
.bottom_text{
float: left;
color:#929292;
font-size: 14px;
}
.bottom_firest{
width:65px;
height:30px;
line-height: 28px;
text-align:center;
color:#FDA100;
border: 1px solid #FDA100;
box-sizing: border-box;
float: right;
border-radius: 5px;
margin-left:10px;
cursor: pointer;
}
.bottom_last{
cursor: pointer;
width:80px;
height:30px;
line-height: 28px;
text-align:center;
color:#F9D79C;
border: 1px solid #F8CA7A;
box-sizing: border-box;
background: #f9f9f9;
float: right;
border-radius: 5px;
margin-left:10px;
}
.bottom_next{
cursor: pointer;
float: right;
width:80px;
height:30px;
line-height: 28px;
text-align:center;
color:#FDA100;
border: 1px solid #FDA100;
box-sizing: border-box;
border-radius: 5px;
margin-left:10px;
}
.bottom_end{
cursor: pointer;
float: right;
width:80px;
height:30px;
line-height: 28px;
text-align:center;
color:#FDA100;
border: 1px solid #FDA100;
box-sizing: border-box;
border-radius: 5px;
margin-left:10px;
}
.bottom_input{
float: right;
margin-left:10px;
color:#9C9C9C;
.text{
display: inline-block;
width:65px;
height:30px;
margin:0 5px;
text-align: center;
color:#FDA100;
}
}
.bottom_jump{
cursor: pointer;
float: right;
width:80px;
height:30px;
line-height: 28px;
text-align:center;
color:#FDA100;
border: 1px solid #FDA100;
box-sizing: border-box;
border-radius: 5px;
margin-left:10px;
}
background:rgba(255,255,255,1);
border:1px solid rgba(37,92,193,1);
border-radius:4px;
box-sizing: border-box;
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
color:rgba(51,51,51,1);
}
</style>
\ No newline at end of file
......@@ -95,7 +95,9 @@ export default {
},
created () {
this.$nextTick(() => {
this.$refs.codeInput.focus()
if (this.$refs.codeInput) {
this.$refs.codeInput.focus()
}
})
},
methods: {
......
......@@ -247,7 +247,7 @@ export default {
return
}
}
if (this.relateType === 'VPlanQuantity') {
if (this.relateType === 'VPlanQuantity' || this.relateType === 'FinishQuantity') {
if (this.currentRow.DateType.indexOf('整型') !== -1) {
return this.$emit('conserve', this.currentRow, this.relateType)
} else {
......
<template>
<div class="box-container">
<div class="wrap">
<search-form :formList="[1,2]" :searchList="searchList" :formData="formData" @scanGunCode="scanGunCode" @searchData="searchData" @openDialog="openDialog" @delData="delData" />
<search-form :formList="[1,2]" :searchList="searchList" :formData="formData" @searchData="searchData" />
<el-table
border
height="675"
......@@ -10,11 +10,8 @@
class="table-style"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="60">
</el-table-column>
:row-class-name="tableRowClassName"
>
<el-table-column
label="序号"
:show-overflow-tooltip="true"
......@@ -93,19 +90,17 @@
<Pagination ref="page" :totalCount="totalCount" :totalPage="totalPage" @pageFun="pageFun" />
</div>
<store-dialog :titleText="'产品入库单'" :titleType="'pro'" v-if="popShow" @closeDialog="closeDialog" @conserve="conserve" />
<delete-pop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></delete-pop>
</div>
</template>
<script>
import searchForm from './component/searchForm'
import storeDialog from './component/storeDialog'
import deletePop from './component/deletePop'
import Pagination from './component/Pagination.vue'
export default {
components: { searchForm, storeDialog, deletePop, Pagination },
components: { searchForm, Pagination },
data () {
return {
tableData: [],
......@@ -166,7 +161,7 @@ export default {
this.searchData()
},
methods: {
searchData () {
searchData () {
var $this = this
var postData = this.resetData()
this.$axios({
......@@ -200,8 +195,13 @@ export default {
console.log('err',err)
})
},
handleSelectionChange (val) {
this.checkList = val
tableRowClassName({row, rowIndex}) {
row.EndDt = row.EndDt === '' ? 0: row.EndDt
row.DeliveryDt = row.DeliveryDt === '' ? 0 : row.DeliveryDt
if (new Date(row.EndDt).getTime() > new Date(row.DeliveryDt).getTime()) {
return 'warning-row'
}
return '';
},
// 分页方法
pageFun(num){
......@@ -211,25 +211,6 @@ export default {
this.tableData = this.cloneData.slice((num-1)*this.$refs.page.pageSize,this.$refs.page.pageSize*num)
}
},
// 扫码枪扫码
scanGunCode(value) {
console.log('开始扫码。。。')
this.$axios({
method:"post",
url:`/api/ProductStorage/ProductStorage_ScanCodeAdd?ScanCode=${value}`,
}).then((res)=>{
console.log('扫码成功。。。')
var postData = {
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
this.searchData(this.postData)
}).catch(() => {
console.log('扫码失败。。。')
})
},
resetData () {
return {
argKeyWord: this.formData.argKeyWord,
......@@ -238,36 +219,12 @@ export default {
Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
},
delData () {
var $this = this
if ($this.checkList.length === 0) {
$this.deleteShow = true
$this.typeV = 2
} else {
var list = []
$this.checkList.forEach((item) => {
list.push(item.ID)
})
$this.$axios({
method:"post",
url:`/api/ProductStorage/ProductStorage_Delete`,
data:list
}).then((res)=>{
var postData = $this.resetData()
$this.searchData(postData)
})
}
},
//关闭提示弹窗
cancel_delete(){
this.deleteShow = false
},
openDialog () {
this.popShow = true
},
closeDialog () {
this.popShow = false
},
conserve (data) {
var $this = this
this.$axios({
......@@ -291,4 +248,5 @@ export default {
}
}
}
</script>
\ No newline at end of file
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment