Commit d366e8bb by wangweidong

委托单优化

parent 9748869e
......@@ -22,5 +22,17 @@ export default {
.then(res => res),
subpackageSample: data =>
http.post('meter/v1/sample/subpackage_sample?ids=' + data).then(res => res)
http.post('meter/v1/sample/subpackage_sample?ids=' + data).then(res => res),
distributeOutSample: data =>
http
.post(
'meter/v1/sample/out_task_distribute?ids=' +
data.ids +
'&userId=' +
data.userId +
'&user=' +
data.user
)
.then(res => res)
}
......@@ -10,24 +10,24 @@
<Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="样品名称:" class="search-item">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入样品名称" clearable/>
<Input v-model="formObj.name" placeholder="请输入样品名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input v-model="formObj.code" @on-enter="_formSearch" placeholder="请输入样品编号" clearable/>
<Input v-model="formObj.code" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<Button @click="_formSearch" type="primary">搜索</Button>
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :get-page="getPage"
:icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
:icon-msg="iconMsg" select-data @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -57,12 +57,11 @@
</Row>
</div>
</Modal>
<assignPerson ref="userModal" @on-result-change="_userData" is-change></assignPerson>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson>
</div>
</template>
<script>
import { meterSample } from '../../../api'
import Global from '../../../api/config'
import assignPerson from '../../../components/user-info-single/assignPerson'
export default {
components: {
......@@ -179,23 +178,31 @@ export default {
}
})
},
_userData(data, msg, contractTempData) {
_userData(data, msg) {
if (msg === 'salesman') {
// this.salesman = data.realname
// this.formObj.detail.salesmanId = data.userId
// this.formObj.detail.salesmanPhone = data.mobile
console.log('选择人员返回值')
console.log(data)
this._distributeSample(data)
}
},
_distributeSample: async function(data) {
const userId = data.id
const realname = data.realname
const ids = this.selectIds
const result = await meterSample.distributeOutSample({
ids: ids,
userId: userId,
user: realname
})
if (result) {
this.$Message.success('分配成功!')
await this._page()
}
},
_changePeople() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一项数据!')
return false
} else {
const user = Global.getUserInfo('userInfo')
console.log('用户')
console.log(user)
// this.$refs.userModal._openGoupByUserId('分配人员', user.id, '')
this.$refs.userModal._open('salesman')
}
},
......@@ -250,7 +257,7 @@ export default {
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function(id) {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterSample.pageOutDistribute(this.formObj)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment