This commit is contained in:
liushuai
2019-08-20 13:03:06 +08:00
parent 3d6e2e043c
commit d02ecfcdf9
15 changed files with 852 additions and 45 deletions

View File

@@ -202,13 +202,15 @@
placeholder="请输入内容"/>
</div>
<div class="text item">
<span style="width:80px;display:inline-block;">发货单名</span>
<el-input
<span style="width:80px;display:inline-block;">机床名称</span>
<el-autocomplete
:disabled="disabledName"
:fetch-suggestions="querySearchMachine"
v-model="input_Name"
clearable
style="width: 200px;margin-right: 10px"
size="mini"/>
size="mini"
class="inline-input"
@select="handleSelectMachine"/>
<span style="width:80px;display:inline-block;">注意事项</span>
<el-input
:disabled="disabledRemake"
@@ -606,6 +608,10 @@ import { mapGetters } from 'vuex'
export default {
data() {
return {
machineNum: '',
machineName: '',
searchCriteria_Machine: '',
restaurants_Machine: [],
input_Record: '',
disabled: true,
disabledAdd: false, // 增加按钮启用状态
@@ -709,6 +715,40 @@ export default {
// }
},
methods: {
querySearchMachine(queryString, cb) {
this.restaurants_Machine = []
if (this.input_Name !== '' && this.input_Name !== null) {
SelectMachine(this.input_Name).then(response => {
const res = response.data
res.forEach(item => {
this.restaurants_Machine.push({
value: item.货品编号,
num: item.机床流水号
})
})
return this.restaurants_Machine
}).then(data => {
var restaurants = data
var results = queryString ? restaurants.filter(this.createFilterMachine(queryString)) : restaurants
return results
}).then(data => {
// 调用 callback 返回建议列表的数据
cb(data)
})
}
},
createFilterMachine(queryString) {
return (restaurant) => {
return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
// !== -1为全字匹配 === 0为首字匹配
}
},
handleSelectMachine(item) {
// 在此方法中可以把下拉框选中值中的内容赋值给其他变量使用
console.log(item, 998)
this.machineNum = item.num
this.machineName = item.value
},
// function_Refresh() {
// this.$confirm('检测到有未保存的单据', {
// confirmButtonText: '确定',
@@ -888,7 +928,7 @@ export default {
this.typeE = []
this.typeF = []
this.typeG = []
InvoiceSave(this.invoiceNum, this.input_Company, this.input_Adress, this.input_People, this.input_Mobile, this.input_Remake, this.input_Name).then(response => {
InvoiceSave(this.invoiceNum, this.input_Company, this.input_Adress, this.input_People, this.input_Mobile, this.input_Remake, this.machineName, this.machineNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('保存成功!')
this.function_InvoiceFeach()