|
|
@@ -10,6 +10,7 @@
|
|
|
ref="multipleTable"
|
|
|
:data="tableData"
|
|
|
size="small"
|
|
|
+ height="calc(100vh - 500px)"
|
|
|
stripe
|
|
|
border
|
|
|
@selection-change ="selectionChange">
|
|
|
@@ -98,9 +99,8 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
|
size="mini"
|
|
|
style="width:150px"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- @change="rowChange(scope.row)"
|
|
|
- @focus="setPickerOptions(scope.row)">
|
|
|
+ :picker-options="pickerOptions1"
|
|
|
+ @change="rowChange(scope.row)">
|
|
|
</el-date-picker>
|
|
|
<div v-else>
|
|
|
<p v-if="scope.row.delivery === 0 ">不管控交期</p>
|
|
|
@@ -156,16 +156,16 @@
|
|
|
<el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column
|
|
|
+ <el-table-column
|
|
|
prop="qty"
|
|
|
label="数量"
|
|
|
width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number :controls="true" controls-position='right' :step-strictly="true" v-if="data.status === '新建' && data.type !=='特殊订单'" size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" :step="scope.row.orderaddqty" label="输入数量" @change="rowChange(scope.row,scope.$index)"></el-input-number>
|
|
|
<el-input-number :controls="true" controls-position='right' :step-strictly="true" v-if="data.status === '新建' && data.type ==='特殊订单'" size="mini" v-model="scope.row.qty" label="输入数量" @change="rowChange(scope.row,scope.$index)"></el-input-number>
|
|
|
- <span v-else>{{scope.row.qty}}</span>
|
|
|
+ <!-- <span v-else>{{scope.row.qty}}</span> -->
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="marketprice"
|
|
|
label="牌价"
|
|
|
@@ -213,21 +213,16 @@
|
|
|
<p style="color:red;font-weight:500">¥ {{tool.formatAmount(scope.row.amount,2)}}</p>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="cansaleqty"
|
|
|
- label="库存数量"
|
|
|
- width="100">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="stockstatus"
|
|
|
- label="库存状态"
|
|
|
- width="100">
|
|
|
- </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="undeliqty"
|
|
|
label="未发货数量"
|
|
|
width="100">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="stockstatus"
|
|
|
+ label="库存状态"
|
|
|
+ width="100">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="invoiceamount"
|
|
|
label="已开票金额"
|
|
|
@@ -239,16 +234,40 @@
|
|
|
width="100">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ v-if="checkNB"
|
|
|
+ prop="stockname"
|
|
|
+ label="仓库"
|
|
|
+ width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.stockid" size="mini" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in stockOptions"
|
|
|
+ :key="item.stockid"
|
|
|
+ :label="item.stockname"
|
|
|
+ :value="item.stockid"
|
|
|
+ @click.native="rowChange(scope.row,scope.$index)">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-if="checkNB"
|
|
|
prop="position"
|
|
|
label="仓位"
|
|
|
- width="100">
|
|
|
+ width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input size="mini" v-model="scope.row.position" @input="rowChange(scope.row,scope.$index)" placeholder="输入仓位"></el-input>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ v-if="checkNB"
|
|
|
prop="batchno"
|
|
|
label="批号"
|
|
|
- width="100">
|
|
|
+ width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input size="mini" v-model="scope.row.batchno" @input="rowChange(scope.row,scope.$index)" placeholder="输入批号"></el-input>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
<el-table-column
|
|
|
label="备注"
|
|
|
width="300"
|
|
|
@@ -301,6 +320,16 @@ export default {
|
|
|
excel:() => import('../export_excel'),
|
|
|
addProduct
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ checkNB () {
|
|
|
+ let siteid = JSON.parse(sessionStorage.getItem('active_account')).siteid
|
|
|
+ if (siteid === 'NB' && this.data.type === '特殊订单' && this.data.typemx === '样品') {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
drawer:false,
|
|
|
@@ -321,15 +350,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
+ pickerOptions1: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
|
|
|
+ },
|
|
|
+ },
|
|
|
pickerOptions: {
|
|
|
disabledDate(time) {
|
|
|
- return time.getTime() < (Date.now() - 24 * 3600 * 1000);
|
|
|
+ return time.getTime() < (Date.now() - 48 * 3600 * 1000);
|
|
|
},
|
|
|
},
|
|
|
total:0,
|
|
|
currentPage:0,
|
|
|
time: null,
|
|
|
- value2:''
|
|
|
+ value2:'',
|
|
|
+ stockOptions:[]
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
@@ -363,19 +398,8 @@ export default {
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
},
|
|
|
- onInput (data,index) {
|
|
|
- // if (this.data.type !== '特殊订单') {
|
|
|
- // if(data.price > data.oldprice)
|
|
|
- // data.price = data.oldprice;
|
|
|
- // if(data.price < 0)
|
|
|
- // data.price = 0;
|
|
|
- // }
|
|
|
- this.$set(this.tableData,index,data)
|
|
|
- },
|
|
|
rowChange (val,index) {
|
|
|
let that = this
|
|
|
-
|
|
|
- // // 防抖
|
|
|
if(this.time !== null){
|
|
|
clearTimeout(this.time);
|
|
|
}
|
|
|
@@ -392,12 +416,15 @@ export default {
|
|
|
"needdate": val.needdate,//可以不传,修改交期
|
|
|
"price":val.price,
|
|
|
"remarks":val.remarks,
|
|
|
- "defaultprice":val.defaultprice
|
|
|
+ "defaultprice":val.defaultprice,
|
|
|
+ "stockid":val.stockid,
|
|
|
+ "position":val.position,
|
|
|
+ "batchno":val.batchno
|
|
|
}]
|
|
|
},()=>{
|
|
|
this.$set(this.tableData,index,val)
|
|
|
})
|
|
|
- },1000)
|
|
|
+ },500)
|
|
|
},
|
|
|
onDateChange (val){
|
|
|
let that = this
|
|
|
@@ -434,14 +461,25 @@ export default {
|
|
|
this.listData()
|
|
|
},
|
|
|
setPickerOptions (val) {
|
|
|
- var startDate = val.deliverydate
|
|
|
- startDate = startDate.replace(new RegExp("-","gm"),"/")
|
|
|
- var startDateM = (new Date(startDate)).getTime()
|
|
|
- this.pickerOptions = {
|
|
|
- disabledDate(time) {
|
|
|
- return time.getTime() < startDateM;
|
|
|
- },
|
|
|
+ /* 如果设置需求日 交期不能大于需求日 */
|
|
|
+ if (val.needdate) {
|
|
|
+ var startDate = val.needdate
|
|
|
+ startDate = startDate.replace(new RegExp("-","gm"),"/")
|
|
|
+ var startDateM = (new Date(startDate)).getTime()
|
|
|
+ this.pickerOptions = {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() > startDateM;
|
|
|
+ },
|
|
|
+ }
|
|
|
+ /* 否则不能小于今天 */
|
|
|
+ } else {
|
|
|
+ this.pickerOptions = {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
async dateChange (row) {
|
|
|
this.tableData = this.tableData.filter(e=>{
|
|
|
@@ -485,10 +523,14 @@ export default {
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
},
|
|
|
+ async queryStock () {
|
|
|
+ const res = await this.$store.dispatch('optiontypeselect','stockselect')
|
|
|
+ this.stockOptions = res.data
|
|
|
+ }
|
|
|
},
|
|
|
mounted () {
|
|
|
this.listData()
|
|
|
- console.log("表结构")
|
|
|
+ this.queryStock()
|
|
|
this.columnTitle = []
|
|
|
this.$refs.multipleTable.$children.forEach(obj => {
|
|
|
|
|
|
@@ -503,5 +545,7 @@ export default {
|
|
|
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
-
|
|
|
+/deep/.el-table__fixed, .el-table__fixed-right{
|
|
|
+height: calc(100% - 20px) !important;
|
|
|
+}
|
|
|
</style>
|