|
|
@@ -15,11 +15,20 @@
|
|
|
<div class="form-inline">
|
|
|
<div class="form-group">
|
|
|
<label for="documentNo">采购订单号</label>
|
|
|
- <select
|
|
|
+ <!-- <select
|
|
|
id="documentNo"
|
|
|
class="form-control"
|
|
|
placeholder="输入采购订单号"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
+ <a-select
|
|
|
+ v-model:value="documentNo"
|
|
|
+ style="width: 220px"
|
|
|
+ show-search
|
|
|
+ allow-clear
|
|
|
+ @change="documentNoChange"
|
|
|
+ >
|
|
|
+ <a-select-option v-for="item in documentNoList" :key="item.id" :value="item.documentNo"> {{ item.documentNo }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
|
@@ -139,7 +148,9 @@ import InventoryInstancePrintResource from '../api/wms/InventoryInstancePrintRes
|
|
|
|
|
|
export default {
|
|
|
|
|
|
-
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+
|
|
|
props: {
|
|
|
documentNoA: {
|
|
|
type: Array,
|
|
|
@@ -161,6 +172,7 @@ export default {
|
|
|
purchaseOrderLineId: '',
|
|
|
notPrintCount: 0,
|
|
|
showForm: 0,
|
|
|
+ documentNoList: [],
|
|
|
};
|
|
|
},
|
|
|
mounted: function () {
|
|
|
@@ -172,9 +184,9 @@ export default {
|
|
|
} else {
|
|
|
var storage = window.localStorage;
|
|
|
if (storage.getItem('purchaseOrderNo') != null) {
|
|
|
- this.documentNo = storage.getItem('purchaseOrderNo');
|
|
|
- var data = new Option(this.documentNo, this.documentNo);
|
|
|
- $('#documentNo').append(data);
|
|
|
+ // this.documentNo = storage.getItem('purchaseOrderNo');
|
|
|
+ // var data = new Option(this.documentNo, this.documentNo);
|
|
|
+ // $('#documentNo').append(data);
|
|
|
_self.refreshPurchaseOrderLineTable();
|
|
|
_self.keydown();
|
|
|
}
|
|
|
@@ -191,51 +203,98 @@ export default {
|
|
|
path: '/wms/printed',
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目事件
|
|
|
+ */
|
|
|
loadDocumentNo: function () {
|
|
|
var _self = this;
|
|
|
- $('#documentNo').select2({
|
|
|
- placeholder: '输入采购订单号',
|
|
|
- allowClear: true,
|
|
|
- language: 'zh-CN',
|
|
|
- tags: true,
|
|
|
- width: '187px',
|
|
|
- ajax: {
|
|
|
- type: 'get',
|
|
|
- dataType: 'json',
|
|
|
- url: Common.getApiURL('PurchaseOrderLineResource/queryPurchaseOrderLineDocumentNo'),
|
|
|
- beforeSend: function (request) {
|
|
|
- Common.addTokenToRequest(request);
|
|
|
- },
|
|
|
- data: function (params) {
|
|
|
- return {
|
|
|
- documentNo: params.term,
|
|
|
- };
|
|
|
- },
|
|
|
- processResults: function (data) {
|
|
|
- return {
|
|
|
- results: $.map(data, function (item) {
|
|
|
- return {
|
|
|
- id: item.documentNo,
|
|
|
- text: item.documentNo,
|
|
|
- };
|
|
|
- }),
|
|
|
- };
|
|
|
- },
|
|
|
+ $.ajax({
|
|
|
+ type: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ url: Common.getApiURL('PurchaseOrderLineResource/queryPurchaseOrderLineDocumentNo'),
|
|
|
+ contentType: 'application/json',
|
|
|
+ beforeSend: function (request) {
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
+ },
|
|
|
+ data: function (params) {
|
|
|
+ return {
|
|
|
+ documentNo: params.term,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ success: function (datas) {
|
|
|
+ if (datas.length > 0) {
|
|
|
+ _self.documentNoList = datas;
|
|
|
+ console.log(_self.documentNoList);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
+ Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
},
|
|
|
- }).on('change', function () {
|
|
|
- if ($(this).val() == null) {
|
|
|
- _self.purchaseOrderLines.splice(0, _self.purchaseOrderLines.length);
|
|
|
- _self.purchaseOrderLineId = '';
|
|
|
- return;
|
|
|
- } else {
|
|
|
- _self.documentNo = $(this).val();
|
|
|
- var storage = window.localStorage;
|
|
|
- storage.setItem('purchaseOrderNo', _self.documentNo);
|
|
|
- _self.refreshPurchaseOrderLineTable();
|
|
|
- _self.keydown();
|
|
|
- }
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ documentNoChange: function(value) {
|
|
|
+ var _self = this;
|
|
|
+ console.log(value);
|
|
|
+ if (value == null || value == undefined) {
|
|
|
+ _self.purchaseOrderLines.splice(0, _self.purchaseOrderLines.length);
|
|
|
+ _self.purchaseOrderLineId = '';
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ // _self.documentNo = this.documentNo;
|
|
|
+ // var storage = window.localStorage;
|
|
|
+ // storage.setItem('purchaseOrderNo', _self.documentNo);
|
|
|
+ _self.refreshPurchaseOrderLineTable();
|
|
|
+ _self.keydown();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // loadDocumentNo: function () {
|
|
|
+ // var _self = this;
|
|
|
+ // $('#documentNo').select2({
|
|
|
+ // placeholder: '输入采购订单号',
|
|
|
+ // allowClear: true,
|
|
|
+ // language: 'zh-CN',
|
|
|
+ // tags: true,
|
|
|
+ // width: '187px',
|
|
|
+ // ajax: {
|
|
|
+ // type: 'get',
|
|
|
+ // dataType: 'json',
|
|
|
+ // url: Common.getApiURL('PurchaseOrderLineResource/queryPurchaseOrderLineDocumentNo'),
|
|
|
+ // beforeSend: function (request) {
|
|
|
+ // Common.addTokenToRequest(request);
|
|
|
+ // },
|
|
|
+ // data: function (params) {
|
|
|
+ // return {
|
|
|
+ // documentNo: params.term,
|
|
|
+ // };
|
|
|
+ // },
|
|
|
+ // processResults: function (data) {
|
|
|
+ // return {
|
|
|
+ // results: $.map(data, function (item) {
|
|
|
+ // return {
|
|
|
+ // id: item.documentNo,
|
|
|
+ // text: item.documentNo,
|
|
|
+ // };
|
|
|
+ // }),
|
|
|
+ // };
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // }).on('change', function () {
|
|
|
+ // if ($(this).val() == null) {
|
|
|
+ // _self.purchaseOrderLines.splice(0, _self.purchaseOrderLines.length);
|
|
|
+ // _self.purchaseOrderLineId = '';
|
|
|
+ // return;
|
|
|
+ // } else {
|
|
|
+ // _self.documentNo = $(this).val();
|
|
|
+ // var storage = window.localStorage;
|
|
|
+ // storage.setItem('purchaseOrderNo', _self.documentNo);
|
|
|
+ // _self.refreshPurchaseOrderLineTable();
|
|
|
+ // _self.keydown();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
refreshPurchaseOrderLineTable: function () {
|
|
|
var _self = this;
|
|
|
if (_self.purchaseOrderLines != null && _self.purchaseOrderLines.length > 0) {
|