doctor-admin-components 1.0.14-beta.85 → 1.0.14-beta.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -364,23 +364,18 @@
|
|
|
364
364
|
@changeShipBillNo="changeShipBillNo"
|
|
365
365
|
:progressInfo="shipProgressInfo"
|
|
366
366
|
:shipBillNoProp="shipBillNo"
|
|
367
|
-
|
|
367
|
+
>
|
|
368
|
+
<template slot="action" v-if="contract.contractType == 'purchase'">
|
|
369
|
+
<el-button class="mt5" type="success" size="mini" icon="el-icon-plus" @click.stop="clickAddShipment" circle></el-button>
|
|
370
|
+
</template>
|
|
371
|
+
</BillOfLadingNoTab>
|
|
368
372
|
<!-- 装运 -->
|
|
369
373
|
<div id="contract_shipping_id">
|
|
370
374
|
<!-- 生成装运 -->
|
|
371
375
|
<SectionSlot @updateOpen="handleShippingUpdateOpen" :infoPro="shipProgressInfo" v-if="contractFileInfo && !contractFileInfo.shipmentFileInfoList">
|
|
372
376
|
<template v-slot:header>
|
|
373
377
|
<div style="position:relative">
|
|
374
|
-
<ProgressDetail :infoPro="shipProgressInfo">
|
|
375
|
-
<template slot="action" v-if="contract.contractType == 'purchase'">
|
|
376
|
-
<div style="position: absolute; margin-left: 15px;bottom: 5px;">
|
|
377
|
-
<el-select v-model="selectSaleContractId" placeholder="请选择" size="mini">
|
|
378
|
-
<el-option v-for="item in contract.associationContractList" :key="item.contractId" :label="item.contractNo" :value="item.contractId"></el-option>
|
|
379
|
-
</el-select>
|
|
380
|
-
<el-button class="ml5" type="success" size="mini" icon="el-icon-plus" @click.stop="handleAddShipment" circle></el-button>
|
|
381
|
-
</div>
|
|
382
|
-
</template>
|
|
383
|
-
</ProgressDetail>
|
|
378
|
+
<ProgressDetail :infoPro="shipProgressInfo"></ProgressDetail>
|
|
384
379
|
</div>
|
|
385
380
|
</template>
|
|
386
381
|
<template v-slot:content>
|
|
@@ -1558,25 +1553,85 @@ export default {
|
|
|
1558
1553
|
},
|
|
1559
1554
|
mounted() { },
|
|
1560
1555
|
methods: {
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1556
|
+
async clickAddShipment() {
|
|
1557
|
+
//弹出选择框,选择关联的销售合同,点击确定后,执行新增
|
|
1558
|
+
const list = this.contract.associationContractList || []
|
|
1559
|
+
if (!list.length) {
|
|
1560
|
+
this.$message.warning('暂无可关联的销售合同')
|
|
1561
|
+
return
|
|
1562
|
+
}
|
|
1563
|
+
// 单个直接确认
|
|
1564
|
+
if (list.length === 1) {
|
|
1565
|
+
this.selectSaleContractId = list[0].contractId
|
|
1566
|
+
this.handleAddShipment(true)
|
|
1567
|
+
return
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
// 多个:用 render 函数渲染 el-select 弹窗
|
|
1571
|
+
let selectedId = list[0].contractId // 默认选中第一个
|
|
1572
|
+
|
|
1573
|
+
try {
|
|
1574
|
+
await this.$msgbox({
|
|
1575
|
+
title: '请选择关联的销售合同',
|
|
1576
|
+
message: this.$createElement('div', [
|
|
1577
|
+
this.$createElement('el-select', {
|
|
1578
|
+
props: { value: selectedId, placeholder: '请选择', style: 'width: 100%;', popperAppendToBody: false },
|
|
1579
|
+
on: { input: val => selectedId = val } // 闭包更新值
|
|
1580
|
+
},
|
|
1581
|
+
list.map(item =>
|
|
1582
|
+
this.$createElement('el-option', {
|
|
1583
|
+
props: { label: item.contractNo, value: item.contractId }
|
|
1584
|
+
})
|
|
1585
|
+
)),
|
|
1586
|
+
// 间隔占位
|
|
1587
|
+
this.$createElement('div', { style: 'height: 80px;' })
|
|
1588
|
+
]),
|
|
1589
|
+
showCancelButton: true,
|
|
1590
|
+
confirmButtonText: '确定',
|
|
1591
|
+
cancelButtonText: '取消',
|
|
1592
|
+
beforeClose: (action, instance, done) => {
|
|
1593
|
+
if (action === 'confirm' && !selectedId) {
|
|
1594
|
+
this.$message.warning('请选择关联的销售合同')
|
|
1595
|
+
return
|
|
1596
|
+
}
|
|
1597
|
+
done()
|
|
1598
|
+
}
|
|
1599
|
+
})
|
|
1600
|
+
|
|
1601
|
+
// 用户确认后执行
|
|
1602
|
+
this.selectSaleContractId = selectedId
|
|
1603
|
+
this.handleAddShipment(false)
|
|
1604
|
+
|
|
1605
|
+
} catch (e) {
|
|
1606
|
+
// 取消
|
|
1564
1607
|
}
|
|
1608
|
+
|
|
1609
|
+
},
|
|
1610
|
+
addBizShipmentRequest() {
|
|
1611
|
+
// 添加装运接口
|
|
1612
|
+
addBizShipment({
|
|
1613
|
+
purchaseContractId: this.contract.contractId,
|
|
1614
|
+
saleContractId: this.selectSaleContractId,
|
|
1615
|
+
}).then(() => {
|
|
1616
|
+
this.$message.success('添加成功')
|
|
1617
|
+
this.handleRefresh()
|
|
1618
|
+
})
|
|
1619
|
+
},
|
|
1620
|
+
handleAddShipment(showAlert = true) {
|
|
1621
|
+
console.log('==handleAddShipment==', this.selectSaleContractId)
|
|
1622
|
+
|
|
1565
1623
|
// 弹框二次确认
|
|
1624
|
+
if (!showAlert) {
|
|
1625
|
+
return this.addBizShipmentRequest()
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1566
1628
|
this.$confirm('是否添加空白装运', '提示', {
|
|
1567
1629
|
confirmButtonText: '确定',
|
|
1568
1630
|
cancelButtonText: '取消',
|
|
1569
1631
|
type: 'warning'
|
|
1570
1632
|
})
|
|
1571
1633
|
.then(() => {
|
|
1572
|
-
|
|
1573
|
-
addBizShipment({
|
|
1574
|
-
purchaseContractId: this.contract.contractId,
|
|
1575
|
-
saleContractId: this.selectSaleContractId,
|
|
1576
|
-
}).then(() => {
|
|
1577
|
-
this.$message.success('添加成功')
|
|
1578
|
-
this.handleRefresh()
|
|
1579
|
-
})
|
|
1634
|
+
this.addBizShipmentRequest()
|
|
1580
1635
|
})
|
|
1581
1636
|
.catch((e) => {
|
|
1582
1637
|
console.log(e)
|