|
|
@@ -1,200 +1,209 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <div class="flex-align-center">
|
|
|
- <excel class="inline-16" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
|
|
|
- <slot name="operation"></slot>
|
|
|
- </div>
|
|
|
- <el-table
|
|
|
- ref="multipleTable"
|
|
|
- :data="tableData"
|
|
|
- height="500px"
|
|
|
- style="width: 100%;"
|
|
|
- size="small"
|
|
|
- stripe
|
|
|
- border
|
|
|
- @selection-change ="selectionChange">
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55"
|
|
|
- align="center">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="itemname"
|
|
|
- label="产品名称"
|
|
|
- width="180">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="itemno"
|
|
|
- label="产品编号"
|
|
|
- width="180">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="model"
|
|
|
- label="型号/规格"
|
|
|
- width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <p><span>{{scope.row.model}}</span> / <span>{{scope.row.spec}}</span></p>
|
|
|
- </template>
|
|
|
- </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="type === 'edit' || data.status === '审核'" 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>
|
|
|
- <span v-else>{{scope.row.qty}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="needdate"
|
|
|
- label="需求日期"
|
|
|
- width="180">
|
|
|
- <template slot="header" slot-scope="scope">
|
|
|
- <div>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="setcol">
|
|
|
+ <div class="flex-align-center">
|
|
|
+ <excel class="inline-16" :tablecols="columnTitle" :param="param" :total="total" :excelTitle="excelTitle"></excel>
|
|
|
+ <slot name="operation"></slot>
|
|
|
+ <el-button style="margin:0 0 10px 10px" size="small" type="primary" @click="setcol = 12">添 加</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ ref="multipleTable"
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%;"
|
|
|
+ size="small"
|
|
|
+ stripe
|
|
|
+ border
|
|
|
+ @selection-change ="selectionChange">
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="itemname"
|
|
|
+ label="产品名称"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="itemno"
|
|
|
+ label="产品编号"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="model"
|
|
|
+ label="型号/规格"
|
|
|
+ width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p><span>{{scope.row.model}}</span> / <span>{{scope.row.spec}}</span></p>
|
|
|
+ </template>
|
|
|
+ </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="type === 'edit'" 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>
|
|
|
+ <span v-else>{{scope.row.qty}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="needdate"
|
|
|
+ label="需求日期"
|
|
|
+ width="180">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-date-picker
|
|
|
+ style="width:150px"
|
|
|
+ v-if="type === 'edit'"
|
|
|
+ v-model="value2"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ slot="reference"
|
|
|
+ align="right"
|
|
|
+ type="date"
|
|
|
+ size="mini"
|
|
|
+ placeholder="一键填写"
|
|
|
+ @change="dateChangeNeed">
|
|
|
+ </el-date-picker>
|
|
|
+ <span v-else>需求日期</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
<el-date-picker
|
|
|
- style="width:150px"
|
|
|
- v-if="type === 'edit'"
|
|
|
- v-model="value2"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- slot="reference"
|
|
|
- align="right"
|
|
|
+ v-if="scope.row.delivery > 0 && type === 'edit'"
|
|
|
+ v-model="scope.row.needdate"
|
|
|
type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
size="mini"
|
|
|
- placeholder="一键填写"
|
|
|
- @change="dateChangeNeed">
|
|
|
+ style="width:150px"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ @change="rowChange(scope.row)"
|
|
|
+ @focus="setPickerOptions(scope.row)">
|
|
|
</el-date-picker>
|
|
|
- <span v-else>需求日期</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-date-picker
|
|
|
- v-if="scope.row.delivery > 0 && type === 'edit'"
|
|
|
- v-model="scope.row.needdate"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- size="mini"
|
|
|
- style="width:150px"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- @change="rowChange(scope.row)"
|
|
|
- @focus="setPickerOptions(scope.row)">
|
|
|
- </el-date-picker>
|
|
|
- <div v-else>
|
|
|
- <p v-if="scope.row.delivery === 0 ">不管控交期</p>
|
|
|
- <p v-else>{{scope.row.needdate}}</p>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="deliverydate"
|
|
|
- label="回复交期"
|
|
|
- width="200">
|
|
|
- <template slot="header" slot-scope="scope">
|
|
|
- <div>
|
|
|
+ <div v-else>
|
|
|
+ <p v-if="scope.row.delivery === 0 ">不管控交期</p>
|
|
|
+ <p v-else>{{scope.row.needdate}}</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="deliverydate"
|
|
|
+ label="回复交期"
|
|
|
+ width="200">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-date-picker
|
|
|
+ style="width:180px"
|
|
|
+ v-if="type === 'confirmdate'"
|
|
|
+ v-model="value2"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ slot="reference"
|
|
|
+ align="right"
|
|
|
+ type="date"
|
|
|
+ size="mini"
|
|
|
+ placeholder="一键交期"
|
|
|
+ @change="dateChange">
|
|
|
+ </el-date-picker>
|
|
|
+ <span v-else>回复交期</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
<el-date-picker
|
|
|
- style="width:180px"
|
|
|
- v-if="type === 'confirmdate'"
|
|
|
- v-model="value2"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- slot="reference"
|
|
|
- align="right"
|
|
|
+ v-if="scope.row.delivery > 0 && type === 'confirmdate'"
|
|
|
+ v-model="scope.row.deliverydate"
|
|
|
type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
size="mini"
|
|
|
- placeholder="一键交期"
|
|
|
- @change="dateChange">
|
|
|
+ style="width:150px"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ @change="onDateChange(scope.row)"
|
|
|
+ @focus="setPickerOptions(scope.row)">
|
|
|
</el-date-picker>
|
|
|
- <span v-else>回复交期</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-date-picker
|
|
|
- v-if="scope.row.delivery > 0 && type === 'confirmdate'"
|
|
|
- v-model="scope.row.deliverydate"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- size="mini"
|
|
|
- style="width:150px"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- @change="onDateChange(scope.row)"
|
|
|
- @focus="setPickerOptions(scope.row)">
|
|
|
- </el-date-picker>
|
|
|
- <div v-else>
|
|
|
- <p v-if="scope.row.delivery === 0 ">不管控交期</p>
|
|
|
- <p v-else>{{scope.row.deliverydate}}</p>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="unit"
|
|
|
- label="计量单位"
|
|
|
- width="90">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="price"
|
|
|
- label="价格"
|
|
|
- width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input v-if="type === 'edit' && data.type === '特殊订单'" v-model.number="scope.row.price" @input="if(scope.row.price > scope.row.oldprice) scope.row.price = scope.row.oldprice; if(scope.row.price < 0) scope.row.price = 0;" placeholder="输入订单备注" size="mini" @change="rowChange(scope.row,scope.$index)"></el-input>
|
|
|
- <p v-else style="color:red;font-weight:500">¥ {{tool.formatAmount(scope.row.price,2)}}</p>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="折后价格"
|
|
|
- prop="totalprice">
|
|
|
- <template slot-scope="scope">
|
|
|
- <p style="color:red;font-weight:500">¥ {{scope.row.price}}</p>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="小计"
|
|
|
- prop="totalprice">
|
|
|
- <template slot-scope="scope">
|
|
|
- <p style="color:red;font-weight:500">¥ {{tool.formatAmount(scope.row.price * scope.row.qty,2)}}</p>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="备注"
|
|
|
- width="300"
|
|
|
- prop="remarks">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input v-if="type === 'edit'" v-model="scope.row.remarks" placeholder="输入订单备注" size="mini" @change="rowChange(scope.row,scope.$index)"></el-input>
|
|
|
- <p v-else>{{scope.row.remarks}}</p>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column v-if="type === 'edit'" width="90" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div style="margin-top:16px;text-align:right">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- small
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-size="param.content.pageSize"
|
|
|
- layout="total, prev, pager, next, jumper"
|
|
|
- :total="total">
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div v-else>
|
|
|
+ <p v-if="scope.row.delivery === 0 ">不管控交期</p>
|
|
|
+ <p v-else>{{scope.row.deliverydate}}</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="unit"
|
|
|
+ label="计量单位"
|
|
|
+ width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="price"
|
|
|
+ label="价格"
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-if="type === 'edit' && data.type === '特殊订单'" v-model.number="scope.row.price" @input="if(scope.row.price > scope.row.oldprice) scope.row.price = scope.row.oldprice; if(scope.row.price < 0) scope.row.price = 0;" placeholder="输入订单备注" size="mini" @change="rowChange(scope.row,scope.$index)"></el-input>
|
|
|
+ <p v-else style="color:red;font-weight:500">¥ {{tool.formatAmount(scope.row.price,2)}}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="折后价格"
|
|
|
+ prop="totalprice">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p style="color:red;font-weight:500">¥ {{scope.row.price}}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="小计"
|
|
|
+ prop="totalprice">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p style="color:red;font-weight:500">¥ {{tool.formatAmount(scope.row.price * scope.row.qty,2)}}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="备注"
|
|
|
+ width="300"
|
|
|
+ prop="remarks">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-if="type === 'edit'" v-model="scope.row.remarks" placeholder="输入订单备注" size="mini" @change="rowChange(scope.row,scope.$index)"></el-input>
|
|
|
+ <p v-else>{{scope.row.remarks}}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-if="type === 'edit'" width="90" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div style="margin-top:16px;text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="param.content.pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24 - setcol">
|
|
|
+ <addProduct :data="data" @onConfirm="onConfirm"></addProduct>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import addProduct from '@/template/orderCanUseProduct/index.vue'
|
|
|
+
|
|
|
export default {
|
|
|
props:['data','type'],
|
|
|
components:{
|
|
|
excel:() => import('../export_excel'),
|
|
|
+ addProduct
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
dataRefresh:true,
|
|
|
+ setcol:24,
|
|
|
tableData:[],
|
|
|
tablecols:[],
|
|
|
columnTitle:[],
|
|
|
@@ -252,6 +261,7 @@ export default {
|
|
|
this.$emit('onSuccess')
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
rowChange (val,index) {
|
|
|
let that = this
|
|
|
|
|
|
@@ -260,36 +270,22 @@ export default {
|
|
|
clearTimeout(this.time);
|
|
|
}
|
|
|
this.time = setTimeout(() => {
|
|
|
- if (this.data.status === '审核') {
|
|
|
- this.changeOrderQty({
|
|
|
- "sa_orderitemsid":val.sa_orderitemsid,
|
|
|
- "sa_orderid":this.data.sa_orderid,//订单ID
|
|
|
- "itemid":val.itemid,//商品ID
|
|
|
- "type":"数量",//调整类型,目前只支持数量
|
|
|
- "newvalue":val.qty,//调整后值
|
|
|
- "remarks":""
|
|
|
- },()=>{
|
|
|
- this.$set(this.tableData,index,val)
|
|
|
- })
|
|
|
-
|
|
|
- } else {
|
|
|
- that.updateOrder({
|
|
|
- "sa_orderid": this.data.sa_orderid, //订单ID
|
|
|
- "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
- "sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
- "type": this.data.type, //订单类型
|
|
|
- "items": [{
|
|
|
- "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
|
|
|
- "itemid": val.itemid, //商品ID
|
|
|
- "qty": val.qty, //数量
|
|
|
- "needdate": val.needdate,//可以不传,修改交期
|
|
|
- "price":val.price,
|
|
|
- "remarks":val.remarks
|
|
|
- }]
|
|
|
- },()=>{
|
|
|
- this.$set(this.tableData,index,val)
|
|
|
- })
|
|
|
- }
|
|
|
+ that.updateOrder({
|
|
|
+ "sa_orderid": this.data.sa_orderid, //订单ID
|
|
|
+ "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
+ "sa_contractid": this.data.contacts.contactsid, //合同ID
|
|
|
+ "type": this.data.type, //订单类型
|
|
|
+ "items": [{
|
|
|
+ "sa_orderitemsid": val.sa_orderitemsid,//0表示新增
|
|
|
+ "itemid": val.itemid, //商品ID
|
|
|
+ "qty": val.qty, //数量
|
|
|
+ "needdate": val.needdate,//可以不传,修改交期
|
|
|
+ "price":val.price,
|
|
|
+ "remarks":val.remarks
|
|
|
+ }]
|
|
|
+ },()=>{
|
|
|
+ this.$set(this.tableData,index,val)
|
|
|
+ })
|
|
|
},1000)
|
|
|
},
|
|
|
onDateChange (val){
|
|
|
@@ -314,13 +310,6 @@ export default {
|
|
|
})
|
|
|
res.code === 1?fn():""
|
|
|
},
|
|
|
- async changeOrderQty (val,fn) {
|
|
|
- const res = await this.$api.requested({
|
|
|
- "id": 20221110145302,
|
|
|
- "content": val
|
|
|
- })
|
|
|
- res.code === 1?fn():""
|
|
|
- },
|
|
|
async dateChangeNeed(val){
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20230104143802,
|
|
|
@@ -357,8 +346,32 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
selectionChange (selection) {
|
|
|
- this.$emit('select',data)
|
|
|
- }
|
|
|
+ this.$emit('select',selection)
|
|
|
+ },
|
|
|
+ // 订单添加商品
|
|
|
+ async onConfirm (data) {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221109093602,
|
|
|
+ "content": {
|
|
|
+ "sa_orderid": this.$route.query.id, //订单ID
|
|
|
+ "sys_enterpriseid": this.data.sys_enterpriseid, //企业ID
|
|
|
+ "type": this.data.type, //订单类型
|
|
|
+ "items": data.map(e=>{
|
|
|
+ return {
|
|
|
+ sa_orderitemsid:0,
|
|
|
+ itemid:e.itemid,
|
|
|
+ qty:e.orderminqty,
|
|
|
+ needdate:e.deliverydate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.setcol = 24
|
|
|
+ this.$refs['prolist'].listData()
|
|
|
+ // this.$emit('onSuccess')
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
mounted () {
|
|
|
this.listData()
|