|
@@ -19,11 +19,11 @@
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
|
|
|
<a-row :gutter="24">
|
|
|
- <a-col :md="8" :sm="8">
|
|
|
+ <!-- <a-col :md="8" :sm="8">
|
|
|
<a-form-model-item label="编号" prop="code">
|
|
|
<a-input placeholder="请输入" v-model="formState.code" />
|
|
|
</a-form-model-item>
|
|
|
- </a-col>
|
|
|
+ </a-col> -->
|
|
|
<a-col :md="8" :sm="8">
|
|
|
<a-form-model-item label="名称" prop="name">
|
|
|
<a-input placeholder="请输入名称" v-model="formState.name"/>
|
|
@@ -85,25 +85,21 @@
|
|
|
<span slot="orderDateTitle" class="form-table-heard">
|
|
|
日期
|
|
|
</span>
|
|
|
- <!-- 表头--总件数 -->
|
|
|
- <span slot="allNumTitle" class="form-table-heard">
|
|
|
- 总件数
|
|
|
+ <!-- 表头--明细 -->
|
|
|
+ <span slot="detailedNumTitle" class="form-table-heard">
|
|
|
+ 明细
|
|
|
</span>
|
|
|
<!-- 表头--集装箱号 -->
|
|
|
<span slot="containerNoTitle" class="form-table-heard">
|
|
|
集装箱号
|
|
|
</span>
|
|
|
- <!-- 表头--发票号 -->
|
|
|
- <span slot="invoiceNoTitle" class="form-table-heard">
|
|
|
- 发票号
|
|
|
- </span>
|
|
|
- <!-- 表头--价格 -->
|
|
|
- <span slot="priceTitle" class="form-table-heard">
|
|
|
- 价格
|
|
|
+ <!-- 表头--总价 -->
|
|
|
+ <span slot="totalPriceTitle" class="form-table-heard">
|
|
|
+ 总价
|
|
|
</span>
|
|
|
- <!-- 表头--计划员 -->
|
|
|
- <span slot="jhyByDataTitle" class="form-table-heard">
|
|
|
- 计划员
|
|
|
+ <!-- 表头--原因 -->
|
|
|
+ <span slot="reasonTitle" class="form-table-heard">
|
|
|
+ 原因
|
|
|
</span>
|
|
|
<!-- 日期 -->
|
|
|
<span slot="orderDate" slot-scope="text, record,index">
|
|
@@ -116,25 +112,33 @@
|
|
|
<span slot="allNum" slot-scope="text, record, index">
|
|
|
<a-input placeholder="请输入" v-model="record.allNum" />
|
|
|
</span>
|
|
|
+ <!-- 柜子数量 -->
|
|
|
+ <span slot="cabinets" slot-scope="text, record, index">
|
|
|
+ <a-input placeholder="请输入" v-model="record.cabinets" />
|
|
|
+ </span>
|
|
|
<!-- 明细 -->
|
|
|
<span slot="detailedNum" slot-scope="text, record, index">
|
|
|
- <a-input placeholder="请输入" v-model="record.detailedNum" />
|
|
|
+ <a-input placeholder="请输入" v-model="record.detailedNum" @change="handleChangePrice(record)"/>
|
|
|
</span>
|
|
|
- <!-- 衣架 -->
|
|
|
+ <!-- 衣架/吨数 -->
|
|
|
<span slot="coatHanger" slot-scope="text, record, index">
|
|
|
- <a-input placeholder="请输入" v-model="record.coatHanger" />
|
|
|
+ <a-input placeholder="请输入" v-model="record.coatHanger" @change="handleChangePrice(record)"/>
|
|
|
</span>
|
|
|
<!-- 集装箱号 -->
|
|
|
<span slot="containerNo" slot-scope="text, record, index">
|
|
|
<a-input placeholder="请输入" v-model="record.containerNo" />
|
|
|
</span>
|
|
|
- <!-- 发票号 -->
|
|
|
+ <!-- 入库单号/发票号 -->
|
|
|
<span slot="invoiceNo" slot-scope="text, record, index">
|
|
|
<a-input placeholder="请输入" v-model="record.invoiceNo" />
|
|
|
</span>
|
|
|
<!-- 价格 -->
|
|
|
<span slot="price" slot-scope="text, record, index">
|
|
|
- <a-input placeholder="请输入" v-model="record.price" @change="handleChangePrice"/>
|
|
|
+ <a-input placeholder="请输入" v-model="record.price" @change="handleChangePrice(record)"/>
|
|
|
+ </span>
|
|
|
+ <!-- 总价 -->
|
|
|
+ <span slot="totalPrice" slot-scope="text, record, index">
|
|
|
+ <a-input placeholder="请输入" v-model="record.totalPrice" />
|
|
|
</span>
|
|
|
<!-- 计划员 -->
|
|
|
<span slot="jhyByData" slot-scope="text, record, index">
|
|
@@ -149,10 +153,17 @@
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</span>
|
|
|
+ <!-- 原因 -->
|
|
|
+ <span slot="reason" slot-scope="text, record, index">
|
|
|
+ <a-input placeholder="请输入" v-model="record.reason" />
|
|
|
+ </span>
|
|
|
<!-- 备注 -->
|
|
|
<span slot="demo" slot-scope="text, record, index">
|
|
|
<a-input placeholder="请输入" v-model="record.demo" />
|
|
|
</span>
|
|
|
+ <span slot="option" slot-scope="text, record, index">
|
|
|
+ <a @click="copyRow(record)">复制</a>
|
|
|
+ </span>
|
|
|
</a-table>
|
|
|
<!-- <j-editable-table
|
|
|
:ref="refKeys[0]"
|
|
@@ -227,30 +238,46 @@
|
|
|
// title: '日期',
|
|
|
align: "center",
|
|
|
dataIndex: 'orderDate',
|
|
|
- width: '9%',
|
|
|
+ width: '7%',
|
|
|
scopedSlots: { customRender: 'orderDate' },
|
|
|
slots:{title:'orderDateTitle'}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '入库单号/发票号',
|
|
|
+ align: "center",
|
|
|
+ dataIndex: 'invoiceNo',
|
|
|
+ width: '9%',
|
|
|
+ scopedSlots: { customRender: 'invoiceNo' },
|
|
|
},
|
|
|
{
|
|
|
- // title: '总件数',
|
|
|
+ title: '总件数',
|
|
|
dataIndex: 'allNum',
|
|
|
- width: '9%',
|
|
|
+ width: '7%',
|
|
|
scopedSlots: { customRender: 'allNum' },
|
|
|
className: 'replacecolor',
|
|
|
- slots:{title:'allNumTitle'}
|
|
|
+ // slots:{title:'allNumTitle'}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '柜子数量',
|
|
|
+ dataIndex: 'cabinets',
|
|
|
+ width: '7%',
|
|
|
+ ellipsis: true,
|
|
|
+ scopedSlots: { customRender: 'cabinets' },
|
|
|
+ className: 'replacecolor'
|
|
|
},
|
|
|
{
|
|
|
- title: '明细',
|
|
|
+ // title: '明细',
|
|
|
dataIndex: 'detailedNum',
|
|
|
- width: '9%',
|
|
|
+ width: '7%',
|
|
|
ellipsis: true,
|
|
|
scopedSlots: { customRender: 'detailedNum' },
|
|
|
- className: 'replacecolor'
|
|
|
+ className: 'replacecolor',
|
|
|
+ slots:{title:'detailedNumTitle'}
|
|
|
},
|
|
|
{
|
|
|
- title: '衣架',
|
|
|
+ title: '衣架/吨数',
|
|
|
dataIndex: 'coatHanger',
|
|
|
- width: '9%',
|
|
|
+ width: '7%',
|
|
|
ellipsis: true,
|
|
|
scopedSlots: { customRender: 'coatHanger' },
|
|
|
className: 'replacecolor'
|
|
@@ -258,54 +285,80 @@
|
|
|
{
|
|
|
// title: '集装箱号',
|
|
|
dataIndex: 'containerNo',
|
|
|
- width: '9%',
|
|
|
+ width: '7%',
|
|
|
ellipsis: true,
|
|
|
scopedSlots: { customRender: 'containerNo' },
|
|
|
className: 'replacecolor',
|
|
|
slots:{title:'containerNoTitle'}
|
|
|
},
|
|
|
+ // {
|
|
|
+ // // title: '发票号',
|
|
|
+ // dataIndex: 'invoiceNo',
|
|
|
+ // width: '9%',
|
|
|
+ // ellipsis: true,
|
|
|
+ // scopedSlots: { customRender: 'invoiceNo' },
|
|
|
+ // className: 'replacecolor',
|
|
|
+ // slots:{title:'invoiceNoTitle'}
|
|
|
+ // },
|
|
|
{
|
|
|
- // title: '发票号',
|
|
|
- dataIndex: 'invoiceNo',
|
|
|
- width: '9%',
|
|
|
+ title: '单价',
|
|
|
+ dataIndex: 'price',
|
|
|
+ width: '6%',
|
|
|
ellipsis: true,
|
|
|
- scopedSlots: { customRender: 'invoiceNo' },
|
|
|
+ scopedSlots: { customRender: 'price' },
|
|
|
className: 'replacecolor',
|
|
|
- slots:{title:'invoiceNoTitle'}
|
|
|
+ // slots:{title:'priceTitle'}
|
|
|
},
|
|
|
- {
|
|
|
- // title: '价格',
|
|
|
- dataIndex: 'price',
|
|
|
- width: '9%',
|
|
|
+ {
|
|
|
+ // title: '总价',
|
|
|
+ dataIndex: 'totalPrice',
|
|
|
+ width: '6%',
|
|
|
ellipsis: true,
|
|
|
- scopedSlots: { customRender: 'price' },
|
|
|
+ scopedSlots: { customRender: 'totalPrice' },
|
|
|
className: 'replacecolor',
|
|
|
- slots:{title:'priceTitle'}
|
|
|
+ slots:{title:'totalPriceTitle'}
|
|
|
},
|
|
|
{
|
|
|
- // title: '计划员',
|
|
|
+ title: '计划员',
|
|
|
dataIndex: 'jhyByData',
|
|
|
- width: '13%',
|
|
|
+ width: '8%',
|
|
|
ellipsis: true,
|
|
|
scopedSlots: { customRender: 'jhyByData' },
|
|
|
className: 'replacecolor',
|
|
|
- slots:{title:'jhyByDataTitle'}
|
|
|
+ // slots:{title:'jhyByDataTitle'}
|
|
|
},
|
|
|
{
|
|
|
title: '签名',
|
|
|
dataIndex: 'jhyName',
|
|
|
- width: '11%',
|
|
|
+ width: '7%',
|
|
|
ellipsis: true,
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
+ {
|
|
|
+ // title: '原因',
|
|
|
+ dataIndex: 'reason',
|
|
|
+ width: '9%',
|
|
|
+ ellipsis: true,
|
|
|
+ scopedSlots: { customRender: 'reason' },
|
|
|
+ className: 'replacecolor',
|
|
|
+ slots:{title:'reasonTitle'}
|
|
|
+ },
|
|
|
{
|
|
|
title: '备注',
|
|
|
dataIndex: 'demo',
|
|
|
- width: '9%',
|
|
|
+ width: '9%',
|
|
|
ellipsis: true,
|
|
|
scopedSlots: { customRender: 'demo' },
|
|
|
className: 'replacecolor'
|
|
|
- }
|
|
|
+ } ,
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'option',
|
|
|
+ width: '6%',
|
|
|
+ ellipsis: true,
|
|
|
+ scopedSlots: { customRender: 'option' },
|
|
|
+ className: 'replacecolor'
|
|
|
+ }
|
|
|
]
|
|
|
},
|
|
|
defultMethods:'add',
|
|
@@ -395,6 +448,13 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 复制行
|
|
|
+ copyRow(record){
|
|
|
+ this.syCarryBTable.dataSource.push(record)
|
|
|
+ this.formState.totalNum += Number(record.totalPrice)
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
|
|
|
/** 调用完edit()方法之后会自动调用此方法 */
|
|
|
// editAfter() {
|
|
@@ -450,7 +510,7 @@
|
|
|
var obj = this.formState
|
|
|
this.syCarryBTable.dataSource.map(item=>{
|
|
|
|
|
|
- console.log('ssssssssssss',item.jhyByData.toString());
|
|
|
+ // console.log('ssssssssssss',item.jhyByData.toString());
|
|
|
if(item.jhyByData!=''&&item.jhyByData){
|
|
|
|
|
|
// item.jhyByData.forEach(t => {
|
|
@@ -500,11 +560,10 @@
|
|
|
var tableRow = data[i];
|
|
|
var required = [
|
|
|
{key:'orderDate',value:'日期'},
|
|
|
- {key:'allNum',value:'总件数'},
|
|
|
+ {key:'detailedNum',value:'明细'},
|
|
|
{key:'containerNo',value:'集装箱号'},
|
|
|
- {key:'invoiceNo',value:'发票号'},
|
|
|
- {key:'price',value:'价格'},
|
|
|
- {key:'jhyByData',value:'计划员'},
|
|
|
+ {key:'totalPrice',value:'总价'},
|
|
|
+ {key:'reason',value:'原因'},
|
|
|
]
|
|
|
for(var j=0 ; j<required.length;j++){
|
|
|
if(tableRow[required[j].key] == null || tableRow[required[j].key] == "" || tableRow[required[j].key] == undefined){
|
|
@@ -543,10 +602,23 @@
|
|
|
this.$emit('close')
|
|
|
},
|
|
|
// 价格改变
|
|
|
- handleChangePrice(){
|
|
|
+ handleChangePrice(record){
|
|
|
+ if(record.price && record.coatHanger){
|
|
|
+ record.totalPrice = Number(record.coatHanger)* Number(record.price)+ Number((record.detailedNum?record.detailedNum:0))
|
|
|
+ this.$forceUpdate()
|
|
|
+ }else{
|
|
|
+ record.totalPrice = record.detailedNum
|
|
|
+ }
|
|
|
var Hj = 0
|
|
|
this.syCarryBTable.dataSource.map(item=>{
|
|
|
- Hj+= Number(item.price)
|
|
|
+ if(item.price=='8'&&item.totalPrice>500){
|
|
|
+ item.coatHanger = ''
|
|
|
+ item.detailedNum = ''
|
|
|
+ item.price = ''
|
|
|
+ item.totalPrice = ''
|
|
|
+ this.$message.error('单价为8的行总价不能超过500,请重新输入单价,衣架/吨数,明细!!');
|
|
|
+ }
|
|
|
+ Hj+= Number(item.totalPrice)
|
|
|
})
|
|
|
this.formState.totalNum = Hj
|
|
|
this.$forceUpdate()
|
|
@@ -606,4 +678,9 @@
|
|
|
content: '*';
|
|
|
color: red;
|
|
|
}
|
|
|
+// /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
|
|
|
+
|
|
|
+// width: calc(100% - 8px);//减去滚动条的宽度
|
|
|
+
|
|
|
+// }
|
|
|
</style>
|