feat:修改 下拉选择通用组件,增加人员交接、固定资产入库申请
This commit is contained in:
parent
68066b0f09
commit
b807060639
|
|
@ -138,8 +138,11 @@ export default {
|
||||||
toggleSelector() {
|
toggleSelector() {
|
||||||
if (this.disabled) return
|
if (this.disabled) return
|
||||||
this.showSelector = !this.showSelector
|
this.showSelector = !this.showSelector
|
||||||
this.$emit(this.showSelector ? 'open' : 'close')
|
if(this.showSelector && this.filterSelectData.length === 0) {
|
||||||
|
this.resetAndLoad()
|
||||||
}
|
}
|
||||||
|
this.$emit(this.showSelector ? 'open' : 'close')
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
14
pages.json
14
pages.json
|
|
@ -124,6 +124,20 @@
|
||||||
"navigationBarTitleText" : "供应商审批"
|
"navigationBarTitleText" : "供应商审批"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/pum/quotation_form",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "报价单审批"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/asm/assetlogin_form",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "固定资产审批"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/em/repair_form",
|
"path" : "pages/em/repair_form",
|
||||||
"style" :
|
"style" :
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,277 @@
|
||||||
|
<template>
|
||||||
|
<view class="container" >
|
||||||
|
<scroll-view
|
||||||
|
scroll-y
|
||||||
|
:scroll-top="scrollTop"
|
||||||
|
style="height: auto; min-height: 200px;"
|
||||||
|
>
|
||||||
|
<uni-forms v-model="form" label-width="150rpx" ref="customForm" :rules="customRules" style="height: 60%;">
|
||||||
|
<uni-forms-item label="保管部门" required>
|
||||||
|
<searchSelect v-model="form.keep_dept" :apiobjs="deptApiobj" v-if="mode== 'add'"/>
|
||||||
|
<span v-else>{{form.keeper_name}}</span>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="保管人" required>
|
||||||
|
<searchSelect v-model="form.keeper" :apiobjs="userApiobj" v-if="mode== 'add'"/>
|
||||||
|
<span v-else>{{form.keeper_name}}</span>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="启用日期" required>
|
||||||
|
<uni-datetime-picker
|
||||||
|
type="date"
|
||||||
|
v-model="form.start_date"
|
||||||
|
:disabled="mode !== 'add'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
</uni-forms>
|
||||||
|
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in form.items"
|
||||||
|
:key="item._key"
|
||||||
|
class="items-box"
|
||||||
|
>
|
||||||
|
<uni-forms
|
||||||
|
:model="item"
|
||||||
|
label-width="150rpx"
|
||||||
|
>
|
||||||
|
<view class="item-title">
|
||||||
|
{{ index + 1 }}
|
||||||
|
</view>
|
||||||
|
<uni-forms-item label="资产类别" required>
|
||||||
|
<searchSelect
|
||||||
|
v-model="item.cate"
|
||||||
|
v-model:label="item.cate_name"
|
||||||
|
:apiobjs="cateApiobj"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="资产名称" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="item.name"
|
||||||
|
placeholder="请输入资产名称"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="规格型号">
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="item.specification"
|
||||||
|
placeholder="请输入规格型号"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="数量" required>
|
||||||
|
<uni-number-box
|
||||||
|
v-model="item.quantity"
|
||||||
|
:min="1"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="可用年限">
|
||||||
|
<uni-number-box
|
||||||
|
v-model="item.canuse_year"
|
||||||
|
:min="1"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="资产原值" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="item.original_value"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入资产原值"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="供应商">
|
||||||
|
<searchSelect
|
||||||
|
v-model="item.supplier"
|
||||||
|
v-model:label="item.supplier_name"
|
||||||
|
:apiobjs="supplierObj"
|
||||||
|
placeholder="请选择供应商"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="存放地点">
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="item.storage_location"
|
||||||
|
placeholder="请输入存放地点"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
</uni-forms>
|
||||||
|
<view class="item-action">
|
||||||
|
<button
|
||||||
|
type="warn"
|
||||||
|
size="mini"
|
||||||
|
@click="removeItem(index)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部操作 -->
|
||||||
|
<view class="footer">
|
||||||
|
<!-- 入库明细 -->
|
||||||
|
<button
|
||||||
|
type="primary"
|
||||||
|
@click="addItem"
|
||||||
|
style="margin-bottom: 20rpx"
|
||||||
|
>
|
||||||
|
新增明细
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="mode === 'edit'"
|
||||||
|
type="warn"
|
||||||
|
@click="handleDel"
|
||||||
|
:loading="saveLoading"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="mode !== 'show'"
|
||||||
|
type="primary"
|
||||||
|
@click="handleSave"
|
||||||
|
:loading="saveLoading"
|
||||||
|
>
|
||||||
|
提交审批
|
||||||
|
</button>
|
||||||
|
<ticketd_b
|
||||||
|
v-if="form.ticket_ && mode === 'show'"
|
||||||
|
:t_id="form.id"
|
||||||
|
:ticket_="form.ticket_"
|
||||||
|
:ticket_data="ticket_data"
|
||||||
|
@success="$emit('success', mode)"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<ticketd
|
||||||
|
v-if="form.ticket_"
|
||||||
|
:ticket_="form.ticket_"
|
||||||
|
@success="$emit('success')"
|
||||||
|
/>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ticketd_b from "../wf/ticketd_b.vue"
|
||||||
|
import ticketd from "../wf/ticketd.vue"
|
||||||
|
import searchSelect from "@/components/searchselect.vue"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { ticketd, ticketd_b, searchSelect },
|
||||||
|
|
||||||
|
props: {
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
default: 'show'
|
||||||
|
},
|
||||||
|
t_id: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
mode: this.mode,
|
||||||
|
saveLoading: false,
|
||||||
|
ticket_data: {},
|
||||||
|
userApiobj:this.$api.userList,
|
||||||
|
deptApiobj:this.$api.deptList,
|
||||||
|
supplierObj:this.$api.supplierList,
|
||||||
|
cateApiobj:this.$api.assetCateList,
|
||||||
|
scrollTop: 0,
|
||||||
|
form: {
|
||||||
|
type: '入库',
|
||||||
|
items: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
if (this.t_id) {
|
||||||
|
this.getTid()
|
||||||
|
} else {
|
||||||
|
this.mode = 'add'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
addItem() {
|
||||||
|
this.form.items.push({
|
||||||
|
cate: null,
|
||||||
|
cate_name: '',
|
||||||
|
name: '',
|
||||||
|
specification: '',
|
||||||
|
quantity: 1,
|
||||||
|
canuse_year: null,
|
||||||
|
original_value: '',
|
||||||
|
supplier: null,
|
||||||
|
supplier_name: '',
|
||||||
|
storage_location: '',
|
||||||
|
}),
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scrollTop = this.scrollTop + 1000
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removeItem(index) {
|
||||||
|
this.form.items.splice(index, 1)
|
||||||
|
},
|
||||||
|
|
||||||
|
async getTid() {
|
||||||
|
const res = await this.$api.assetItem(this.t_id)
|
||||||
|
this.form = res
|
||||||
|
|
||||||
|
if (
|
||||||
|
res.ticket_ &&
|
||||||
|
res.ticket_.state_.type === 1 &&
|
||||||
|
res.create_by === this.$TOOL.data.get('USER_INFO').id
|
||||||
|
) {
|
||||||
|
this.mode = 'edit'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async handleDel(){
|
||||||
|
let that = this;
|
||||||
|
await that.$api.assetDelete(that.form.id)
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSave(){
|
||||||
|
let that = this;
|
||||||
|
that.$refs.customForm.validate().then(res => {
|
||||||
|
that.$api.assetCreate(that.form).then(ress=>{
|
||||||
|
uni.navigateBack()
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
console.log('err', err);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.items-box {
|
||||||
|
margin: 20rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-title {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-action {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.add-btn {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -79,7 +79,6 @@
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,175 @@
|
||||||
|
<!-- 供应商 -->
|
||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<scroll-view scroll-y style="padding-bottom: 180rpx;background-color: #fff;">
|
||||||
|
<uni-forms v-model="form" label-width="210rpx" ref="customForm" :rules="customRules">
|
||||||
|
<ticketd :ticket_="form.ticket_"></ticketd>
|
||||||
|
<uni-forms-item label="客户名称" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.customer_name"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="产品名称" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.product_name"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="联系人" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.contact_person"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="联系电话" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.contact_phone"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入联系电话"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="收件地址" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.receive_address"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="产品规格/数量" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.product_spec_quantity"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="报价依据" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.quotation_basis"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="建议价格及计算方式" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.suggested_price_calc"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="报价区间" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.quotation_range"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="报价人" required>
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="form.quoter"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
|
||||||
|
<uni-forms-item label="申请日期" required>
|
||||||
|
<uni-datetime-picker
|
||||||
|
type="date"
|
||||||
|
v-model="form.apply_date"
|
||||||
|
:disabled="localMode === 'show'"
|
||||||
|
/>
|
||||||
|
</uni-forms-item>
|
||||||
|
</uni-forms>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="footer_fixed">
|
||||||
|
<button v-if="mode=='edit'" size="mini" @click="handleDel" :loading="saveLoading" :disabled="saveLoading" type="warn">
|
||||||
|
删除
|
||||||
|
</button>
|
||||||
|
<button v-if="mode!='show'" size="mini" @click="handleSave" :loading="saveLoading" :disabled="saveLoading" type="primary">
|
||||||
|
提交审批
|
||||||
|
</button>
|
||||||
|
<ticketd_b v-if="form.ticket_ && mode == 'show'" :t_id="form.id" :ticket_="form.ticket_"
|
||||||
|
:ticket_data="ticket_data" @success="()=>{uni.navigateBack()}" ref="ticketd_b"></ticketd_b>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ticketd_b from "../wf/ticketd_b.vue"
|
||||||
|
import ticketd from "../wf/ticketd.vue"
|
||||||
|
export default {
|
||||||
|
components: { ticketd_b, ticketd },
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
saveLoading: false,
|
||||||
|
mode:"add",
|
||||||
|
t_id: null,
|
||||||
|
form:{},
|
||||||
|
userInfo:{},
|
||||||
|
type:0,
|
||||||
|
customRules: {
|
||||||
|
customer_name: {
|
||||||
|
rules: [{
|
||||||
|
required: true,
|
||||||
|
errorMessage: '姓名不能为空'
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
product_name: {
|
||||||
|
rules: [{
|
||||||
|
required: true,
|
||||||
|
errorMessage: '产品名称不能为空'
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async onLoad(options) {
|
||||||
|
let that = this;
|
||||||
|
that.mode = options.mode?options.mode:'show';
|
||||||
|
that.t_id = options.t_id?options.t_id:null;
|
||||||
|
if(that.mode != "add"){
|
||||||
|
if(that.t_id) {
|
||||||
|
that.form = await that.$api.quotationItem(that.t_id);
|
||||||
|
if(that.form.ticket_.state_.type == 1 && that.form.create_by == uni.getStorageSync("userInfo").id ) {
|
||||||
|
that.mode = "edit";
|
||||||
|
}else{
|
||||||
|
that.mode = "show";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
async handleDel(){
|
||||||
|
let that = this;
|
||||||
|
await that.$api.quotationDelete(that.form.id)
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
async handleSave(){
|
||||||
|
let that = this;
|
||||||
|
that.$refs.customForm.validate().then(res => {
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
console.log('err', err);
|
||||||
|
})
|
||||||
|
let res = await that.$api.quotationCreate(that.form)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.uni-data-checklist .checklist-group .checklist-box{
|
||||||
|
margin: 10px 0!important;
|
||||||
|
}
|
||||||
|
.flex_file_picker>.uni-file-picker__files{
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
.flex_file_picker{
|
||||||
|
width: 90px;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
14
utils/api.js
14
utils/api.js
|
|
@ -102,13 +102,27 @@ export default {
|
||||||
empjoinDelete:(id) => http(`/hrm/empjoin/${id}/`, 'DELETE'),
|
empjoinDelete:(id) => http(`/hrm/empjoin/${id}/`, 'DELETE'),
|
||||||
empjoinUpdate:(id,data) => http(`/hrm/empjoin/${id}/`, 'PUT', data),
|
empjoinUpdate:(id,data) => http(`/hrm/empjoin/${id}/`, 'PUT', data),
|
||||||
//供应商审核
|
//供应商审核
|
||||||
|
supplierauditfList:(data) => http(`/pum/supplieraudit/`, 'GET' , data),
|
||||||
supplierauditCreate:(data) => http(`/pum/supplieraudit/`, 'POST' , data),
|
supplierauditCreate:(data) => http(`/pum/supplieraudit/`, 'POST' , data),
|
||||||
supplierauditItem:(id,data) => http(`/pum/supplieraudit/${id}/`, 'GET', data),
|
supplierauditItem:(id,data) => http(`/pum/supplieraudit/${id}/`, 'GET', data),
|
||||||
supplierauditUpdate:(id,data) => http(`/pum/supplieraudit/${id}/`, 'PUT', data),
|
supplierauditUpdate:(id,data) => http(`/pum/supplieraudit/${id}/`, 'PUT', data),
|
||||||
|
supplierList:(data) => http(`/pum/supplier/`, 'GET' , data),
|
||||||
|
//报价单审核
|
||||||
|
quotationCreate:(data) => http(`/pum/quotation/`, 'POST' , data),
|
||||||
|
quotationItem:(id,data) => http(`/pum/quotation/${id}/`, 'GET', data),
|
||||||
|
quotationUpdate:(id,data) => http(`/pum/quotation/${id}/`, 'PUT', data),
|
||||||
|
quotationDelete:(id) => http(`/hrm/quotation/${id}/`, 'DELETE'),
|
||||||
//维修申请
|
//维修申请
|
||||||
repairCreate:(data) => http(`/em/repair/`, 'POST' , data),
|
repairCreate:(data) => http(`/em/repair/`, 'POST' , data),
|
||||||
repairItem:(id,data) => http(`/em/repair/${id}/`, 'GET', data),
|
repairItem:(id,data) => http(`/em/repair/${id}/`, 'GET', data),
|
||||||
repairDelete:(id) => http(`/em/repair/${id}/`, 'DELETE'),
|
repairDelete:(id) => http(`/em/repair/${id}/`, 'DELETE'),
|
||||||
|
//固定资产申请
|
||||||
|
assetCreate:(data) => http(`/asm/assetlog/`, 'POST' , data),
|
||||||
|
assetItem:(id,data) => http(`/asm/assetlog/${id}/`, 'GET', data),
|
||||||
|
assetDelete:(id) => http(`/asm/assetlog/${id}/`, 'DELETE'),
|
||||||
|
assetUpdate:(id,data) => http(`/asm/assetlog/${id}/`, 'PUT', data),
|
||||||
|
// 固定资产类别
|
||||||
|
assetCateList:(data) => http(`/asm/assetcate/`, 'GET' , data),
|
||||||
//部门列表
|
//部门列表
|
||||||
deptList:(data) => http(`/system/dept/`, 'GET' , data),
|
deptList:(data) => http(`/system/dept/`, 'GET' , data),
|
||||||
//岗位列表
|
//岗位列表
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue