This commit is contained in:
ln1778 2024-05-07 11:30:13 +08:00
parent 8e06c31994
commit e9bc6a2c35
58 changed files with 23142 additions and 2 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -0,0 +1,429 @@
<template>
<el-dialog
:visible.sync="dialogVisible"
width="56%"
append-to-body
:close-on-click-modal="false"
:before-close="handleClose"
>
<div id="printTest" ref="printTest" class="main">
<div class="top">
<img crossorigin="anonymous" style="margin-left: 20px;width:55px;height:100%" src="https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/erp_img/wumalogo.png"></img>
<div style="margin-left: 15px;display:flex;flex-direction:column">
<span class="top-text">五马伟业</span>
<span class="top-text1">AppleCare Service or sales</span>
</div>
</div>
<div class="header">
<span style="font-size: 30px; font-weight: bold">配件入库打印单</span>
</div>
<el-row :gutter="24">
<el-col :span="6">
<div class="body-text">
<span class="text">入库类型:</span>
<span class="text1">{{ aaa.warehousing_type }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">订单名称:</span>
<span class="text1">{{ aaa.order_name }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">采购客户:</span>
<span class="text1">{{ aaa.customer_id }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">收款状态:</span>
<span class="text1">{{ aaa.pay_status }}{{ aaa.pay_channel ? `(${aaa.pay_channel})` : '' }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">业务员:</span>
<span class="text1">{{ aaa.salesman_info }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">数量:</span>
<span class="text1">{{ tableData.length }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">库位:</span>
<span class="text1">{{ aaa.location_id }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">订单日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col>
</el-row>
<!--引入表格组件-->
<div>
<table>
<tr>
<td class="text1">供应商:温州新唐科技</td>
<td class="text1">联系方式:13666666666</td>
</tr>
<tr>
<td class="text1">
发货地址:浙江省温州市鹿城区龙泉巷瑞霞公寓写字楼1105
</td>
<td class="text1">总金额:{{ sumprice }}</td>
</tr>
</table>
</div>
<el-table border :data="tableData">
<el-table-column
v-for="(item, index) in tableLabel"
:key="index"
:property="item.param"
:label="item.label"
:formatter="item.formatter"
/>
</el-table>
<div class="footer">
<div class="fotter-top">
<span class="footer-Toptext">五马伟业,专做二手机回收维修销售,资深验机团队,专业维修</span>
</div>
<div class="fotter-main">
<span class="footer-maintext">感谢您选择爱果战壕ERP,我们将竭诚为您服务!!!</span>
<span style="margin-left:5px" class="footer-maintext">服务热线:057788858858 17757760777</span>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-popover
title="扫描查看明细"
placement="top-start"
width="100"
trigger="click"
@hide="hide"
>
<div ref="qrCodeUrl" class="qrcode" />
<el-button slot="reference" style="margin:0 10px" @click="share()">分享</el-button>
</el-popover>
<el-button type="primary" @click="toImg">确认打印</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import { pre_print } from '@/api/machineList' //
export default {
name: 'Accessoriesprint',
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false
}
},
tableData: {
type: Array,
default: () => {
return []
}
},
input: {
type: Array,
default: () => {
return []
}
},
formLabelAlign: {
type: Object,
default: () => {
return {}
}
},
jiqidata: {
type: Array,
default: () => {
return []
}
}
},
data() {
const that = this
const style = '@page { margin: 0 } @media print { zoom:100% }'//
return {
printobj: {
id: '#printTest',
popTitle: '打印',
style: style,
closeCallback(e) {
that.$emit('update:dialogVisible', false)
}
},
tableLabel: [
{
label: '配件分类',
param: 'cate_name',
align: 'center',
width: '100',
show: true,
formatter: (row) => {
let obj = ''
this.jiqidata.map((res) => {
if (row.cate_name == res.value) {
obj = res.label
} else {
return '/'
}
})
return obj
}
},
{
label: '是否原厂',
input: true,
param: 'is_original',
align: 'center',
renderheader: this.renderheader,
show: true,
ortable: true,
formatter: (row) => {
if (row.is_original == 1) {
return '原厂'
} else if (row.is_original == 2) {
return '非原厂'
}
}
},
{
label: '适用配件',
param: 'phone_list',
align: 'center',
show: true,
ortable: true,
formatter: (row) => {
let obj = ''
const a = { brand_name: '', model_name: '', color_name: '', rom_name: '' }
// {{items.brand_name}} {{items.model_name}}{{items.rom_name}} {{items.color_name}}
for (const key in a) {
obj += ' ' + row.phone_list[key]
}
return obj
}
},
{
label: '配件单价',
select: true,
param: 'pay_amount',
align: 'center',
renderheader: this.renderheader,
show: true,
ortable: true,
formatter: (row) => {
let obj = ''
if (row.pay_amount.unitprice && !row.number.number) {
obj = row.pay_amount.unitprice
} else if (row.pay_amount.unitprice && row.number.number) {
obj = '单价' + row.pay_amount.unitprice + '\n总价格' + row.pay_amount.sumprice
}
return obj
}
},
{
label: '产品名称',
input: true,
param: 'product_name',
align: 'center',
width: '100',
show: true,
renderheader: this.renderheader,
ortable: true
},
{
label: '数量',
input: true,
param: 'number',
align: 'center',
width: '100',
show: true,
renderheader: this.renderheader,
ortable: true,
formatter: (row) => {
let obj = ''
obj = row.number.number
return obj
}
}
]
}
},
computed: {
date() {
var date = new Date()
return date.toLocaleDateString()
},
sumprice() {
var price = 0
this.tableData.map((res) => {
price += Number(res.pay_amount)
})
return price
},
aaa() {
const obj = JSON.parse(JSON.stringify(this.formLabelAlign))
for (const key in obj) {
this.input.map((res, index) => {
if (res.enName == key) {
if (Array.isArray(res.options)) {
res.options.map(r => {
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
}
return obj
}
},
watch: {},
methods: {
toImg() { //
window.pageYoffset = 0
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
})
},
handleClose() {
this.$emit('update:dialogVisible', false)
},
share() { //
this.$nextTick(function() {
pre_print().then((res) => {
new QRCode(this.$refs.qrCodeUrl, {
text: res.datas.url,
width: 120,
height: 110,
colorDark: '#333333', //
colorLight: '#ffffff', //
correctLevel: QRCode.CorrectLevel.L // L/M/H
})
})
})
},
//
hide() {
this.$nextTick(function() {
this.$refs.qrCodeUrl.innerHTML = ''
})
}
}
}
</script>
<style lang="less" scoped>
.body {
display: flex;
flex-direction: column;
}
.body-text {
display: flex;
flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: center;
align-items: center;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#4ca48c;
font-size: 20px;
}
</style>

View File

@ -0,0 +1,809 @@
<template>
<el-dialog
title="添加物品信息"
:visible.sync="Itemshow"
width="1000px"
top="5vh"
append-to-body
class="dialogclass"
:close-on-click-modal="false"
:before-close="handleClose"
>
<div class="main">
<span style="color:red">
手动添加机器将不获取采购单的机器以实物添加
</span>
<el-form ref="form" :model="form" :rules="rules" :inline="true" label-width="95px">
<h3 style="font-weight: bold;">机器信息</h3>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="分类" prop="cate_id">
<el-select v-model="form.cate_id" size="small" placeholder="请选择分类" filterable clearable @change="change(form.cate_id,'cate_id')">
<el-option v-for="(e,i) in cate_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="品牌" prop="brand_id">
<el-select v-model="form.brand_id" size="small" placeholder="请选择品牌" filterable clearable @change="change(form.brand_id,'brand_id')">
<el-option v-for="(e,i) in brand_options" :key="i+1" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="型号" prop="model_id">
<el-select v-model="form.model_id" size="small" placeholder="请选择型号" filterable clearable @change="change(form.model_id,'model_id')">
<el-option v-for="(e,i) in model_options" :key="i+2" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<div v-if="!!form.model_id">
<div>
<h3 style="font-weight: bold;">容量</h3>
<div class="btnclass">
<el-button v-for="(v,index) in rom_options" :key="index" class="buttonDiv" plain :type="form.rom_id==v.value ? 'primary' :''" @click="romclick($event,v)">{{ v.label }}</el-button>
</div>
</div>
<h3 style="font-weight: bold;">颜色</h3>
<div style="display:flex;">
<div v-for="(v,index) in color_options" :key="index" style="display:flex;flex-direction:column;margin:0 5px;align-items: center;">
<el-popover
placement="right"
width="350"
trigger="click"
>
<el-image
v-if="v.img"
style="height: 350px"
:src="v.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<el-image
slot="reference"
style="height: 70px;width:70px"
:src="v.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</el-popover>
<div class="btnclass">
<el-button plain :type="form.color_id==v.value ? 'primary' :''" @click="colorclick($event,v)">{{ v.label }}</el-button>
</div>
</div>
</div>
</div>
<!-- 基础信息 -->
<div>
<h3 style="font-weight: bold;">基础信息</h3>
<el-form-item label="客户" prop="customer_id">
<el-select v-model="form.customer_id" size="small" placeholder="请选择客户" filterable clearable>
<el-option v-for="(e,i) in customer_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item v-if="(formLabelAlign && formLabelAlign['warehousing_type'] == 1) || $route.name=='Createpurchaseorder'" label="价格" prop="pay_amount">
<el-input v-model="form.pay_amount" size="small" placeholder="请输入价格" clearable @input="form['pay_amount'] = AmountInput(form['pay_amount'],2,'exceed')" />
</el-form-item>
<el-form-item label="零售价" prop="retail_price">
<el-input v-model="form.retail_price" size="small" placeholder="请输入零售价" clearable />
</el-form-item>
<el-form-item v-if="formLabelAlign && formLabelAlign['warehousing_type'] == 2" label="参考价">
<el-input v-model="form.reference_price" size="small" placeholder="请输入参考价" clearable />
</el-form-item>
</div>
<!-- IMEI/SN/第三方条码 -->
<div>
<h3 style="font-weight: bold;">IMEI/SN/第三方条码</h3>
<el-form-item label="IMEI" prop="imei1">
<el-input v-model="form.imei1" size="small" placeholder="请输入IMEI" clearable />
</el-form-item>
<el-form-item label="IMEI2" prop="imei2">
<el-input v-model="form.imei2" size="small" placeholder="请输入IMEI2" clearable />
</el-form-item>
<el-form-item label="SN" prop="sn">
<el-input v-model="form.sn" size="small" placeholder="请输入SN" clearable />
</el-form-item>
<el-form-item label="第三方条码" prop="pjt_product_no">
<el-input v-model="form.pjt_product_no" size="small" placeholder="请输入第三方条码" clearable />
</el-form-item>
</div>
<!-- 属性 -->
<div>
<h3 style="font-weight: bold;">属性</h3>
<el-form-item label="质检员" prop="op_user_id">
<el-select v-model="form.op_user_id" size="small" placeholder="请选择质检员" filterable clearable>
<el-option v-for="(e,i) in op_user_id_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="报价师" prop="quote_user_id">
<el-select v-model="form.quote_user_id" size="small" placeholder="请选择报价师" filterable clearable>
<el-option v-for="(e,i) in quote_user_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="ID锁" prop="fmi_lock">
<el-select v-model="form.fmi_lock" size="small" placeholder="请选择ID锁" filterable clearable>
<el-option v-for="(e,i) in id_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="国别" prop="countries">
<el-select v-model="form.countries" size="small" placeholder="请选择国别" filterable clearable>
<el-option v-for="(e,i) in countries_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="机器等级(成色)" prop="level_name">
<el-select v-model="form.level_name" size="small" placeholder="请选择机器等级(成色)" filterable clearable>
<el-option v-for="(e,i) in grade_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="系统版本" prop="sys_net_no">
<el-input v-model="form.sys_net_no" size="small" placeholder="请输入系统版本" clearable />
</el-form-item>
<el-form-item label="电池健康" prop="battery_health">
<el-input v-model="form.battery_health" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" size="small" placeholder="请输入电池健康" clearable>
<span slot="suffix">%</span>
</el-input>
</el-form-item>
<el-form-item label="充电次数" prop="recharge_num">
<el-input v-model="form.recharge_num" size="small" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" placeholder="请输入充电次数" clearable />
</el-form-item>
<el-form-item label="网络制式" prop="network">
<el-select v-model="form.network" size="small" placeholder="请选择网络制式" filterable clearable>
<el-option v-for="(e,i) in network_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<!-- <el-form-item label="机器成色" prop="fineness">
<el-input v-model="form.fineness" size="small" placeholder="请输入机器成色" clearable>
</el-input>
</el-form-item> -->
</div>
</el-form>
<!-- 备注 -->
<div>
<h3 style="font-weight: bold;">备注</h3>
<div class="flex-b">
<div style="flex:1">
<el-input v-model="form.remark" type="textarea" :rows="3" resize="none" placeholder="请输入备注" />
</div>
<span style="flex:1;display: flex;justify-content: flex-end;align-items: center;margin-top: 50px;">
<span style="margin-right:5px">机器是否开启查询功能 </span>
<el-switch v-model="warranty_query" active-color="#3498db" :active-value="1" :inactive-value="2" @change="warrantychange" />
</span>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" plain @click="next('form')">添加并下一台</el-button>
<el-button type="primary" @click="add('form')">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import { ai_model_update_v2, cate_brand_list_all, user_warranty_query, auto_query_for_imei, save_drafts_box, third_party_no, drafts_box_add_repeat } from '@/api/Warehousing' //
import { res_advanced_search } from '@/api/machineList' //
import { pre_print } from '@/api/machineList' //
import { op_order_details_code } from '@/api/Warehousing' //
import { mapGetters } from 'vuex'
import { uuid } from 'vue-uuid'
export default {
name: 'Warehousingprint',
data() {
return {
warranty_query: 2,
form: { cate_id: null, brand_id: null, model_id: null, rom_id: null, color_id: null,op_user_id:'',customer_id:''},
rules: {
cate_id: [
{ required: true, message: '请选择分类', trigger: ['blur', 'change'] }
],
brand_id: [
{ required: true, message: '请选择品牌', trigger: ['blur', 'change'] }
],
model_id: [
{ required: true, message: '请选择型号', trigger: ['blur', 'change'] }
],
customer_id: [
{ required: true, message: '请选择客户', trigger: ['blur', 'change'] }
],
pay_amount: [
{ required: true, message: '请输入价格', trigger: ['blur', 'change'] }
]
},
cate_options: [],
brand_options: [],
model_options: [],
rom_options: [],
color_options: [],
customer_options: [],
quote_user_options: [],
op_user_id_options: [],
grade_options: [],
network_options: [],
countries_options: [//
{ label: '中国', value: '中国' },
{ label: '国行运营商', value: '国行运营商' },
{ label: '国行全网通', value: '国行全网通' },
{ label: '海外', value: '海外' },
{ label: '美版', value: '美版' },
{ label: '日本', value: '日本' },
{ label: '韩版', value: '韩版' },
{ label: '港澳台', value: '港澳台' },
{ label: '新加坡', value: '新加坡' },
{ label: '欧盟', value: '欧盟' },
{ label: '国际版', value: '国际版' }],
id_options: [
{ label: '有', value: 1 },
{ label: '无', value: 2 },
{ label: '未知', value: 0 }]
}
},
computed: {
...mapGetters([
'is_warranty_query', // 12
'user_id'
]),
date() {
var date = new Date()
return date.toLocaleDateString()
},
sumprice() {
var price = 0
this.tableData.map((res) => {
price += Number(res.price)
})
return price
},
aaa() {
const obj = JSON.parse(JSON.stringify(this.formLabelAlign))
for (const key in obj) {
this.input.map((res, index) => {
if (res.enName == key) {
if (Array.isArray(res.options)) {
res.options.map(r => {
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
}
// window.localStorage.setItem("setform",JSON.stringify(this.formLabelAlign));//
return obj
}
},
watch: {
formLabelAlign: {
handler(now) {
if (this.formLabelAlign.customer_id !== 0) {
this.form.customer_id = this.formLabelAlign.customer_id
}
if (this.formLabelAlign.op_user_id !== 0) {
this.form.op_user_id = this.formLabelAlign.op_user_id
}
},
deep: true
},
'is_warranty_query': {
handler(val) {
this.warranty_query = val
}, deep: true, immediate: true
}
},
created() {
this.getcate()
// if(localStorage.getItem("setform")){
// let lastname = JSON.parse(localStorage.getItem("setform"));//
// this.formLabelAlign = lastname
// }
// console.log(this.formLabelAlign,'thisformLabelAlign')
},
props: {
Itemshow: {
type: Boolean,
default: () => {
return false
}
},
tableData: {
type: Array,
default: () => {
return []
}
},
msg: {
type: Object,
default: () => {
return {}
}
},
is_purchase: {
type: Number,
default: () => {
return ''
}
},
input: {
type: Array,
default: () => {
return []
}
},
formLabelAlign: {
type: Object,
default: () => {
return {}
}
},
jiqidata: {
type: Array,
default: () => {
return []
}
}
},
methods: {
//
warrantychange(e) {
user_warranty_query({ user_id: this.user_id, is_warranty_query: e }).then(res => {
this.$message({ type: 'success', message: e == 1 ? '查询已开启' : '查询已关闭' })
this.$store.dispatch('user/getInfo')
})
},
getcate() {
cate_brand_list_all().then(res => {
this.cate_options = res.datas
})
res_advanced_search({ p_user_id: this.$parent.formLabelAlign.subsidiary }).then(e => {
this.op_user_id_options = e.datas['op_user_id']
this.quote_user_options = e.datas['quote_user_id']
this.customer_options = e.datas['supplier_info']
this.grade_options = e.datas['rk_grade_list']
this.network_options = e.datas['network']
})
},
change(val, name) {
if (name == 'cate_id') {
this.form.brand_id = null
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: val }).then(res => {
this.brand_options = res.datas
})
} else {
this.brand_options = []
this.rom_options = []
this.color_options = []
}
} else if (name == 'brand_id') {
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: val }).then(res => {
this.model_options = res.datas
})
} else {
this.model_options = []
this.rom_options = []
this.color_options = []
}
} else {
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: this.form.brand_id, model_id: val }).then(res => {
this.rom_options = res.datas['rom_list']
this.color_options = res.datas['color_list']
})
} else {
this.rom_options = []
this.color_options = []
}
}
},
add(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$parent.is_batch = true
this.form.instorage_uuid = uuid.v4()
console.log(this.is_warranty_query)
if (this.is_warranty_query == 1) {
if (!!this.form.imei1 || !!this.form.imei2 || !!this.form.sn) {
const imei = []
imei.push({
imei_or_sn: { imei: this.form.imei1, imei2: this.form.imei2, sn: this.form.sn },
cate: this.form.cate,
brand: this.form.inquire_id,
instorage_uuid: this.form.instorage_uuid
})
this.form.imei = this.form.imei1
drafts_box_add_repeat({ res_info: [{ ...this.form, not_purchase: 1 }], client_type: 2, is_purchase: this.is_purchase, is_warranty_query: this.is_warranty_query }).then(res => {
if (res.errcode == 0) {
for (const key in this.form) {
this.$set(this.form, key, '')
}
this.handleClose()
this.$parent.getlist()
}
})
// save_drafts_box({client_type:2,is_purchase:this.is_purchase,phone_list:[{...this.form}]}).then(res=>{
// if (res.errcode == 0) {
// for (const key in this.form) {
// this.$set(this.form, key, '')
// }
// this.brand_options=[]
// this.model_options=[]
// this.rom_options=[]
// this.color_options=[]
// if (!!res.datas.total_repeat_num && res.datas.total_repeat_num.length>0) {
// this.$parent.repeatshow = true
// this.$parent.repeatdata=[]
// res.datas.total_repeat_num.map(e=>{
// e.repeat_num.map(k=>{
// this.$parent.repeatdata.push({...k,imei:e.imei,open:false,add:false,addshow:true})
// })
// })
// }else{
// if (this.is_warranty_query == 1) {
// auto_query_for_imei({imei_data: imei, }).then(res=>{
// this.$parent.getlist()
// })
// }else{
// this.$parent.getlist()
// }
// }
// }
// })
} else {
this.$message({ type: 'warning', message: '开启查询后IMEI/IMEI2/SN必须填写才能查询' })
}
} else {
const imei = []
imei.push({
imei_or_sn: { imei: this.form.imei1, imei2: this.form.imei2, sn: this.form.sn },
cate: this.form.cate,
brand: this.form.inquire_id,
instorage_uuid: this.form.instorage_uuid
})
this.form.imei = this.form.imei1
drafts_box_add_repeat({ res_info: [{ ...this.form, not_purchase: 1 }], client_type: 2, is_purchase: this.is_purchase, is_warranty_query: this.is_warranty_query }).then(res => {
if (res.errcode == 0) {
for (const key in this.form) {
this.$set(this.form, key, '')
}
this.handleClose()
this.$parent.getlist()
}
})
// save_drafts_box({client_type:2,is_purchase:this.is_purchase,phone_list:[{...this.form}]}).then(res=>{
// if (res.errcode == 0) {
// for (const key in this.form) {
// this.$set(this.form, key, '')
// }
// this.brand_options=[]
// this.model_options=[]
// this.rom_options=[]
// this.color_options=[]
// if (!!res.datas.total_repeat_num && res.datas.total_repeat_num.length>0) {
// this.$parent.repeatshow = true
// this.$parent.repeatdata=[]
// res.datas.total_repeat_num.map(e=>{
// e.repeat_num.map(k=>{
// this.$parent.repeatdata.push({...k,imei:e.imei,open:false,add:false,addshow:true})
// })
// })
// }else{
// if (this.is_warranty_query == 1) {
// auto_query_for_imei({imei_data: imei, }).then(res=>{
// this.$parent.getlist()
// })
// }else{
// this.$parent.getlist()
// }
// }
// }
// })
}
} else {
return false
}
})
},
next(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$parent.is_batch = true
this.form.instorage_uuid = uuid.v4()
if (this.is_warranty_query == 1) {
if (!!this.form.imei1 || !!this.form.imei2 || !!this.form.sn) {
const imei = []
imei.push({
imei_or_sn: { imei: this.form.imei1, imei2: this.form.imei2, sn: this.form.sn },
cate: this.form.cate,
brand: this.form.inquire_id,
instorage_uuid: this.form.instorage_uuid
})
this.form.imei = this.form.imei1
drafts_box_add_repeat({ res_info: [{ ...this.form, not_purchase: 1 }], client_type: 2, is_purchase: this.is_purchase }).then(res => {
if (res.errcode == 0) {
for (const key in this.form) {
this.$set(this.form, key, '')
}
if (this.is_warranty_query == 1) {
auto_query_for_imei({ imei_data: imei }).then(res => {
this.$parent.getlist()
})
} else {
this.$parent.getlist()
}
}
})
// save_drafts_box({client_type:2,is_purchase:this.is_purchase,phone_list:[{...this.form}]}).then(res=>{
// if (res.errcode == 0) {
// for (const key in this.form) {
// this.$set(this.form, key, '')
// }
// this.brand_options=[]
// this.model_options=[]
// this.rom_options=[]
// this.color_options=[]
// if (!!res.datas.total_repeat_num && res.datas.total_repeat_num.length>0) {
// this.$parent.repeatshow = true
// this.$parent.repeatdata=[]
// res.datas.total_repeat_num.map(e=>{
// e.repeat_num.map(k=>{
// this.$parent.repeatdata.push({...k,imei:e.imei,open:false,add:false,addshow:true})
// })
// })
// }else{
// if (this.is_warranty_query == 1) {
// auto_query_for_imei({imei_data: imei, }).then(res=>{
// this.$parent.getlist()
// })
// }else{
// this.$parent.getlist()
// }
// }
// }
// })
} else {
this.$message({ type: 'warning', message: '开启查询后IMEI/IMEI2/SN必须填写才能查询' })
}
} else {
const imei = []
imei.push({
imei_or_sn: { imei: this.form.imei1, imei2: this.form.imei2, sn: this.form.sn },
cate: this.form.cate,
brand: this.form.inquire_id,
instorage_uuid: this.form.instorage_uuid
})
this.form.imei = this.form.imei1
drafts_box_add_repeat({ res_info: [{ ...this.form, not_purchase: 1 }], client_type: 2, is_purchase: this.is_purchase }).then(res => {
if (res.errcode == 0) {
for (const key in this.form) {
this.$set(this.form, key, '')
}
if (this.is_warranty_query == 1) {
auto_query_for_imei({ imei_data: imei }).then(res => {
this.$parent.getlist()
})
} else {
this.$parent.getlist()
}
}
})
// save_drafts_box({client_type:2,is_purchase:this.is_purchase,phone_list:[{...this.form}]}).then(res=>{
// if (res.errcode == 0) {
// for (const key in this.form) {
// this.$set(this.form, key, '')
// }
// this.brand_options=[]
// this.model_options=[]
// this.rom_options=[]
// this.color_options=[]
// if (!!res.datas.total_repeat_num && res.datas.total_repeat_num.length>0) {
// this.$parent.repeatshow = true
// this.$parent.repeatdata=[]
// res.datas.total_repeat_num.map(e=>{
// e.repeat_num.map(k=>{
// this.$parent.repeatdata.push({...k,imei:e.imei,open:false,add:false,addshow:true})
// })
// })
// }else{
// if (this.is_warranty_query == 1) {
// auto_query_for_imei({imei_data: imei, }).then(res=>{
// this.$parent.getlist()
// })
// }else{
// this.$parent.getlist()
// }
// }
// }
// })
}
} else {
return false
}
})
},
romclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.rom_id = v.value
},
colorclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.color_id = v.value
},
toImg() { //
window.pageYoffset = 0
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
handleClose() {
this.$emit('update:itemshow', false)
// this.$emit("changeItemshow",false);
},
share() { //
op_order_details_code({ order_op_id: this.id }).then((res) => {
this.$delete(this.formLabelAlign, 'phone_list')
var list = JSON.stringify(this.formLabelAlign)
var host = window.location.host
var http = window.location.protocol
// console.log(`${http}`+'//'+`${host}/#/share2?uuid=`+res.datas.uuid+'&formLabelAlign='+list)
new QRCode(this.$refs.qrCodeUrl, {
// text:'https://erpv2.aiguovip.com/#/share/share?uuid='+res.datas.uuid,
text: `${http}` + '//' + `${host}/#/share2?uuid=` + this.id + '&formLabelAlign=' + list,
width: 120,
height: 110,
colorDark: '#333333', //
colorLight: '#ffffff', //
correctLevel: QRCode.CorrectLevel.L // L/M/H
})
})
},
//
hide() {
this.$nextTick(function() {
this.$refs.qrCodeUrl.innerHTML = ''
})
}
}
}
</script>
<style lang="less" scoped>
// .btnclass ::v-deep .el-button--primary:focus{
// margin-right: 12px;
// border-radius: 2px;
// box-shadow: 0 2px 4px 0 #f4f4f4;
// color: #2794f8;
// background: white;
// }
.btnclass ::v-deep .el-button--primary:hover{
border-radius: 2px;
color: #2794f8;
background: #d2e6fc;
border-color:#b3d8ff ;
}
.body {
display: flex;
flex-direction: column;
}
.body-text {
// display: flex;
// flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
// height: 20px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
</style>

674
Dialog/EditBrand.vue Normal file
View File

@ -0,0 +1,674 @@
<template>
<el-dialog
title="编辑机器信息"
:visible.sync="brandshow"
width="1200px"
top="5vh"
append-to-body
:close-on-click-modal="false"
:before-close="handleClose"
>
<div>
<div v-if="!!brandform['pjt_account']" class="paiclass">
<i v-if="brandform.level_name" class="level">{{ brandform.level_name }}</i>
<!-- <el-link type="primary" v-if="brandform.foreign.length>0" @click="inspectionclick(brandform)">质检报告</el-link> -->
<span>{{ brandform.pjt_contact_name }}:{{ brandform.pjt_account }}</span>
<span style="color:#e67e22;margin-left:5px">:{{ brandform.pjt_model_info }}</span>
</div>
<div style="display:flex;margin-top: 10px;">
<el-popover
v-if="!!brandform.img"
placement="right"
width="350"
trigger="hover"
>
<el-image
v-if="!!brandform.img"
style="height: 350px"
:src="brandform.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<el-image
v-if="!!brandform.img"
slot="reference"
style="height: 70px;width:70px"
:src="brandform.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</el-popover>
<div style="margin-left:10px;flex: 1;display: flex;flex-direction: column;justify-content: space-between;">
<div style="display: flex;align-items: center;margin-bottom: 5px;">
<div v-if="!!brandform['mp_full_model']" style="background:#ecf5ff;height:30px;display:flex;align-items:center;color: #1e90ff;padding: 0 30px;">
官网信息: {{ brandform['mp_full_model'] }}
</div>
<div style="margin-left:10px;font-size: 16px;font-weight: bold;color: #000;">
{{ brandform['brand_name'] }} {{ brandform['model_name'] }} {{ brandform['rom_name'] }} {{ brandform['color_name'] }}
</div>
</div>
<div style="display:flex;justify-content:space-between">
<div :span="7" style="display:flex;align-items:center;flex: 1;">
<span>IMEI</span>
<el-input v-model="brandform.imei1" size="mini" style="width: 70%;margin-left:5px" />
</div>
<div :span="7" style="display:flex;align-items:center; flex: 1;">
<span>IMEI2</span>
<el-input v-model="brandform.imei2" size="mini" style="width: 70%;margin-left:5px" />
</div>
<div :span="7" style="display:flex;align-items:center;flex: 1;">
<span>sn</span>
<el-input v-model="brandform.sn" size="mini" style="width: 70%;margin-left:5px" />
</div>
<div :span="7" style="display:flex;align-items:center;flex: 1;">
<span>第三方条码</span>
<el-input v-model="brandform.pjt_product_no" size="mini" style="width: 65%;margin-left:5px;flex:1" />
</div>
</div>
</div>
</div>
<!-- 品牌选择 -->
<div ref="ss" class="bodyclass">
<!-- 左边 -->
<div>
<h3 style="font-weight: bold;">分类</h3>
<div style="overflow-y: auto;height: 780px;">
<a-menu v-model="current" style="height: 100%;" mode="inline">
<a-menu-item v-for="(item,index) in cate_options" :key="item.value">
<span style="font-size:15px;color: #000;font-weight: 600;">{{ item.label }}</span>
</a-menu-item>
</a-menu>
</div>
</div>
<!-- 右边 -->
<div style="padding-left: 20px">
<div class="flex-b">
<h3 style="font-weight: bold;">品牌</h3>
<div>
<el-autocomplete v-model="keywords" style="width: 350px;" :fetch-suggestions="inputchange" size="small" placeholder="型号搜索(内容大于2个字符)" @select="handleSelect">
<template slot-scope="{ item }">
<div class="number" style="white-space: pre-wrap;">{{ item.brand_name }} {{ item.model_name }}</div>
</template>
</el-autocomplete>
</div>
</div>
<div>
<el-row>
<el-col v-for="(v,index) in brand_options" :key="index" :span="4" style="margin:10px">
<div class="btnclass">
<el-button class="buttonDiv" plain :type="brandform.brand_id==v.value ? 'primary' :''" style="width: 100%;" @click="brandclick($event,v)">{{ v.label }}</el-button>
</div>
</el-col>
</el-row>
<el-pagination layout="prev, pager, next" :page-size="10" :total="brandtotal" @current-change="currentchange" />
</div>
<h3 style="font-weight: bold;">型号</h3>
<div v-if="model_options && model_options.length>0">
<el-row>
<el-col v-for="(v,index) in model_options" :key="index" :span="4" style="margin:10px">
<div class="btnclass">
<el-button class="buttonDiv" plain :type="brandform.model_id==v.value ? 'primary' :''" style="width: 100%;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;" @click="modelclick($event,v)">
<el-tooltip v-if="v.label.length>18" class="item" effect="dark" :content="v.label" placement="top"> <span>{{ v.label }}</span></el-tooltip>
<span v-else>{{ v.label }}</span>
</el-button>
</div>
</el-col>
</el-row>
<el-pagination layout="prev, pager, next" :page-size="10" :total="modeltotal" @current-change="currentchange1" />
</div>
<div v-else>
请先选择品牌
</div>
<h3 style="font-weight: bold;">容量</h3>
<div v-if="rom_options && rom_options.length>0">
<el-row>
<el-col v-for="(v,index) in rom_options" :key="index" :span="4" style="margin:10px">
<div class="btnclass">
<el-button class="buttonDiv" plain :type="brandform.rom_id==v.value ? 'primary' :''" style="width: 100%;" @click="romclick($event,v)">{{ v.label }}</el-button>
</div>
</el-col>
</el-row>
</div>
<div v-else>
请先选择容量
</div>
<h3 style="font-weight: bold;">颜色</h3>
<div v-if="color_options && color_options.length>0" style="max-height: 340px;overflow-y: auto">
<el-row>
<el-col v-for="(v,index) in color_options" :key="index" :span="4" style="margin:10px">
<div style="display:flex;flex-direction:column;align-items:center;">
<el-popover
placement="right"
width="350"
trigger="click"
>
<el-image
v-if="v.img"
style="height: 350px"
:src="v.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<el-image
slot="reference"
style="height: 70px;width:70px"
:src="v.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</el-popover>
<div class="btnclass" style=" width: 100%;">
<el-button class="buttonDiv" plain :type="brandform.color_id==v.value ? 'primary' :''" style="width: 100%;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;" @click="colorclick($event,v)">
<el-tooltip v-if="v.label.length>12" class="item" effect="dark" :content="v.label" placement="top"> <span>{{ v.label }}</span></el-tooltip>
<span v-else>{{ v.label }}</span>
</el-button>
</div>
</div>
</el-col>
</el-row>
</div>
<div v-else>
请先选择颜色
</div>
</div>
</div>
</div>
<div style="text-align: right">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" @click="editinfo">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import { ai_model_update_v2, cate_brand_list_all, user_warranty_query } from '@/api/Warehousing' //
import { res_advanced_search } from '@/api/machineList' //
import { pre_print } from '@/api/machineList' //
import { op_order_details_code, cate_brand_list, edit_drafts_box, purchase_order_edit_phone } from '@/api/Warehousing' //
import { mapGetters } from 'vuex'
export default {
name: 'EditBrand',
data() {
return {
keywords: '',
warranty_query: 2,
form: { cate_id: null, brand_id: null, model_id: null, rom_id: null, color_id: null },
cate_options: [],
brand_options: [],
model_options: [],
rom_options: [],
color_options: [],
customer_options: [],
quote_user_options: [],
countries_options: [//
{ label: '中国', value: '中国' },
{ label: '国行运营商', value: '国行运营商' },
{ label: '国行全网通', value: '国行全网通' },
{ label: '海外', value: '海外' },
{ label: '美版', value: '美版' },
{ label: '日本', value: '日本' },
{ label: '韩版', value: '韩版' },
{ label: '港澳台', value: '港澳台' },
{ label: '新加坡', value: '新加坡' },
{ label: '欧盟', value: '欧盟' },
{ label: '国际版', value: '国际版' }],
id_options: [
{ label: '有', value: 1 },
{ label: '无', value: 2 },
{ label: '未知', value: 0 }],
current: [],
brandtotal: null,
modeltotal: null,
romtotal: null,
default_brand_id: null,
default_model_id: null
}
},
computed: {
...mapGetters([
'is_warranty_query', // 12
'user_id'
]),
date() {
var date = new Date()
return date.toLocaleDateString()
},
sumprice() {
var price = 0
this.tableData.map((res) => {
price += Number(res.price)
})
return price
},
aaa() {
const obj = JSON.parse(JSON.stringify(this.formLabelAlign))
for (const key in obj) {
this.input.map((res, index) => {
if (res.enName == key) {
if (Array.isArray(res.options)) {
res.options.map(r => {
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
}
// window.localStorage.setItem("setform",JSON.stringify(this.formLabelAlign));//
return obj
}
},
watch: {
// 'brandform.cate_id':{
// handler(val){
// if (!!val) {
// this.current=[val]
// }
// },deep:true,immediate:true
// },
current: {
handler(val) {
if (val[0]) {
this.brandform.cate_id = val[0]
this.getbrand()
this.brandform.brand_id = null
this.brandform.model_id = null
this.brandform.rom_id = null
this.brandform.color_id = null
this.model_options = []
this.rom_options = []
this.color_options = []
} else {
this.brandform.cate_id = 71510 //
this.brandform.brand_id = 71510
this.getbrand()
}
}, deep: true, immediate: true
}
},
created() {
this.getcate()
},
mounted() {
},
props: {
brandshow: {
type: Boolean,
default: () => {
return false
}
},
tableData: {
type: Array,
default: () => {
return []
}
},
brandform: {
type: Object,
default: () => {
return {}
}
},
id: {
type: String,
default: () => {
return ''
}
},
input: {
type: Array,
default: () => {
return []
}
},
formLabelAlign: {
type: Object,
default: () => {
return {}
}
},
jiqidata: {
type: Array,
default: () => {
return []
}
}
},
methods: {
inputchange(queryString, callback) {
if (!!queryString && queryString.length >= 2) {
//
cate_brand_list({ keywords: queryString }).then((res) => {
callback(res.datas)
}).catch((error) => {
})
} else {
callback([])
}
},
//
warrantychange(e) {
user_warranty_query({ user_id: this.user_id, is_warranty_query: e }).then(res => {
this.$message({ type: 'success', message: e == 1 ? '查询已开启' : '查询已关闭' })
this.$store.dispatch('user/getInfo')
})
},
getcate() {
cate_brand_list().then(res => {
this.current = [this.brandform.cate_id]
this.cate_options = res.datas.datas
})
res_advanced_search().then(e => {
this.quote_user_options = e.datas['quote_user_id']
this.customer_options = e.datas['supplier_info']
})
},
getbrand(page) {
cate_brand_list({ cate_id: this.brandform.cate_id, list_row: 10, page: page, default_brand_id: this.default_brand_id }).then(res => {
this.brand_options = res.datas.datas
this.brandtotal = res.datas.total
})
},
getmodel(page) {
cate_brand_list({ cate_id: this.brandform.cate_id, list_row: 10, page: page, brand_id: this.brandform.brand_id, default_model_id: this.default_model_id, default_brand_id: this.default_brand_id }).then(res => {
this.model_options = res.datas.datas
this.modeltotal = res.datas.total
})
},
async handleSelect(data) {
await this.$set(this.brandform, 'cate_id', data.cate_id)
await this.$set(this, 'default_brand_id', data.brand_id)
await this.$set(this, 'current', [data.cate_id])
await this.$set(this.brandform, 'brand_id', data.brand_id)
await this.$set(this, 'default_model_id', data.model_id)
await this.$set(this.brandform, 'model_id', data.model_id)
this.$set(this.brandform, 'rom_id', null)
this.$set(this.brandform, 'color_id', null)
// await this.getbrand()
await this.getmodel()
await this.getromcolor()
},
getromcolor(page) {
cate_brand_list({ cate_id: this.brandform.cate_id, list_row: 10, page: page, brand_id: this.brandform.brand_id, model_id: this.brandform.model_id, default_model_id: this.default_model_id, default_brand_id: this.default_brand_id }).then(res => {
this.rom_options = res.datas.datas['rom_list']
this.color_options = res.datas.datas['color_list']
this.romtotal = res.datas.total
})
},
editinfo() {
if (this.brandform.res_id) { //
purchase_order_edit_phone(this.brandform).then(res => {
this.$parent.getlist()
this.handleClose()
if (this.brandform.warranty_query_info_id) {
const obj = { warranty_query_info_id: this.brandform.warranty_query_info_id, cate_id: this.brandform['cate_id'], brand_id: this.brandform['brand_id'],
model_id: this.brandform['model_id'], rom_id: this.brandform['rom_id'], color_id: this.brandform['color_id'] }
ai_model_update_v2(obj).then(res => {})
}
})
} else {
edit_drafts_box({ ...this.brandform, client_type: 2 }).then(res => {
if (this.brandform.warranty_query_info_id) {
const obj = { warranty_query_info_id: this.brandform.warranty_query_info_id, cate_id: this.brandform['cate_id'], brand_id: this.brandform['brand_id'],
model_id: this.brandform['model_id'], rom_id: this.brandform['rom_id'], color_id: this.brandform['color_id'] }
ai_model_update_v2(obj).then(res => {})
}
this.$parent.getlist()
this.handleClose()
})
}
},
change(val, name) {
if (name == 'cate_id') {
this.form.brand_id = null
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: val }).then(res => {
this.brand_options = res.datas
})
} else {
this.brand_options = []
this.rom_options = []
this.color_options = []
}
} else if (name == 'brand_id') {
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: val }).then(res => {
this.model_options = res.datas
})
} else {
this.model_options = []
this.rom_options = []
this.color_options = []
}
} else {
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: this.form.brand_id, model_id: val }).then(res => {
this.rom_options = res.datas['rom_list']
this.color_options = res.datas['color_list']
})
} else {
this.rom_options = []
this.color_options = []
}
}
},
brandclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.brandform.brand_id = v.value
this.brandform.model_id = null
this.brandform.rom_id = null
this.brandform.color_id = null
this.model_options = []
this.rom_options = []
this.color_options = []
this.getmodel()
},
modelclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.brandform.model_id = v.value
this.brandform.rom_id = null
this.brandform.color_id = null
this.rom_options = []
this.color_options = []
this.getromcolor()
},
romclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.brandform.rom_id = v.value
},
colorclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.brandform.color_id = v.value
},
currentchange(data) {
this.getbrand(data)
},
currentchange1(data) {
this.getmodel(data)
},
currentchange2(data) {
this.getromcolor(data)
},
handleClose() {
this.$set(this, 'keywords', '')
this.model_options = []
this.rom_options = []
this.color_options = []
this.$emit('update:brandshow', false)
}
}
}
</script>
<style lang="less" scoped>
::v-deep .el-dialog__header{
padding: 10px 20px 0px;
}
.bodyclass{
margin-top:10px;
display: flex;
//height: 720px;
}
.bodyclass ::v-deep .el-button{
padding: 8px;
}
// .btnclass ::v-deep .el-button--primary:focus{
// margin-right: 12px;
// border-radius: 2px;
// box-shadow: 0 2px 4px 0 #f4f4f4;
// color: #2794f8;
// background: white;
// }
.btnclass ::v-deep .el-button--primary:hover{
border-radius: 2px;
color: #2794f8;
background: #d2e6fc;
border-color:#b3d8ff ;
}
.body {
display: flex;
flex-direction: column;
}
.body-text {
// display: flex;
// flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
// height: 20px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
.level{
display: inline-block;
height: 20px;
line-height: 20px;
padding: 0 15px;
background: #ff633c;
border-radius: 12px;
font-size: 12px;;
font-weight: 500;
color: #fff;
cursor: pointer;
margin:0px 10px;
}
.paiclass{
height: 40px;
background: #f2f2f2;
display: flex;
font-size: 16px;
align-items: center;
}
</style>

476
Dialog/EditIteminfo.vue Normal file
View File

@ -0,0 +1,476 @@
<template>
<el-dialog
title="编辑属性"
:visible.sync="editshow"
width="1000px"
top="5vh"
append-to-body
:close-on-click-modal = "false"
:before-close="handleClose"
>
<div class="main" >
<!-- 基础信息 -->
<div>
<h3 style="font-weight: bold;">基础信息</h3>
<el-form ref="form" :model="attributeform" :inline="true" label-width="80px">
<el-form-item label="客户" required>
<el-select v-model="attributeform.customer_id" :disabled="!!attributeform.res_id" size="small" placeholder="请选择客户" filterable clearable>
<el-option v-for="(e,i) in customer_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="价格" required>
<el-input v-model="attributeform.pay_amount" :disabled="!!attributeform.res_id && ($route.name!='Purchase_order_Details'|| attributeform.pay_id>0 )" @input="attributeform['pay_amount'] = AmountInput(attributeform['pay_amount'],2,'exceed')" size="small" placeholder="请输入价格" clearable></el-input>
</el-form-item>
<el-form-item label="零售价">
<el-input v-model="attributeform.retail_price" size="small" placeholder="请输入零售价" clearable></el-input>
</el-form-item>
<el-form-item label="参考价" v-if="formLabelAlign && formLabelAlign['warehousing_type'] == 2">
<el-input v-model="attributeform.reference_price" size="small" placeholder="请输入参考价" clearable></el-input>
</el-form-item>
</el-form>
</div>
<!-- 属性 -->
<div>
<h3 style="font-weight: bold;">属性</h3>
<el-form ref="form" :model="attributeform" :inline="true" label-width="95px">
<el-form-item label="质检员" prop="op_user_id">
<el-select v-model="attributeform.op_user_id" size="small" placeholder="请选择质检员" filterable clearable>
<el-option v-for="(e,i) in op_user_id_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="报价师" >
<el-select v-model="attributeform.quote_user_id" size="small" placeholder="请选择报价师" filterable clearable>
<el-option v-for="(e,i) in quote_user_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="ID锁" >
<el-select v-model="attributeform.fmi_lock" size="small" placeholder="请选择ID锁" filterable clearable>
<el-option v-for="(e,i) in id_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="国别" >
<el-select v-model="attributeform.countries" size="small" placeholder="请选择国别" filterable clearable>
<el-option v-for="(e,i) in countries_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="机器等级(成色)" >
<el-select v-model="attributeform.grade" size="small" placeholder="请选择机器等级(成色)" filterable clearable>
<el-option v-for="(e,i) in grade_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="系统版本">
<el-input v-model="attributeform.sys_net_no" size="small" placeholder="请输入系统版本" clearable></el-input>
</el-form-item>
<el-form-item label="电池健康">
<el-input v-model="attributeform.battery_health" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" size="small" placeholder="请输入电池健康" clearable>
<span slot="suffix">%</span>
</el-input>
</el-form-item>
<el-form-item label="充电次数">
<el-input v-model="attributeform.recharge_num" size="small" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" placeholder="请输入充电次数" clearable></el-input>
</el-form-item>
<el-form-item label="网络制式" >
<el-select v-model="attributeform.network" size="small" placeholder="请选择网络制式" filterable clearable>
<el-option v-for="(e,i) in network_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<!-- 备注 -->
<div>
<h3 style="font-weight: bold;">备注</h3>
<div class="flex-b">
<div>
<el-input type="textarea" :rows="3" resize="none" placeholder="请输入备注" v-model="attributeform.remark"></el-input>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" @click="editinfo">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import {ai_model_update_v2,cate_brand_list_all,user_warranty_query,purchase_order_edit_phone,edit_drafts_box} from "@/api/Warehousing"; //
import { res_advanced_search } from "@/api/machineList"; //
import {pre_print} from "@/api/machineList"; //
import { op_order_details_code } from "@/api/Warehousing"; //
import { mapGetters } from 'vuex'
export default {
name: "Warehousingprint",
data() {
return {
warranty_query:2,
form:{cate_id:null,brand_id:null,model_id:null,rom_id:null,color_id:null},
cate_options:[],
brand_options:[],
model_options:[],
rom_options:[],
customer_options:[],
quote_user_options:[],
grade_options:[],
network_options:[],
op_user_id_options:[],
countries_options:[//
{label:"中国",value:"中国"},
{label:"国行运营商",value:"国行运营商"},
{label:"国行全网通",value:"国行全网通"},
{label:"海外",value:"海外"},
{label:"美版",value:"美版"},
{label:"日本",value:"日本"},
{ label: '韩版', value: '韩版' },
{label:"港澳台",value:"港澳台"},
{label:"新加坡",value:"新加坡"},
{label:"欧盟",value:"欧盟"},
{label:"国际版",value:"国际版"}],
id_options:[
{ label: "有", value: 1 },
{ label: "无", value: 2 },
{ label: "未知", value: 0 },]
};
},
computed:{
...mapGetters([
'is_warranty_query',//12
'user_id',
]),
date() {
var date = new Date();
return date.toLocaleDateString();
},
sumprice() {
var price = 0;
this.tableData.map((res) => {
price += Number(res.price);
});
return price;
},
aaa(){
let obj = JSON.parse(JSON.stringify(this.formLabelAlign))
for(let key in obj){
this.input.map((res,index) => {
if (res.enName == key) {
if(Array.isArray(res.options)){
res.options.map(r=>{
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
}
// window.localStorage.setItem("setform",JSON.stringify(this.formLabelAlign));//
return obj
},
},
watch:{
'is_warranty_query':{
handler(val){
this.warranty_query=val
},deep:true,immediate:true
}
},
created(){
this.getcate()
// if(localStorage.getItem("setform")){
// let lastname = JSON.parse(localStorage.getItem("setform"));//
// this.formLabelAlign = lastname
// }
// console.log(this.formLabelAlign,'thisformLabelAlign')
},
props: {
editshow: {
type: Boolean,
default: () => {
return false;
},
},
tableData: {
type: Array,
default: () => {
return [];
},
},
attributeform: {
type: Object,
default: () => {
return {};
},
},
id: {
type: String,
default: () => {
return '';
},
},
input: {
type: Array,
default: () => {
return [];
},
},
formLabelAlign: {
type: Object,
default: () => {
return {};
},
},
jiqidata: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
//
warrantychange(e){
user_warranty_query({user_id:this.user_id,is_warranty_query:e}).then(res=>{
this.$message({type:'success',message:e==1?'查询已开启' :'查询已关闭'})
this.$store.dispatch('user/getInfo')
})
},
getcate(){
cate_brand_list_all().then(res=>{
this.cate_options=res.datas
})
res_advanced_search({p_user_id:this.attributeform.company_user_id}).then(e=>{
this.op_user_id_options=e.datas['op_user_id']
this.quote_user_options=e.datas['quote_user_id']
this.customer_options=e.datas['supplier_info']
this.grade_options=e.datas['grade_list']
this.network_options=e.datas['network']
})
},
editinfo(){
if (!!this.attributeform.res_id) {//
purchase_order_edit_phone(this.attributeform).then(res=>{
this.$parent.getlist()
this.handleClose()
})
}else{
edit_drafts_box({...this.attributeform,client_type:2}).then(res=>{
this.$parent.getlist()
this.handleClose()
})
}
},
change(val,name){
if (name=='cate_id') {
this.form.brand_id=null
this.form.model_id=null
this.form.rom_id=null
this.form.color_id=null
if (!!val) {
cate_brand_list_all({cate_id:val}).then(res=>{
this.brand_options=res.datas
})
}else{
this.brand_options=[]
this.rom_options=[]
this.color_options=[]
}
}else if(name=='brand_id'){
this.form.model_id=null
this.form.rom_id=null
this.form.color_id=null
if (!!val) {
cate_brand_list_all({cate_id:this.form.cate_id,brand_id:val}).then(res=>{
this.model_options=res.datas
})
}else{
this.model_options=[]
this.rom_options=[]
this.color_options=[]
}
}else{
this.form.rom_id=null
this.form.color_id=null
if (!!val) {
cate_brand_list_all({cate_id:this.form.cate_id,brand_id:this.form.brand_id,model_id:val}).then(res=>{
this.rom_options=res.datas['rom_list']
this.color_options=res.datas['color_list']
})
}else{
this.rom_options=[]
this.color_options=[]
}
}
},
romclick(e,v){
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.rom_id=v.value
},
colorclick(e,v){
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.color_id=v.value
},
toImg() { //
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true,
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
handleClose() {
this.$emit("update:editshow", false);
},
share() { //
op_order_details_code({order_op_id:this.id}).then((res) => {
this.$delete(this.formLabelAlign,'phone_list');
var list = JSON.stringify(this.formLabelAlign)
var host = window.location.host;
var http = window.location.protocol
// console.log(`${http}`+'//'+`${host}/#/share2?uuid=`+res.datas.uuid+'&formLabelAlign='+list)
new QRCode(this.$refs.qrCodeUrl, {
// text:'https://erpv2.aiguovip.com/#/share/share?uuid='+res.datas.uuid,
text:`${http}`+'//'+`${host}/#/share2?uuid=`+this.id+'&formLabelAlign='+list,
width: 120,
height: 110,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L, //L/M/H
});
})
},
//
hide() {
this.$nextTick(function () {
this.$refs.qrCodeUrl.innerHTML = "";
});
},
},
};
</script>
<style lang="less" scoped>
// .btnclass ::v-deep .el-button--primary:focus{
// margin-right: 12px;
// border-radius: 2px;
// box-shadow: 0 2px 4px 0 #f4f4f4;
// color: #2794f8;
// background: white;
// }
.btnclass ::v-deep .el-button--primary:hover{
border-radius: 2px;
color: #2794f8;
background: #d2e6fc;
border-color:#b3d8ff ;
}
.body {
display: flex;
flex-direction: column;
}
.body-text {
// display: flex;
// flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
// height: 20px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
</style>

733
Dialog/Editall.vue Normal file
View File

@ -0,0 +1,733 @@
<template>
<el-dialog
title="编辑属性"
:visible.sync="allshow"
width="1000px"
top="2vh"
class="dialogclass"
append-to-body
:close-on-click-modal = "false"
:before-close="handleClose"
>
<div class="main" >
<div class="paiclass" v-if="!!allform['pjt_account']">
<i class="level" v-if="allform.level_name">{{allform.level_name}}</i>
<span>{{allform.pjt_contact_name}}:{{allform.pjt_account}}</span>
<span style="color:#e67e22;margin-left:5px">:{{allform.pjt_model_info}}</span>
</div>
<div v-if="!!allform['order_sn']">
<span>来源: <span style="color:#3498db">采购单:{{allform['order_sn']}}</span></span> <span>客户: <span style="color:#3498db">{{allform['customer_name']}}</span></span> <span>采购价格: <span style="color:#3498db">{{allform['pay_amount']}}</span></span>
</div>
<div style="display:flex;margin-top: 10px;">
<el-popover
v-if="!!allform.img"
placement="right"
width="350"
trigger="hover"
>
<el-image
style="height: 350px"
:src="allform.img"
>
<div slot="error" class="image-slot" style="display:flex;flex-direction:column;align-items:center">
<i class="el-icon-picture-outline"></i>
<span>暂无图片</span>
</div>
</el-image>
<el-image
slot="reference"
style="height: 70px;width:70px;"
:src="allform.img">
<div slot="error" class="image-slot" style="display:flex;flex-direction:column;align-items:center">
<i class="el-icon-picture-outline"></i>
<span>暂无图片</span>
</div>
</el-image>
</el-popover>
<el-image
v-else
slot="reference"
style="height: 70px;width:70px;display: flex;align-items: center;"
:src="allform.img">
<div slot="error" class="image-slot" style="display:flex;flex-direction:column;align-items:center">
<i class="el-icon-picture-outline"></i>
<span>暂无图片</span>
</div>
</el-image>
<div style="margin-left:10px;flex: 1;display: flex;flex-direction: column;justify-content: space-between;">
<div style="display: flex;align-items: center;">
<div v-if="!!allform['mp_full_model']" style="background:#ecf5ff;height:30px;display:flex;align-items:center;color: #1e90ff;padding: 0 30px;">
官网信息: {{allform['mp_full_model']}}
</div>
<div style="margin-left:10px;font-size: 16px;font-weight: bold;color: #000;">
{{allform['brand_name']}} {{allform['model_name']}} {{allform['rom_name']}} {{allform['color_name']}}
</div>
</div>
<div style="display:flex;justify-content:space-between">
<div :span="7" style="display:flex;align-items:center;flex: 1;">
<span>IMEI</span>
<el-input v-model="allform.imei1" size="mini" style="width: 70%;margin-left:5px"></el-input>
</div>
<div :span="7" style="display:flex;align-items:center; flex: 1;">
<span>IMEI2</span>
<el-input v-model="allform.imei2" size="mini" style="width: 70%;margin-left:5px" ></el-input>
</div>
<div :span="7" style="display:flex;align-items:center;flex: 1;">
<span>sn</span>
<el-input v-model="allform.sn" size="mini" style="width: 70%;margin-left:5px"></el-input>
</div>
<div :span="7" style="display:flex;align-items:center;flex: 1;">
<span>第三方条码</span>
<el-input v-model="allform.pjt_product_no" size="mini" style="width: 65%;margin-left:5px;flex:1"></el-input>
</div>
</div>
</div>
</div>
<div class="flex-b" style="margin:10px 0">
<h3 style="font-weight: bold;">机器信息</h3>
<div>
<el-autocomplete style="width: 350px;" v-model="keywords" :fetch-suggestions="inputchange" size="small" placeholder="型号搜索(内容大于2个字符)" @select="handleSelect" >
<template slot-scope="{ item }">
<div class="number" style="white-space: pre-wrap;">{{item.brand_name}} {{item.model_name}}</div>
</template>
</el-autocomplete>
</div>
</div>
<el-form ref="allform" :model="allform" :rules="rules" :inline="true" label-width="80px">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="分类" prop="cate_id" >
<el-select v-model="allform.cate_id" @change="change(allform.cate_id,'cate_id')" size="small" placeholder="请选择分类" filterable clearable>
<el-option v-for="(e,i) in cate_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="品牌" prop="brand_id" >
<el-select v-model="allform.brand_id" @change="change(allform.brand_id,'brand_id')" size="small" placeholder="请选择品牌" filterable clearable>
<el-option v-for="(e,i) in brand_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="型号" prop="model_id" >
<el-select v-model="allform.model_id" @change="change(allform.model_id,'model_id')" size="small" placeholder="请选择型号" filterable clearable>
<el-option v-for="(e,i) in model_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div v-if="!!allform.model_id">
<div>
<h3 style="font-weight: bold;">容量</h3>
<div class="btnclass">
<el-button class="buttonDiv" plain v-for="(v,index) in rom_options" :type="allform.rom_id==v.value ? 'primary' :''" :key="index" @click="romclick($event,v)">{{v.label}}</el-button>
</div>
</div>
<h3 style="font-weight: bold;">颜色</h3>
<div style="display:flex;flex-wrap: wrap;">
<div v-for="(v,index) in color_options" :key="index" style="display:flex;flex-direction:column;margin:0 5px">
<el-image
style="width: 70px; height: 70px"
:src="v.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
<el-button plain :type="allform.color_id==v.value ? 'primary' :''" @click="colorclick($event,v)">{{v.label}}</el-button>
</div>
</div>
</div>
<!-- 基础信息 -->
<div>
<h3 style="font-weight: bold;">基础信息</h3>
<el-form-item label="客户" required>
<el-select v-model="allform.customer_id" :disabled="!!allform.res_id" size="small" placeholder="请选择客户" filterable clearable>
<el-option v-for="(e,i) in customer_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="价格" required>
<el-input v-model="allform.pay_amount" :disabled="!!allform.res_id && ($route.name!='Purchase_order_Details'|| allform.pay_id>0 ) " size="small" placeholder="请输入价格" clearable></el-input>
</el-form-item>
<el-form-item label="零售价">
<el-input v-model="allform.retail_price" size="small" placeholder="请输入零售价" clearable></el-input>
</el-form-item>
<el-form-item label="参考价" v-if="formLabelAlign && formLabelAlign['warehousing_type'] == 2">
<el-input v-model="allform.reference_price" size="small" placeholder="请输入参考价" clearable></el-input>
</el-form-item>
</div>
</el-form>
<!-- 属性 -->
<div>
<h3 style="font-weight: bold;">属性</h3>
<el-form ref="form" :model="allform" :inline="true" label-width="95px">
<el-form-item label="质检员" prop="op_user_id">
<el-select v-model="allform.op_user_id" size="small" placeholder="请选择质检员" filterable clearable>
<el-option v-for="(e,i) in op_user_id_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="报价师" >
<el-select v-model="allform.quote_user_id" size="small" placeholder="请选择报价师" filterable clearable>
<el-option v-for="(e,i) in quote_user_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="ID锁" >
<el-select v-model="allform.fmi_lock" size="small" placeholder="请选择ID锁" filterable clearable>
<el-option v-for="(e,i) in id_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="保修类型" >
<el-select v-model="allform.baoxiu_type" size="small" placeholder="请选择ID锁" filterable clearable>
<el-option v-for="(e,i) in Warranty_type_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="国别" >
<el-select v-model="allform.countries" size="small" placeholder="请选择国别" filterable clearable>
<el-option v-for="(e,i) in countries_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="机器等级(成色)" >
<el-select v-model="allform.grade" size="small" placeholder="请选择机器等级(成色)" filterable clearable>
<el-option v-for="(e,i) in grade_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="系统版本">
<el-input v-model="allform.sys_net_no" size="small" placeholder="请输入系统版本" clearable></el-input>
</el-form-item>
<el-form-item label="电池健康">
<el-input v-model="allform.battery_health" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" size="small" placeholder="请输入电池健康" clearable>
<span slot="suffix">%</span>
</el-input>
</el-form-item>
<el-form-item label="充电次数">
<el-input v-model="allform.recharge_num" size="small" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" placeholder="请输入充电次数" clearable></el-input>
</el-form-item>
<el-form-item label="网络制式" >
<el-select v-model="allform.network" size="small" placeholder="请选择网络制式" filterable clearable>
<el-option v-for="(e,i) in network_options" :key="i" :label="e.label" :value="e.value"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="机器成色" prop="fineness">
<el-input v-model="allform.fineness" size="small" placeholder="请输入机器成色" clearable>
</el-input>
</el-form-item> -->
</el-form>
</div>
<!-- 备注 -->
<div>
<h3 style="font-weight: bold;">备注</h3>
<div class="flex-b">
<div>
<el-input type="textarea" :rows="3" resize="none" placeholder="请输入备注" v-model="allform.remark"></el-input>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" @click="editinfo">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import {cate_brand_list,cate_brand_list_all,user_warranty_query,purchase_order_edit_phone,edit_drafts_box,ai_model_update_v2,op_order_details_code} from "@/api/Warehousing"; //
import { res_advanced_search } from "@/api/machineList"; //
import {pre_print} from "@/api/machineList"; //
import { edit_super_amount } from "@/api/Jiqidetails"; //
import { mapGetters } from 'vuex'
export default {
name: "Warehousingprint",
data() {
return {
keywords:'',
warranty_query:2,
form:{cate_id:null,brand_id:null,model_id:null,rom_id:null,color_id:null},
cate_options:[],
brand_options:[],
model_options:[],
rom_options:[],
color_options:[],
customer_options:[],
quote_user_options:[],
grade_options:[],
network_options:[],
op_user_id_options:[],
Warranty_type_options:[
{label:"过保",value:"1"},
{label:"在保",value:"2"},
{label:"已更换",value:"3"},
{label:"官换",value:"4"},
],
rules: {
cate_id: [
{ required: true, message: '请选择分类', trigger: ['blur','change'] },
],
brand_id: [
{ required: true, message: '请选择品牌', trigger: ['blur','change'] }
],
model_id: [
{ required: true, message: '请选择型号', trigger: ['blur','change'] }
],
customer_id: [
{ required: true, message: '请选择客户', trigger: ['blur','change'] }
],
pay_amount: [
{ required: true, message: '请输入价格', trigger: ['blur','change'] }
],
},
countries_options:[//
{label:"中国",value:"中国"},
{label:"国行运营商",value:"国行运营商"},
{label:"国行全网通",value:"国行全网通"},
{label:"海外",value:"海外"},
{label:"美版",value:"美版"},
{label:"日本",value:"日本"},
{ label: '韩版', value: '韩版' },
{label:"港澳台",value:"港澳台"},
{label:"新加坡",value:"新加坡"},
{label:"欧盟",value:"欧盟"},
{label:"国际版",value:"国际版"}],
id_options:[
{ label: "有", value: 1 },
{ label: "无", value: 2 },
{ label: "未知", value: 0 },]
};
},
computed:{
...mapGetters([
'is_warranty_query',//12
'user_id',
]),
date() {
var date = new Date();
return date.toLocaleDateString();
},
sumprice() {
var price = 0;
this.tableData.map((res) => {
price += Number(res.price);
});
return price;
},
aaa(){
let obj = JSON.parse(JSON.stringify(this.allformLabelAlign))
for(let key in obj){
this.input.map((res,index) => {
if (res.enName == key) {
if(Array.isArray(res.options)){
res.options.map(r=>{
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
}
// window.localStorage.setItem("setform",JSON.stringify(this.allformLabelAlign));//
return obj
},
},
watch:{
'is_warranty_query':{
handler(val){
this.warranty_query=val
},deep:true,immediate:true
},
allform:{
handler(){
if(this.grade_options){
this.grade_options.forEach(item=>{
if(item.label == this.allform.level_name){
this.$set(this.allform,'grade',item.value)
}
})
}
}
}
},
created(){
this.getcate()
// if(localStorage.getItem("setform")){
// let lastname = JSON.parse(localStorage.getItem("setform"));//
// this.allformLabelAlign = lastname
// }
// console.log(this.allformLabelAlign,'thisformLabelAlign')
},
props: {
allshow: {
type: Boolean,
default: () => {
return false;
},
},
tableData: {
type: Array,
default: () => {
return [];
},
},
allform: {
type: Object,
default: () => {
return {};
},
},
id: {
type: String,
default: () => {
return '';
},
},
input: {
type: Array,
default: () => {
return [];
},
},
formLabelAlign: {
type: Object,
default: () => {
return {};
},
},
jiqidata: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
inputchange(queryString,callback){
if (!!queryString && queryString.length>=2) {
//
cate_brand_list({keywords:queryString}).then((res) => {
callback(res.datas);
}).catch((error)=>{
});
}else{
callback([]);
}
},
//
warrantychange(e){
user_warranty_query({user_id:this.user_id,is_warranty_query:e}).then(res=>{
this.$message({type:'success',message:e==1?'查询已开启' :'查询已关闭'})
this.$store.dispatch('user/getInfo')
})
},
getcate(){
cate_brand_list_all().then(res=>{
this.cate_options=res.datas
})
res_advanced_search({p_user_id:this.allform.company_user_id}).then(e=>{
this.op_user_id_options=e.datas['op_user_id']
this.quote_user_options=e.datas['quote_user_id']
this.customer_options=e.datas['supplier_info']
this.grade_options=e.datas['grade_list']
this.network_options=e.datas['network']
})
},
editinfo(){
console.log(this.$route.name);
if (!!this.allform.res_id) {//
purchase_order_edit_phone(this.allform).then(res=>{
if (this.$route.name=='Purchase_order_Details') {
let obj={res_id:this.allform.res_id,amount:this.allform.pay_amount,order_type:1}
edit_super_amount(obj).then(e=>{
this.$parent.getpurchase_details()
})
}else if (this.$route.name=='Purchase_order') {
let obj={res_id:this.allform.res_id,amount:this.allform.pay_amount,order_type:1}
edit_super_amount(obj).then(e=>{
this.$parent.obtainList()
})
}else{
this.$parent.getlist()
}
if (!!this.allform.warranty_query_info_id) {
let obj = {warranty_query_info_id:this.allform.warranty_query_info_id,cate_id:this.allform['cate_id'],brand_id:this.allform['brand_id'],
model_id:this.allform['model_id'],rom_id:this.allform['rom_id'],color_id:this.allform['color_id'],}
ai_model_update_v2(obj).then(res=>{})
}
this.handleClose()
})
}else{
edit_drafts_box({...this.allform,client_type:2}).then(res=>{
this.$parent.getlist()
this.handleClose()
if (!!this.allform.warranty_query_info_id) {
let obj = {warranty_query_info_id:this.allform.warranty_query_info_id,cate_id:this.allform['cate_id'],brand_id:this.allform['brand_id'],
model_id:this.allform['model_id'],rom_id:this.allform['rom_id'],color_id:this.allform['color_id'],}
ai_model_update_v2(obj).then(res=>{})
}
})
}
},
change(val,name){
if (name=='cate_id') {
this.allform.brand_id=null
this.allform.model_id=null
this.allform.rom_id=null
this.allform.color_id=null
if (!!val) {
cate_brand_list_all({cate_id:val}).then(res=>{
this.brand_options=res.datas
})
}else{
this.brand_options=[]
this.rom_options=[]
this.color_options=[]
}
}else if(name=='brand_id'){
this.allform.model_id=null
this.allform.rom_id=null
this.allform.color_id=null
if (!!val) {
cate_brand_list_all({cate_id:this.allform.cate_id,brand_id:val}).then(res=>{
this.model_options=res.datas
})
}else{
this.model_options=[]
this.rom_options=[]
this.color_options=[]
}
}else{
this.allform.rom_id=null
this.allform.color_id=null
if (!!val) {
cate_brand_list_all({cate_id:this.allform.cate_id,brand_id:this.allform.brand_id,model_id:val}).then(res=>{
this.rom_options=res.datas['rom_list']
this.color_options=res.datas['color_list']
})
}else{
this.rom_options=[]
this.color_options=[]
}
}
},
getbrand(page){
cate_brand_list_all({cate_id:this.allform.cate_id,}).then(res=>{
this.brand_options=res.datas
})
},
getmodel(page){
cate_brand_list_all({cate_id:this.allform.cate_id,brand_id:this.allform.brand_id}).then(res=>{
this.model_options=res.datas
})
},
async handleSelect(data){
this.allform.cate_id = data.cate_id
this.allform.brand_id = data.brand_id
this.default_brand_id = data.brand_id
this.default_model_id = data.model_id
this.allform.model_id = data.model_id
this.allform.rom_id = null
this.allform.color_id = null
await this.getbrand()
await this.getmodel()
await this.getromcolor()
},
getromcolor(page){
cate_brand_list_all({cate_id:this.allform.cate_id,brand_id:this.allform.brand_id,model_id:this.allform.model_id,}).then(res=>{
this.rom_options=res.datas['rom_list']
this.color_options=res.datas['color_list']
})
},
romclick(e,v){
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.allform.rom_id=v.value
},
colorclick(e,v){
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.allform.color_id=v.value
},
toImg() { //
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true,
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
handleClose() {
this.$set(this,'keywords','')
this.$emit("update:allshow", false);
},
share() { //
op_order_details_code({order_op_id:this.id}).then((res) => {
this.$delete(this.allformLabelAlign,'phone_list');
var list = JSON.stringify(this.allformLabelAlign)
var host = window.location.host;
var http = window.location.protocol
// console.log(`${http}`+'//'+`${host}/#/share2?uuid=`+res.datas.uuid+'&formLabelAlign='+list)
new QRCode(this.$refs.qrCodeUrl, {
// text:'https://erpv2.aiguovip.com/#/share/share?uuid='+res.datas.uuid,
text:`${http}`+'//'+`${host}/#/share2?uuid=`+this.id+'&formLabelAlign='+list,
width: 120,
height: 110,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L, //L/M/H
});
})
},
//
hide() {
this.$nextTick(function () {
this.$refs.qrCodeUrl.innerHTML = "";
});
},
},
};
</script>
<style lang="less" scoped>
// .btnclass ::v-deep .el-button--primary:focus{
// margin-right: 12px;
// border-radius: 2px;
// box-shadow: 0 2px 4px 0 #f4f4f4;
// color: #2794f8;
// background: white;
// }
.btnclass ::v-deep .el-button--primary:hover{
border-radius: 2px;
color: #2794f8;
background: #d2e6fc;
border-color:#b3d8ff ;
}
.body {
display: flex;
flex-direction: column;
}
.body-text {
// display: flex;
// flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
// height: 20px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
.level{
display: inline-block;
height: 20px;
line-height: 20px;
padding: 0 15px;
background: #ff633c;
border-radius: 12px;
font-size: 12px;;
font-weight: 500;
color: #fff;
cursor: pointer;
margin:0px 10px;
}
.paiclass{
height: 40px;
background: #f2f2f2;
display: flex;
font-size: 16px;
align-items: center;
}
</style>

View File

@ -0,0 +1,568 @@
<template>
<el-dialog
title="修改质检报告"
:visible.sync="editshow"
width="1500px"
top="5vh"
append-to-body
:close-on-click-modal="false"
:before-close="handleClose"
>
<div class="main">
<div style="margin-left:10px;background:#f1f2f6;height:30px;display:flex;align-items:center;color: #000;padding: 0 30px;">
质检信息
</div>
<div>
<el-row type="flex" style="display: flex;align-items: center;margin-top: 10px;padding: 0 30px;" justify="">
<el-col :span="12">归属地区:浙江省温州市鹿城区</el-col>
<el-col :span="12">服务标签:<el-tag style="margin-left:5px">七天包退</el-tag><el-tag style="margin-left:5px"></el-tag></el-col>
</el-row>
</div>
<div v-show="attributeform['unmatch'] && attributeform['unmatch'].length !=0" class="tip">
<span>质检报告异常:</span>
<el-row :gutter="10">
<!-- <el-col :span="12">质检报告异常:</el-col> -->
<el-col v-for="(item,i) in attributeform['unmatch']" :key="i" :span="8">{{ item.attr_name }}/</el-col>
</el-row>
</div>
<!-- 质检图片 -->
<div style="margin-top:10px">
<div style="margin-left:10px;background:#f1f2f6;height:30px;display:flex;align-items:center;color: #000;padding: 0 30px;">
质检图片
</div>
<div style="display:flex;margin-top:10px">
<el-image
v-for="(item,i) in attributeform.all_img"
:key="i"
style="width: 100px; height: 100px;margin:10px"
:src="item"
:preview-src-list="attributeform.all_img"
/>
</div>
</div>
<!-- 质检信息 -->
<div>
<div style="margin-left:10px;background:#f1f2f6;height:30px;display:flex;align-items:center;color: #000;padding: 0 30px;">
质检信息
</div>
<vxe-table
ref="xTable"
border
resizable
style="width: 100%;margin-top:10px"
:data="tableData"
:show-header="false"
auto-resize
:span-method="mergeRowMethod2"
height="500"
:checkbox-config="{labelField: 'Serial', highlight: false, range: true}"
>
<vxe-table-column
v-for="(item,index) in tableLabel"
:key="index"
:field="item.param"
:title="item.label"
:align="item.align"
:min-width="item.width"
:width="item.width"
>
<template v-slot:default="{ row, rowIndex }">
<span v-if="item.param == 'value' && row['child'].length>1">
<div style="display:flex;align-items:center">
<div v-for="(e,i) in row['child']" class="btnclass" style="margin:10px">
<el-button v-if="row['attr_name'].indexOf('多选')!=-1" :disabled="attributeform.type==1 ?true :false" class="buttonDiv" plain round :type="row['value'].includes(e.attr_name) ? 'primary' :''" style="width: 100%;" @click="brandclick($event,e,row['attr_name'],row)">{{ e.attr_name }}</el-button>
<el-button v-else-if="row['attr_name'].indexOf('多选')==-1" :disabled="attributeform.type==1 ?true :false" class="buttonDiv" plain round :type="row['value']==e.attr_name ? 'primary' :''" style="width: 100%;" @click="brandclick($event,e,row['attr_name'],row)">{{ e.attr_name }}</el-button>
<!-- <span v-if="e.attr_name == '循环次数' && row['value']=='苹果电池循环次数'">
<el-input v-model="row['value']" placeholder="请输入内容" clearable ></el-input>
</span> -->
</div>
</div>
</span>
<span v-else-if="item.param == 'value' && row['child'].length==1">
<el-input v-model="row['value']" placeholder="请输入内容" :disabled="attributeform.type==1 ?true :false" clearable />
</span>
<span v-else>
{{ row[item.param] ? row[item.param] : '/' }}
</span>
</template>
</vxe-table-column>
</vxe-table>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()">关闭</el-button>
<el-button v-if="!attributeform.type" type="primary" @click="editinfo">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import { save_xy_attribute } from '@/api/console' //
import { res_advanced_search } from '@/api/machineList' //
import { pre_print } from '@/api/machineList' //
import { op_order_details_code } from '@/api/Warehousing' //
import { mapGetters } from 'vuex'
export default {
name: 'Warehousingprint',
data() {
return {
gridOptions2: {
border: false,
showOverflow: false,
height: 400,
showHeader: false,
columns: [],
data: []
},
tableLabel: [
{ label: '', param: 'title', align: 'center', width: 100, show: true },
{ label: '', param: 'attr_name', align: 'center', width: 200, show: true },
{ label: '', param: 'value', align: 'center', width: 1500, show: true }
],
tableData: [],
warranty_query: 2,
form: { cate_id: null, brand_id: null, model_id: null, rom_id: null, color_id: null },
cate_options: [],
brand_options: [],
model_options: [],
rom_options: [],
customer_options: [],
quote_user_options: [],
grade_options: [],
network_options: [],
op_user_id_options: [],
countries_options: [//
{ label: '中国', value: '中国' },
{ label: '国行运营商', value: '国行运营商' },
{ label: '国行全网通', value: '国行全网通' },
{ label: '海外', value: '海外' },
{ label: '美版', value: '美版' },
{ label: '日本', value: '日本' },
{ label: '韩版', value: '韩版' },
{ label: '港澳台', value: '港澳台' },
{ label: '新加坡', value: '新加坡' },
{ label: '欧盟', value: '欧盟' },
{ label: '国际版', value: '国际版' }],
id_options: [
{ label: '有', value: 1 },
{ label: '无', value: 2 },
{ label: '未知', value: 0 }]
}
},
computed: {
...mapGetters([
'is_warranty_query', // 12
'user_id'
]),
date() {
var date = new Date()
return date.toLocaleDateString()
},
aaa() {
const obj = JSON.parse(JSON.stringify(this.formLabelAlign))
for (const key in obj) {
this.input.map((res, index) => {
if (res.enName == key) {
if (Array.isArray(res.options)) {
res.options.map(r => {
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
}
// window.localStorage.setItem("setform",JSON.stringify(this.formLabelAlign));//
return obj
}
},
watch: {
'is_warranty_query': {
handler(val) {
this.warranty_query = val
}, deep: true, immediate: true
}
},
created() {
// console.log()
// this.getcate()
// if(localStorage.getItem("setform")){
// let lastname = JSON.parse(localStorage.getItem("setform"));//
// this.formLabelAlign = lastname
// }
console.log(this.tableLabel)
console.log(this.tableData)
},
props: {
editshow: {
type: Boolean,
default: () => {
return false
}
},
attributeform: {
type: Object,
default: () => {
return {}
}
},
id: {
type: String,
default: () => {
return ''
}
},
input: {
type: Array,
default: () => {
return []
}
},
formLabelAlign: {
type: Object,
default: () => {
return {}
}
},
jiqidata: {
type: Array,
default: () => {
return []
}
}
},
methods: {
//
mergeRowMethod2({ row, _rowIndex, column, visibleData }) {
const fields = ['title']
const cellValue = row[column.property]
if (cellValue && fields.includes(column.property)) {
const prevRow = visibleData[_rowIndex - 1]
let nextRow = visibleData[_rowIndex + 1]
if (prevRow && prevRow[column.property] === cellValue) {
return { rowspan: 0, colspan: 0 }
} else {
let countRowspan = 1
while (nextRow && nextRow[column.property] === cellValue) {
nextRow = visibleData[++countRowspan + _rowIndex]
}
if (countRowspan > 1) {
return { rowspan: countRowspan, colspan: 1 }
}
}
}
},
//
warrantychange(e) {
user_warranty_query({ user_id: this.user_id, is_warranty_query: e }).then(res => {
this.$message({ type: 'success', message: e == 1 ? '查询已开启' : '查询已关闭' })
this.$store.dispatch('user/getInfo')
})
},
getcate() {
cate_brand_list_all().then(res => {
this.cate_options = res.datas
})
res_advanced_search().then(e => {
this.op_user_id_options = e.datas['op_user_id']
this.quote_user_options = e.datas['quote_user_id']
this.customer_options = e.datas['supplier_info']
this.grade_options = e.datas['grade_list']
this.network_options = e.datas['network']
})
},
editinfo() {
const attribute = {}
this.tableData.map(e => {
const t = {}
t[e.attr_id] = e.value
Object.assign(attribute, t)
})
save_xy_attribute({ id: this.attributeform.id, attribute: attribute }).then(res => {
if (res.errcode == 0) {
this.$parent.determine(this.attributeform)
this.handleClose()
}
})
},
change(val, name) {
if (name == 'cate_id') {
this.form.brand_id = null
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: val }).then(res => {
this.brand_options = res.datas
})
} else {
this.brand_options = []
this.rom_options = []
this.color_options = []
}
} else if (name == 'brand_id') {
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: val }).then(res => {
this.model_options = res.datas
})
} else {
this.model_options = []
this.rom_options = []
this.color_options = []
}
} else {
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: this.form.brand_id, model_id: val }).then(res => {
this.rom_options = res.datas['rom_list']
this.color_options = res.datas['color_list']
})
} else {
this.rom_options = []
this.color_options = []
}
}
},
romclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.rom_id = v.value
},
colorclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.color_id = v.value
},
toImg() { //
window.pageYoffset = 0
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
brandclick(e, v, name, r) {
console.log(this.tableLabel)
console.log(this.tableData)
console.log(e, v, name, r)
console.log(r['value'].includes(e.attr_name))
if (name.indexOf('多选') != -1) {
if (v.attr_name == '正常' || v.attr_name == '无') {
r.value = [v.attr_name]
} else {
if (r.value.includes('无') || r.value.includes('正常')) {
r.value = []
r.value.push(v.attr_name)
} else {
if (r.value.includes(v.attr_name)) {
r.value.splice(r.value.indexOf(r.value.includes(v.attr_name), 1))
} else {
r.value.push(v.attr_name)
}
}
}
} else {
r.value = v.attr_name
}
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
},
handleClose() {
this.$emit('update:editshow', false)
},
share() { //
op_order_details_code({ order_op_id: this.id }).then((res) => {
this.$delete(this.formLabelAlign, 'phone_list')
var list = JSON.stringify(this.formLabelAlign)
var host = window.location.host
var http = window.location.protocol
// console.log(`${http}`+'//'+`${host}/#/share2?uuid=`+res.datas.uuid+'&formLabelAlign='+list)
new QRCode(this.$refs.qrCodeUrl, {
// text:'https://erpv2.aiguovip.com/#/share/share?uuid='+res.datas.uuid,
text: `${http}` + '//' + `${host}/#/share2?uuid=` + this.id + '&formLabelAlign=' + list,
width: 120,
height: 110,
colorDark: '#333333', //
colorLight: '#ffffff', //
correctLevel: QRCode.CorrectLevel.L // L/M/H
})
})
},
//
hide() {
this.$nextTick(function() {
this.$refs.qrCodeUrl.innerHTML = ''
})
}
}
}
</script>
<style lang="less" scoped>
// .btnclass ::v-deep .el-button--primary:focus{
// margin-right: 12px;
// border-radius: 2px;
// box-shadow: 0 2px 4px 0 #f4f4f4;
// color: #2794f8;
// background: white;
// }
.btnclass ::v-deep .el-button--primary:hover{
border-radius:20px;
color: #2794f8;
background: #d2e6fc;
border-color:#b3d8ff ;
}
.btnclass ::v-deep .el-button{
font-size: 2px;
padding: 5px;
min-width: 78px;
}
.main ::v-deep .vxe-body--column{
padding: 5px 0 !important;
}
.body {
display: flex;
flex-direction: column;
}
.body-text {
// display: flex;
// flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
// height: 20px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
.branchWrap {
margin: 0 -10px;
height: 140px;
}
.branchWrap div {
padding: 10px 10px;
border-bottom: 1px solid #dfe6ec;
height: 70px;
line-height: 200%;
}
.branchWrap div:last-child {
border: none;
}
.lineHeight28 {
line-height: 30px;
}
.tip {
margin-top:10px;
width: 100%;
max-height: 100px;
overflow-y: scroll;
border: 1px solid #ff633c;
position: relative;
background-color: #ff633c;
color: #fff;
border-radius: 4px;
font-size: 16px ;
padding: 0 10px;
}
</style>

187
Dialog/Exceldown.vue Normal file
View File

@ -0,0 +1,187 @@
<template>
<div class="popup-message warning" :class="type">
<div class="pop-view">
<div style="font-size: 20px;display:flex;justify-content:space-between;align-items:center;">
<div>
<i class="el-icon-warning-outline" style="color:#f39c12;margin-right:5px"></i>
<span style="color:#3498db">导出任务创建成功!</span>
</div>
<i class="el-icon-close" @click="closeMessage"></i>
</div>
<div style="color:#3498db;margin-top:10px">
<span>任务名称:{{tips}}</span>
<span style="margin-left: 10px;">任务编号:{{msg}}</span>
</div>
<div style=";margin-top:10px">
是否立即前往下载管理!
</div>
<!-- <span class="pop-title">{{ this.tips || ''}}</span>
<p class="pop-content" v-if="this.msg">{{ this.msg }}</p> -->
<div class="pop-btn" v-if="button">
<el-button type="primary" class="save" @click="okMessage">确定</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Exceldown',
// props: ["timeVisible", "cfgData", "timeTitle"],
data() {
return {
//
callback: null,
tips: '',
type: '',
msg: '',
button: false,
duration: 0,
};
},
computed: {
//
},
methods: {
getParams(options) {
this.callBack = options.callBack;
this.type = options.type || ''
this.tips = options.tips || ''
this.msg = options.msg || ''
this.button = options.button || false
this.duration = options.duration || 0
this.changePosition()
if(this.duration > 0){
window.setTimeout(() => {
this.$destroy(true)
if(this.$el.parentNode){ //
this.$el.parentNode.removeChild(this.$el)
}
this.changePosition()
}, this.duration)
}
},
changePosition() {
let doc = document.body.getElementsByClassName('popup-message')
let sum = 0;
for(let i=0; i< doc.length; i++){
this.$nextTick(() => {
if(i>0){
sum = sum + document.body.getElementsByClassName('popup-message')[i-1].clientHeight + 5
document.body.getElementsByClassName('popup-message')[i].style = `top: ${sum}px`
}else{
document.body.getElementsByClassName('popup-message')[i].style = `top: 50%`
}
})
}
},
okMessage(){
this.$destroy(true)
this.$el.parentNode.removeChild(this.$el)
this.changePosition()
this.callBack()
},
closeMessage(){
this.$destroy(true)
this.$el.parentNode.removeChild(this.$el)
this.changePosition()
}
},
mounted() {
},
};
</script>
<style lang="scss" scoped>
.popup-message {
font-family: "Source Han Sans Regular";
color: #333333;
position: fixed;
top: 50%;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 500px;
height: fit-content;
border-radius: 8px;
background: #FFFFFF;
border: 1px solid #C2C2C2;
z-index: 9999;
.pop-view{
position: relative;
min-height: 120px;
height: auto;
padding: 15px;
padding-bottom: 13px;
.pop-title{
display: block;
font-size: 18px;
font-weight: 500;
padding: 13px 52px 9px 52px;
position: relative;
&::before{
position: absolute;
content: '';
// background-image: url('~@/assets/popup/warning.png');
width: 22px;
height: 22px;
left: 20px;
}
}
.pop-content{
font-weight: 400;
font-size: 14px;
padding: 0 52px 5px 52px;
}
.pop-btn{
display: flex;
justify-content: flex-end;
.save{
margin-right: 20px;
}
}
.delete{
position: absolute;
content: '';
// background-image: url('~@/assets/popup/delete.png');
width: 22px;
height: 22px;
top: 18px;
right: 23px;
}
}
}
.success{
background: #F6FFED;
border: 1px solid #73D13D;
color: #73D13D;
.pop-view{
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.pop-view>.pop-title{
&::before{
// background-image: url('~@/assets/popup/success.png');
}
}
}
.error{
background: #FFF1F0;
border: 1px solid #FF7875;
// color: #FF7875;
.pop-view>.pop-title{
&::before{
// background-image: url('~@/assets/popup/error.png');
}
}
}
</style>

281
Dialog/InfoDialog.vue Normal file
View File

@ -0,0 +1,281 @@
<template>
<el-dialog
:visible.sync="dialogVisible"
width="70%"
top='5vh'
append-to-body
:title="dialogform.title"
:close-on-click-modal = "false"
:before-close="handleClose"
>
<div class="main" id="printTest" ref="printTest">
<div class="header">
<span style="font-size: 30px; font-weight: bold">销售发货单</span>
</div>
<el-row :gutter="24">
<el-col :span="6">
<div class="body-text">
<span class="text">销售类型:</span>
<span class="text1">{{ aaa.operation_type }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">订单名称:</span>
<span class="text1"></span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">往来单位:</span>
<span class="text1">{{aaa.customer_id}}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">出仓仓库:</span>
<span class="text1"></span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">送货方式:</span>
<span class="text1"></span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">出库日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">收款状态:</span>
<span class="text1">{{ aaa.pay_status }}{{aaa.pay_channel ? `(${aaa.pay_channel})` : '' }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">单号:</span>
<span class="text1">{{id}}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">出库数量:</span>
<span class="text1">{{ tableData.length }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">操作员:</span>
<span class="text1">{{ aaa.salesman_id }}</span>
</div>
</el-col>
<!-- <el-col :span="6">
<div class="body-text">
<span class="text">订单备注:</span>
<span class="text1">{{ aaa.order_notes }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">客户:</span>
<span class="text1">{{ aaa.customer_id }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">快递单号:</span>
<span class="text1">{{ aaa.tracking_num }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">订单日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col> -->
</el-row>
<!--引入表格组件-->
<el-table border :data="tableData">
<el-table-column
v-for="(item, index) in tableLabel"
:key="index"
:property="item.param"
:label="item.label"
:formatter="item.formatter"
>
</el-table-column>
</el-table>
<div>
<table style="height: 40px;">
<tr>
<td class="text1">供应商:{{msg.company}}</td>
<td class="text1">联系方式:{{msg.phone}}</td>
<td class="text1">
发货地址:{{msg.address}}
</td>
<td class="text1">总金额:{{ sumprice }}</td>
</tr>
<!-- <tr>
</tr> -->
</table>
</div>
<div class="footer">
<div class="fotter-top" >
<span class="footer-Toptext">{{msg.company}},{{msg.slogan}}</span>
<div class="fotter-main">
<span class="footer-maintext">感谢您选择爱果战壕ERP,我们将竭诚为您服务!!!</span>
<span style="margin-left:5px" class="footer-maintext">服务热线:{{msg.tel}}</span>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="mini" @click="handleClose()"> </el-button>
<el-popover
@hide="hide"
title="扫描查看明细"
placement="top-start"
width="100"
trigger="click"
>
<div class="qrcode" ref="qrCodeUrl"></div>
<el-button class="btn" slot="reference" size="mini" style="margin:0 10px" @click="share()">分享</el-button>
</el-popover>
<el-button type="primary" size="mini" v-print="'#printTest'">确认打印</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: "InfoDialog",
data() {
return {
};
},
watch: {},
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false;
},
},
dialoginfo: {
type: Object,
default: () => {
return {};
},
},
infoform: {
type: Object,
default: () => {
return {};
},
},
},
methods: {
},
};
</script>
<style lang="less" scoped>
.body {
display: flex;
flex-direction: column;
}
.body-text {
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
</style>

213
Dialog/InnerDialog.vue Normal file
View File

@ -0,0 +1,213 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
width="30%"
:title="Obj.DialogTitle"
:visible.sync="innerVisible"
:before-close="close"
append-to-body
>
<el-form
ref="ruleForm"
label-position="top"
:model="ruleForm"
label-width="100px"
size="mini"
class="demo-ruleForm"
:close-on-click-modal="false"
>
<el-row :gutter="20">
<el-col v-for="(item, index) in Input" :key="index" :span="item.span">
<el-form-item
v-if="item.disabled"
:prop="item.prop"
:rules="{
required: item.required,
message: item.placeholder,
trigger: ['blur', 'change'],
}"
:label="item.label"
>
<div style="display: flex">
<div
:is="item.type"
v-model="ruleForm[item.enName]"
:placeholder="item.placeholder"
:value="item.value"
:style="item.width"
:format="item.format"
:value-format="item.valueformat"
:clearable="true"
filterable
@keyup.enter.native="submitForm('ruleForm', Obj.Button, Obj.DialogTitle)"
@input="input($event)"
>
<el-option
v-for="items in item.options"
:key="items.value"
:label="items.label"
:value="items.value"
/>
</div>
</div>
</el-form-item>
<el-col
v-for="(r, i) in item.arr"
:key="i"
:span="r.span"
>
<el-form-item>
<div
:is="r.type"
v-model="ruleForm[r.enName]"
>
<el-option
v-for="items in r.options"
:key="items.value"
:label="items.label"
:value="items.value"
/>
</div>
</el-form-item>
</el-col>
<el-col
v-for="(items, i) in item.alipay"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.alipay[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="alipay"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:image-url="ruleForm.pay_info.alipay[items.enName]"
:action-url="items.action"
type="alipay"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col
v-for="(items, i) in item.wechat"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.wechat[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="wechat"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:action-url="items.action"
:image-url="ruleForm.pay_info.wechat[items.enName]"
type="wechat"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col v-for="(items, i) in item.bank" :key="i" :span="items.span">
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.bank[items.enName]"
:placeholder="items.placeholder"
/>
</el-form-item>
</el-col>
</el-col>
</el-row>
<el-form-item>
<el-button @click="resetForm('ruleForm')">取消</el-button>
<el-button
type="primary"
@click="submitForm('ruleForm', Obj.Button, Obj.DialogTitle)"
>{{ Obj.Button }}</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import uploadImg from '@/components/Upload'
export default {
components: {
uploadImg
},
props: {
innerVisible: {
type: Boolean,
default: false
},
Obj: {
type: Object,
default: () => {
return {}
}
},
Input: {
type: Array,
default: () => {
return []
}
},
ruleForm: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
actionUrl: 'https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com'
}
},
created() {},
methods: {
input(e) {
this.$forceUpdate()
},
close() {
this.$emit('update:innerVisible', false)
},
submitForm(formName, name, DialogTitle) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$emit('save', {
row: this.ruleForm,
name: name,
DialogTitle: DialogTitle
})
this.$emit('update:innerVisible', false)
} else {
return false
}
})
},
resetForm(formName) {
this.$refs[formName].resetFields()
this.$emit('update:innerVisible', false)
},
//
UrlImg(data) {
this.$emit('ImgSrc', data)
}
}
}
</script>
<style>
</style>

694
Dialog/Integralmodal.vue Normal file
View File

@ -0,0 +1,694 @@
<template>
<div class="main">
<el-dialog
:close-on-click-modal="false"
:visible.sync="integralVisible"
centered
width="1250px"
class="model_class"
:before-close="IntegralmodalClose"
>
<header style="width: 100%;height: 70px;">
<div class="headerclass">
<div class="headermain">
<div :class="['mode-tab', type == 1 ? 'active':'']" @click="typechange(1)">
<div class="tab-icon">
<svg class="icon" aria-hidden="true" style="width: 332px;height: 60px;">
<use :xlink:href="'#' + (type == 1 ? 'icon-jifen-01':'icon-jf1')" />
</svg>
</div>
<span :class="['tab-title', type == 1 ? 'active':'']">积分充值</span>
</div>
<div :class="['mode-tab','solo', type == 2 ? 'active':'']" @click="typechange(2)">
<div class="tab-icon">
<svg class="icon" aria-hidden="true" style="width: 332px;height: 60px;">
<use :xlink:href="'#' + (type == 2 ? 'icon-jifen-01':'icon-jf1')" />
</svg>
<svg class="icon recommend" aria-hidden="true" style="width: 65px;height: 65px;">
<use xlink:href="#icon-tuijian2" />
</svg>
</div>
<span :class="['tab-title', type == 2 ? 'active':'']">查询包月</span>
</div>
</div>
</div>
</header>
<div class="hqpGER">
<div class="left-container">
<div class="left-main">
<div v-if="type == 1">
<div class="flex-c title">
积分查询服务内容
</div>
<div style="display:flex;flex-direction:column;justify-content:center;">
<div v-for="(item,i) in integralinfo" :key="i" style="margin-top:15px">
<i class="circle" />
<span class="jieshao">{{ item.title }}</span>
<div v-if="!!item.subtitle" class="bujieshao">
{{ item.subtitle }}
</div>
</div>
<div style="color:red;margin-top:10px">
每月入库安卓机器3000台以上建议使用包月服务
</div>
</div>
</div>
<div v-else>
<div class="flex-c title">
包月服务内容
</div>
<div style="display:flex;flex-direction:column;justify-content:center;">
<div v-for="(item,i) in monthinfo" :key="i" style="margin-top:15px">
<i class="circle" />
<span style="margin-left:10px">{{ item.title }}</span>
<div v-if="!!item.subtitle" style="font-size:14px;margin-top:10px;color:rgb(93, 111, 143)">
{{ item.subtitle }}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="right-container">
<div class="right-main">
<div style="margin-bottom: 32px;">
<span class="title">当前积分:{{ aginfo ? aginfo.integral :'' }} <span v-if="type == 2" style="color:#e65555;margin-left:5px">本服务仅对安卓查询有效</span></span>
<div class="info-title" style="margin:10px">积分规则: 一积分 = 一块钱</div>
</div>
<div v-if="type == 1">
<div class="title" style="margin-bottom: 32px;">购买积分</div>
<el-row :gutter="24">
<el-col v-for="(e,i) in combo" :key="i" :xs="8" :sm="8" :md="8" :lg="8" :xl="8">
<el-card
class="cardclass"
shadow="hover"
:style="{border:(show==i ? '2px solid #4a90e2': '2px solid #e5e5e5') }"
@click.native.prevent="hidetrue(e)"
>
<span class="points">购买{{ e.points }}积分</span>
<p class="give">赠送{{ e.give }}积分</p>
</el-card>
</el-col>
</el-row>
</div>
<div v-else>
<div class="title" style="margin-bottom: 32px;">购买包月 <span style="color:#e65555;margin-left:5px">反馈新老用户专享8折优惠</span></div>
<el-row :gutter="24">
<el-col v-for="(e,i) in monthList" :key="i" :xs="8" :sm="8" :md="8" :lg="8" :xl="8">
<div class="monthclass" shadow="hover" :style="{border:(monthshow==i ? '2px solid #4a90e2': '2px solid #e5e5e5') }" @click="monthhidetrue(e)">
<div class="monthmain">
<i :class="'iconfont ' + e.icon" style="font-size: 20px;" />
<span style="font-size: 25px;">{{ e.title }}</span>
<el-badge :value="e.discount" class="item" style="margin-top:10px">
<h2 style="color:#e65555">{{ e.money }}</h2>
</el-badge>
<del>{{ e.oldmoney }}</del>
<div class="xianshi">
<svg class="icon " aria-hidden="true" style="width: 60px;height: 60px;">
<use xlink:href="#icon-jf2-01" />
</svg>
<div class="text">限时</div>
</div>
</div>
</div>
</el-col>
</el-row>
<div style="margin-top: 90px;font-size: 16px;font-weight: bold;">
<div v-if="!!aginfo.last_time">
剩余时间:{{ aginfo ? intervalTime(new Date().getTime(),aginfo.last_time) :'' }}
</div>
<div><el-link type="primary" @click="server">开通服务记录</el-link></div>
</div>
</div>
</div>
<div class="right-r">
<div class="title">购买详情</div>
<div class="flex-b" style="height: 32px;">
<div class="info-title">方案名称</div>
<div class="info-value">{{ type == 1 ? '购买积分' :'购买包月' }}</div>
</div>
<div class="flex-b" style="height: 32px;">
<div class="info-title">{{ type == 1 ? '购买积分' :'购买时长' }}</div>
<div class="info-value">{{ czform['price'] }}</div>
</div>
<div v-if="type == 1" class="flex-b" style="height: 32px;">
<div class="info-title">赠送积分</div>
<div class="info-value">{{ !!czform['name']?czform['name']:'无' }}</div>
</div>
<div v-else class="flex-b" style="height: 32px;">
<div class="info-title">预计到期</div>
<div class="info-value">{{ czform['lasttime'] }}</div>
</div>
<div class="flex-b" style="height: 32px;">
<div class="info-title">积分金额</div>
<div class="info-value">{{ czform['price'] }}</div>
</div>
<div class="right-bottom">
<h4 style="margin-top:10px">充值方式</h4>
<div>
<el-radio-group v-model="radiovalue">
<el-radio v-for="(item,i) in radioList" :key="i" style="margin-left:15px" :label="item.value">
<i :style="item.style" :class="item.icon" />
{{ item.title }}
</el-radio>
</el-radio-group>
</div>
<div class="flex-b" style="margin-top:10px">
<span style="font-size: 16px;color: rgb(93, 111, 143);">应付金额:</span>
<span style="color:#ff6b81;font-size: 24px;">{{ czform['price'] }}</span>
</div>
<el-button type="primary" style="width:100%;margin-top:2px" :disabled="!checked" @click="IntegralmodalOk">立即购买</el-button>
<div style="margin-top: 10px;">
<el-checkbox v-model="checked" style="margin-right:5px" />我已阅读并同意<a target="_blank" style="color: rgb(41, 141, 248);" rel="noopener noreferrer" class="tos" href="https://www.yuque.com/aiguoerp/lcgmke/oa0z3fwethsor57l?singleDoc#">积分协议</a>
</div>
</div>
</div>
</div>
</div>
</el-dialog>
<el-dialog :visible.sync="recordList" :close-on-click-modal="false" title="开通服务">
<el-table
:data="recordDate"
style="border-width: 1px 2px 0 2px;border-style: solid solid none solid; border-color: #ebeef5"
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center','background':'#f9f9fa','color':'#606266'}"
>
<el-table-column label="序号" type="index" />
<el-table-column label="日期" prop="add_time">
<template #default="{row}">
{{ row.add_time| dateformat("YYYY-MM-DD") }}
</template>
</el-table-column>
<el-table-column label="名称" prop="remark" />
<el-table-column label="时长">
<template #default="{row}">
<span>{{ row.months }}个月</span>
</template>
</el-table-column>
<el-table-column label="实付金额" prop="pay_amount" />
<el-table-column label="支付方式">
<template #default="{row}">
{{ row.pay_channel===1?'微信':row.pay_channel===2?'支付宝':'/' }}
</template>
</el-table-column>
<el-table-column label="支付时间">
<template #default="{row}">
{{ row.add_time| dateformat("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
</el-table>
<div style="text-align: right;margin-top: 15px">
<el-button size="small" @click="recordList=false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { open_service_record } from '@/api/System'
export default {
data() {
return {
recordList: false,
recordDate: [],
Visible: false,
czform: { content: '', name: '', time: '', price: '' },
checked: false,
type: 2,
cardList: [
{ title: '9', text: '赠送三个月', money: '9', style: "{display:(show==0 ? 'block': 'none') }" },
{ title: '49', text: '赠送一个月', money: '49', style: "{display:(show==1 ? 'block': 'none') }" },
{ title: '99', text: '无时长赠送', money: '99', style: "{display:(show==2 ? 'block': 'none') }" },
{ title: '299', text: '无时长赠送', money: '299', style: "{display:(show==2 ? 'block': 'none') }" },
{ title: '499', text: '无时长赠送', money: '499', style: "{display:(show==2 ? 'block': 'none') }" },
{ title: '999', text: '无时长赠送', money: '999', style: "{display:(show==2 ? 'block': 'none') }" }
],
monthList: [
{ title: '1个月', text: '', money: '478', month: 1, oldmoney: '598', discount: '8折', icon: 'icona-huiyuanVIPVIPka', style: "{display:(show==0 ? 'block': 'none') }" },
// { title: '12', text: '', money: '5598', month: 12, oldmoney: '7176', discount: '7.8', icon: 'iconhuiyuan', style: "{display:(show==1 ? 'block': 'none') }" }
],
radioList: [
{ title: '微信', icon: 'iconfont iconweixin1-copy', value: 1, style: 'color:#7ed321;font-size:20px' },
{ title: '支付宝', icon: 'iconfont iconzhifubao2', value: 2, style: 'color:#0d6bdb;font-size:20px' }
// {title:'paypal',icon:'iconfont iconpaypal1',value:3,style:"color:#0d6bdb;font-size:20px"},
],
monthinfo: [
{ title: '3万台/月每台可低至2分钱', subtitle: '' },
{ title: '数量越多,优惠越大', subtitle: '' },
{ title: '保修信息查询,真伪查询', subtitle: '' },
{ title: '购买日期查询', subtitle: '' },
{ title: '支持第三方平台查询', subtitle: '拍机堂购买信息,转转黑名单信息' },
{ title: '支持多品牌查询', subtitle: '华为、OPPO、vivo、小米、荣耀、红米、黑鲨、realme、一加、三星、华硕、魅族、努比亚、中兴、摩托罗拉、联想等' }
],
integralinfo: [
{ title: '安卓查询: ¥0.05/台', subtitle: '' },
{ title: '苹果查询: ¥0.27/台', subtitle: '' },
{ title: '保修信息查询,真伪查询', subtitle: '' },
{ title: 'ID锁查询,购买日期查询', subtitle: '' },
{ title: '支持安卓机器包月查询', subtitle: '' },
{ title: '支持第三方平台查询', subtitle: '拍机堂购买信息,转转黑名单信息' },
{ title: '支持多品牌查询', subtitle: '苹果、华为、OPPO、vivo、小米、荣耀、红米、黑鲨、realme、一加、三星、华硕、魅族、努比亚、中兴、摩托罗拉、联想等' }
],
radiovalue: 1,
mon: 12,
show: 0,
monthshow: 0,
month: 1
}
},
computed: {
...mapGetters([
'expire_time'
]),
money() {
let num = 0
num = this.mon * 88
return num
}
},
props: {
aginfo: {
type: Object,
default: () => {
return {}
}
},
integralVisible: {
type: Boolean,
default: () => {
return false
}
},
combo: {
type: Array,
default: () => {
return []
}
}
},
mounted() {
this.typechange(2)
},
methods: {
async server() {
console.log('开通')
this.recordList = true
const res = await open_service_record()
console.log(res)
this.recordDate = res.datas.datas
},
addMonth(dateTar, offset) {
var date = new Date(dateTar)
if (date instanceof Date && !isNaN(offset)) {
const givenMonth = date.getMonth()
const newMonth = givenMonth + offset
date.setMonth(newMonth)
return this.getCurrentDate(date)
}
},
getCurrentDate(date) {
var seperator1 = '-'
var year = date.getFullYear()
var month = date.getMonth() + 1
var strDate = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (strDate >= 0 && strDate <= 9) {
strDate = '0' + strDate
}
var currentdate = year + seperator1 + month + seperator1 + strDate
return currentdate
},
typechange(e) {
this.type = e
if (e == 1) {
this.show = 0
this.hidetrue(this.combo[0])
} else {
this.monthshow = 0
this.monthhidetrue(this.monthList[0])
}
},
monthhidetrue(e) {
this.monthList.map((r, i) => {
if (e.title == r.title) {
this.monthshow = i
this.czform['content'] = this.monthList[i].title
this.czform['price'] = this.monthList[i].money
this.czform['month'] = this.monthList[i].month
this.czform['lasttime'] = this.addMonth(this.aginfo.last_time ? this.aginfo.last_time * 1000 : new Date(), this.monthList[i].month)
this.month = this.monthList[i].month
}
})
},
hidetrue(e) {
this.combo.map((r, i) => {
if (e.points == r.points) {
this.show = i
// this.$set( this.czform, 'content', e.title)
this.czform['price'] = e.points
this.czform['name'] = e.give
}
})
},
IntegralmodalOk() {
let obj = {}
if (this.type == 1) { //
obj = { pay_type: 4, points: this.combo[this.show].points, key_id: this.combo[this.show].combo_id, pay_status: this.radiovalue }
} else { //
obj = { pay_type: 5, months: this.month, actual_price: this.monthList[this.monthshow].money, pay_status: this.radiovalue }
}
this.$emit('IntegralmodalOk', obj)
console.log(obj)
this.$emit('update:integralVisible', false)
},
IntegralmodalClose() {
this.checked = false
this.$emit('update:integralVisible', false)
},
//
getTime(time) {
var date = new Date(time)
var y = date.getFullYear()
var m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
var d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
return y + '-' + m + '-' + d
},
//
intervalTime(startTime, endTime) {
var timestamp = new Date().getTime() // ()
endTime = endTime * 1000
var date1 = '' //
if (timestamp > startTime) {
date1 = startTime
} else {
date1 = timestamp //
}
var date2 = endTime //
// var date3 = date2.getTime() - date1.getTime(); //
var date3 = (date2 - date1) * 1000 //
//
var days = Math.floor(date3 / (24 * 3600 * 1000 * 1000))
//
var leave1 = date3 % (24 * 3600 * 1000 * 1000) //
var hours = Math.floor(leave1 / (3600 * 1000 * 1000))
//
var leave2 = leave1 % (3600 * 1000 * 1000) //
var minutes = Math.floor(leave2 / (60 * 1000 * 1000))
//
var leave3 = leave2 % (60 * 1000) //
var seconds = Math.round(leave3 / 1000)
// return days + " " + hours + " " + minutes + " " + seconds + " "
return days + '天 '
}
}
}
</script>
<style scoped>
.jieshao{
margin-left:10px;
font-size:14px;
}
.bujieshao{
font-size:14px;
margin-top:10px;
color:rgb(93, 111, 143)
}
.model_class >>> .el-dialog__body{
padding: 0;
}
.model_class >>> .el-dialog__headerbtn{
z-index: 999;
}
.mode-tab{
cursor: pointer;
width: 332px;
height: 61px;
position: absolute;
left: 26px;
bottom: -3px;
z-index: 10;
}
.active{
z-index: 20;
color: rgb(255, 255, 255) ;
}
.tab-title.active {
color: rgb(255, 255, 255);
}
.solo{
left: 336px;
}
.tab-icon{
position: relative;
/* svg{
position: unset;
} */
}
.tab-icon >>> svg{
position: unset;
}
.recommend{
position: absolute !important;
right: 0% !important;
top: -3px !important;
width: 86px;
}
.tab-title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 30;
font-weight: 600;
font-size: 20px;
line-height: 20px;
color: rgb(93, 111, 143);
}
.headerclass{
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
-webkit-box-align: center;
align-items: center;
}
.headermain{
position: relative;
width: 100%;
height: 100%;
margin-top: 20px;
margin-left: 256px;
}
.model_top{
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
height:220px
}
.model_class{
width: 100%;
}
.hqpGER{
position: relative;
width: 100%;
height: 588px;
display: flex;
margin-top: 12px;
padding: 0px 25px 28px 24px;
}
.left-container{
}
.left-main{
position: relative;
width: 245px;
height: 560px;
padding: 32px 12px 24px;
border: 1px solid rgb(218, 235, 254);
border-radius: 8px;
background: rgb(255, 255, 255);
/* color: rgb(93, 111, 143); */
color: #000;
}
.right-container{
/* width: 916px; */
margin-left: 15px;
display: flex;
}
.right-main{
background: rgb(255, 255, 255);
width: 637px;
overflow: hidden auto;
border-radius: 0px 0px 0px 8px;
padding: 30px 23px 30px 27px;
}
.right-r{
width: 279px;
height: 100%;
background: rgb(255, 255, 255);
border-radius: 0px 8px 8px 0px;
padding: 30px 19px 22px 18px;
border-left: 1px solid rgb(229, 229, 229);
}
.right-bottom{
height: 180px;
position: absolute;
bottom: 38px;
border-top: 1px solid rgba(200, 205, 208, 0.3);
}
.info-title{
font-size: 14px;
color: rgb(93, 111, 143);
line-height: 14px;
font-weight: 400;
}
.info-value{
font-size: 14px;
color: rgb(53, 68, 93);
text-align: right;
line-height: 14px;
font-weight: 400;
}
.model_class >>> .el-dialog__header{
padding: 0;
}
.model_class >>> .el-dialog-wrap{
z-index: 9999 !important;
}
.model_class >>> .el-dialog-footer{
display: flex;
justify-content: center;
align-items: center;
border-top:0px;
}
.model_class >>>.el-dialog__body{
/* background: url('https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/aiguo_chaxun/jf_blg.png'); */
background-size: 108% 35% ;
background-repeat: no-repeat;
background: rgb(241, 248, 255);
width: 100%;
}
/* .model_class >>> .circle {
border-radius: 50% ;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: linear-gradient(rgba(255,255,255,0.5) ,rgba(255,255,255,0.2), rgba(255,255,255,0));
width: 150px;
height: 150px;
} */
.circle2{
border: 1px solid #EBEEF5;
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
width: 150px;
height: 38px;
background:#fff ;
border-radius: 25px;
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
}
.cardclass{
position: relative;
/* border: 2px solid #e5e5e5; */
color: #000;
font-size: 16px;
height: 100px;
width: 160px;
margin-bottom: 10px;
display: flex;
flex-direction: column;
}
.cardclass >>> .ant-divider-horizontal{
margin: 15px 0;
}
.monthclass{
cursor: pointer;
position: relative;
width: fit-content;
background-color: rgb(255, 255, 255);
border: 1px solid rgb(219, 219, 219);
border-radius: 8px;
}
.monthmain{
width: 150px;
height: 178px;
display: flex;
flex-direction: column;
-webkit-box-align: center;
align-items: center;
justify-content: center;
padding: 0px 19px;
border: 1px solid transparent;
}
.el-card{
overflow: unset;
}
.tj{
position: absolute;
top: 0px;
right: 0px;
background: #4a90e2;
padding: 0px 0px;
width: 33px;
color: #fff;
line-height: 18px;
font-size: 12px;
}
.guoguo{
position: absolute;
bottom: 0px;
right: 0px;
height: 18px;
width: 22px;
background: url(https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/static/assets/img/xiaogou.png) 0px bottom;
background-size: 100%;
display: none;
}
.circle {
display: inline-block;
width: 14px;
height: 14px;
}
.circle:after {
content: '';
margin: 3px;
display: table;
width: 10px;
height: 10px;
background: #2ecc71;
border-radius: 50%;
}
.title{
font-weight: 600;
font-size: 16px;
line-height: 16px;
color: rgb(53, 68, 93);
}
.xianshi{
position: absolute;
left: -10px;
top: -18px;
}
.text{
position: absolute;
top: 12px;
left: 0px;
width: 100%;
text-align: center;
font-weight: 600;
font-size: 12px;
color: rgb(255, 255, 255);
}
</style>

View File

@ -0,0 +1,854 @@
<template>
<div class="content">
<el-dialog
:title="Obj.DialogTitle"
:visible.sync="dialogVisible"
width="40%"
:before-close="close"
:close-on-click-modal="closeclickmodal"
class="abow_dialog"
top="2%"
>
<el-form
ref="ruleForm"
label-position="top"
:model="ruleForm"
label-width="100px"
size="mini"
>
<h3>机器信息</h3>
<el-row :gutter="10">
<el-col v-for="(item, index) in Input" :key="index" :span="item.span">
<el-form-item
v-if="item.Typeshow"
:prop="item.prop"
:rules="{
required: item.required,
message: item.placeholder,
trigger: ['blur', 'change'],
}"
:label="item.label"
>
<div style="display: flex">
<div
:is="item.type"
v-model="ruleForm[item.enName]"
:placeholder="item.placeholder"
:value="item.value"
:style="item.width"
:format="item.format"
:type="item.TimeType"
:value-format="item.valueformat"
:clearable="true"
:filterable="item.filterable"
:disabled="item.disabled"
:allow-create="item.allowcreate"
:picker-options="item.pickerOptions"
:default-first-option="item.defaultfirstoption"
:multiple="item.multiple"
:props="item.props"
:name="item.name"
@change="
change(
item.enName,
ruleForm[item.enName],
Obj.DialogTitle,
item.label,
item.options,
item
)
"
@remove-tag="removetag"
>
{{ item.name == "is_accessories" ? "" : item.name }}
<el-option
v-for="items in item.options"
:key="items.value"
:label="items.label"
:value="items.value"
>
<span v-if="item.label == '颜色'">
<span style="float: left">{{ items.label }}</span>
<el-popover placement="right" width="200" trigger="hover">
<img
v-if="items.img"
style="height: 200px"
:src="items.img"
/>
<img
v-if="items.img"
slot="reference"
style="float: right; height: 34px"
:src="items.img"
/>
</el-popover>
</span>
</el-option>
</div>
</div>
</el-form-item>
<el-col
v-for="(r, i) in item.repair_customer"
:key="i"
:span="r.span"
>
<el-col
v-for="(value, key, index) in r"
:key="index"
:span="value.span"
:class="value.class"
>
<el-form-item
:label="value.label"
:prop="value.prop"
:rules="{
required: value.required,
message: value.placeholder,
trigger: ['blur', 'change'],
}"
>
<div style="display: flex">
<div
:is="value.type"
v-model="ruleForm.accessories[i][value.enName]"
:style="value.width"
:filterable="value.filterable"
clearable
:placeholder="value.placeholder"
onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"
>
<el-option
v-for="items in value.options"
:key="items.value"
:label="items.label"
:value="items.value"
:res_id="items.value"
>
<span
v-if="value.label == '配件'"
style="float: left"
>{{ items.label }}</span
>
<span
v-if="value.label == '配件'"
style="float: right; color: #8492a6; font-size: 13px"
>{{ items.number ? `(${items.number})个` : "" }}</span
>
</el-option>
</div>
</div>
<i
class="Font"
:class="value.Icon"
@click="operation(r, i, value.name)"
/>
</el-form-item>
</el-col>
</el-col>
<el-col
v-for="(items, i) in item.alipay"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.alipay[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="alipay"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:action-url="items.action"
:image-url="ruleForm.pay_info.alipay[items.enName]"
type="alipay"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col
v-for="(items, i) in item.wechat"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.wechat[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="wechat"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:action-url="items.action"
:image-url="ruleForm.pay_info.wechat[items.enName]"
type="wechat"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col v-for="(items, i) in item.bank" :key="i" :span="items.span">
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.bank[items.enName]"
:placeholder="items.placeholder"
/>
</el-form-item>
</el-col>
</el-col>
</el-row>
<h3>机器详情</h3>
<el-row :gutter="10">
<el-col
v-for="(item, index) in Input2"
:key="index"
:span="item.span"
>
<el-form-item
v-if="item.Typeshow"
:prop="item.prop"
:rules="{
required: item.required,
message: item.placeholder,
trigger: ['blur', 'change'],
}"
:label="item.label"
>
<div style="display: flex">
<div
:is="item.type"
v-model="ruleForm[item.enName]"
:placeholder="item.placeholder"
:value="item.value"
:style="item.width"
:format="item.format"
:type="item.TimeType"
:value-format="item.valueformat"
:clearable="true"
:filterable="item.filterable"
:disabled="item.disabled"
:allow-create="item.allowcreate"
:picker-options="item.pickerOptions"
:default-first-option="item.defaultfirstoption"
:multiple="item.multiple"
:props="item.props"
:name="item.name"
@change="
change(
item.enName,
ruleForm[item.enName],
Obj.DialogTitle,
item.label,
item.options,
item
)
"
@remove-tag="removetag"
>
{{ item.name == "is_accessories" ? "" : item.name }}
<el-option
v-for="items in item.options"
:key="items.value"
:label="items.label"
:value="items.value"
>
<span v-if="item.label == '颜色'">
<span style="float: left">{{ items.label }}</span>
<el-popover placement="right" width="200" trigger="hover">
<img
v-if="items.img"
style="height: 200px"
:src="items.img"
/>
<img
v-if="items.img"
slot="reference"
style="float: right; height: 34px"
:src="items.img"
/>
</el-popover>
</span>
</el-option>
</div>
</div>
</el-form-item>
<el-col
v-for="(r, i) in item.repair_customer"
:key="i"
:span="r.span"
>
<el-col
v-for="(value, key, index) in r"
:key="index"
:span="value.span"
:class="value.class"
>
<el-form-item
:label="value.label"
:prop="value.prop"
:rules="{
required: value.required,
message: value.placeholder,
trigger: ['blur', 'change'],
}"
>
<div style="display: flex">
<div
:is="value.type"
v-model="ruleForm.accessories[i][value.enName]"
:style="value.width"
:filterable="value.filterable"
clearable
:placeholder="value.placeholder"
onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"
>
<el-option
v-for="items in value.options"
:key="items.value"
:label="items.label"
:value="items.value"
:res_id="items.value"
>
<span
v-if="value.label == '配件'"
style="float: left"
>{{ items.label }}</span
>
<span
v-if="value.label == '配件'"
style="float: right; color: #8492a6; font-size: 13px"
>{{ items.number ? `(${items.number})个` : "" }}</span
>
</el-option>
</div>
</div>
<i
class="Font"
:class="value.Icon"
@click="operation(r, i, value.name)"
/>
</el-form-item>
</el-col>
</el-col>
<el-col
v-for="(items, i) in item.alipay"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.alipay[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="alipay"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:action-url="items.action"
:image-url="ruleForm.pay_info.alipay[items.enName]"
type="alipay"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col
v-for="(items, i) in item.wechat"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.wechat[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="wechat"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:action-url="items.action"
:image-url="ruleForm.pay_info.wechat[items.enName]"
type="wechat"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col v-for="(items, i) in item.bank" :key="i" :span="items.span">
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.bank[items.enName]"
:placeholder="items.placeholder"
/>
</el-form-item>
</el-col>
</el-col>
</el-row>
<el-row type="flex" justify="end">
<el-form-item>
<el-button @click="resetForm('ruleForm')">取消</el-button>
<el-button
v-if="Obj.DialogTitle == '选择属性'"
type="success"
@click="Reexamination()"
>重查保修</el-button
>
<el-button
type="primary"
@click="submitForm('ruleForm', Obj.Button, Obj.DialogTitle)"
>{{ Obj.Button }}</el-button
>
</el-form-item>
</el-row>
</el-form>
<!--客户-->
<innerDIalog
:inner-visible.sync="innerVisible"
append-to-body
:input="InputArr"
:rule-form="rule"
:obj="DiaButton"
@save="addsave"
@ImgSrc="ImgSrc"
/>
<Dialog
:outer-visible.sync="outerVisible"
:options="options"
:statusoptions="statusoptions"
:rule-form="Sales"
:obj="DiaButton"
@addplus="addplus"
@del="del"
@save="addsave"
/>
</el-dialog>
</div>
</template>
<script>
import { save_User } from "@/api/Suppliermanagement";
import { save } from "@/api/salesman";
import uploadImg from "@/components/Upload";
import innerDIalog from "@/components/Dialog/InnerDialog"; //
import Dialog from "../../views/settings/dialog"; //
import { zz_new_status } from "@/api/machineList"; //
import { cate_brand_list_in_stock } from "@/api/Jiqidetails"; //
export default {
components: {
uploadImg,
innerDIalog,
Dialog,
},
props: {
dialogVisible: {
type: Boolean,
default: false,
},
closeclickmodal: {
type: Boolean,
default: true,
},
list: {
type: Array,
default: () => {
return [];
},
},
original: {
type: Object,
default: () => {
return {};
},
},
Obj: {
type: Object,
default: () => {
return {};
},
},
Obj_money: {
type: Object,
default: () => {
return {};
},
},
Input: {
type: Array,
default: () => {
return [];
},
},
Input2: {
type: Array,
default: () => {
return [];
},
},
imei: {
type: Object,
default: () => {
return {};
},
},
ruleForm: {
type: Object,
default: () => {
return {};
},
},
amount_money: {
type: [Number, String],
default: () => {
return 0;
},
},
Settlement_amount: {
type: [Number, String],
default: () => {
return 0;
},
},
pay_customer: {
type: [Number, String],
default: () => {
return 0;
},
},
/* 用户信息 二维码 银行卡*/
user_info: {
type: Object,
default: () => {
return {};
},
},
},
data() {
return {
checked: false,
tabPosition: "不使用预付款",
radio1: "手机销售",
outerVisible: false,
innerVisible: false,
actionUrl: "https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com",
Sales: {}, //
DiaButton: { DialogTitle: "", Button: "" },
rule: {},
enName: "",
//
InputArr: [],
options: [
{ label: "固定值", value: 1 },
{ label: "百分比", value: 2 },
],
statusoptions: [
{ label: "正常", status: 0 },
{ label: "非正常", status: 1 },
],
type: "",
loadinglist: [],
};
},
computed: {
//
pay_info() {
return this.bank_info.pay_info
? JSON.parse(this.bank_info.pay_info)
: {
alipay: { qr_code: "", name: "" },
wechat: { qr_code: "", name: "" },
bank: { bank_no: "", name: "", kaihuhang: "" },
};
},
},
watch: {
list: {
handler(newVal, value) {
if (newVal) {
// this.$set(this.loadinglist,'',newVal)
this.loadinglist = newVal;
if (newVal.customer_barcode) {
// this.$set(this.ruleForm,'barcode',newVal.customer_barcode)
}
}
},
deep: true,
immediate: true,
},
imei: {
handler(newVal, value) {
if (newVal) {
if (newVal.zljshow) {
this.$set(
this.ruleForm,
"barcode",
this.loadinglist.customer_barcode
);
} else {
this.$set(this.ruleForm, "barcode", "");
}
}
},
deep: true,
immediate: true,
},
ruleForm: {
handler() {
if (this.ruleForm.machine_grade_id === 0) {
this.$set(this.ruleForm, "machine_grade_id", "");
}
if (this.ruleForm.quote_user_id === 1) {
this.$set(this.ruleForm, "quote_user_id", "");
}
if (this.ruleForm.attribute_json) {
let attributeJsonCopoy = JSON.parse(this.ruleForm.attribute_json);
this.ruleForm.battery_health = attributeJsonCopoy.battery_health;
// this.ruleForm.fineness = attributeJsonCopoy.fineness;
this.ruleForm.recharge_num = attributeJsonCopoy.recharge_num;
this.ruleForm.sys_net_no = attributeJsonCopoy.sys_net_no;
this.ruleForm.network = attributeJsonCopoy.network;
}
},
},
},
created() {},
methods: {
getcode() {
const e = this.imei;
if (e.account && e.account.length != 0) {
const Obj = { imei: e.imei1, imei2: e.imei2, account: e.account };
this.$set(this.loadinglist, "codeloading", 1);
zz_new_status(Obj).then((res) => {
if (res.errcode == 0 && res.datas.length != 0) {
this.$set(this.loadinglist, "gridData", res.datas);
this.$set(
this.loadinglist,
"customer_barcode",
res.datas[0].qc_code
);
this.$set(this.loadinglist, "codeloading", 2);
this.$set(this.loadinglist, "state_name", res.datas[0].state_name);
this.$set(this.loadinglist, "order_time", res.datas[0].order_time);
this.$set(this.loadinglist, "sold_time", res.datas[0].sold_time);
} else {
this.$set(this.loadinglist, "codeloading", 3);
}
});
}
},
// 使resetFields
clearcheck() {
if (this.$refs["ruleForm"]) {
this.$refs["ruleForm"].clearValidate();
}
},
Reexamination() {
this.$emit("Reexamination");
},
//
radio_change(val) {
this.$emit("radio_change", val);
},
input(e) {
this.$forceUpdate();
},
change(enName, e, DialogTitle, label, options) {
if (DialogTitle == "选择属性") {
for (const key in this.ruleForm) {
if (key == enName) {
var str = enName.substring(0, enName.length - 2); // enName :brand_id brand_
str = str + "name"; // name brand_ band_name valuelabel
options.map((item) => {
if (item.value === e) {
this.ruleForm[str] = item.label; // valuevalue label ruleForm
}
});
}
}
this.$emit("hide", {
enName: enName,
e: e,
DialogTitle: DialogTitle,
row: this.ruleForm,
label: label,
});
}
if (enName == "new_other") {
this.$emit("change_new_other", e);
} else if (DialogTitle == "添加销售") {
let account_class_code = ""; //
if (Array.isArray(options)) {
options.map((r) => {
if (e == r.value) {
account_class_code = r.account_class_code;
}
});
}
this.$emit("hide", {
enName: enName,
e: e,
DialogTitle: DialogTitle,
row: this.ruleForm,
label: label,
account_class_code: account_class_code,
});
} else {
this.$emit("hide", {
enName: enName,
e: e,
DialogTitle: DialogTitle,
row: this.ruleForm,
label: label,
});
}
},
focus(row, item) {
this.$emit("Selectfocus", { row: row, item: item });
},
tabclick(value) {
this.$emit("surplus_money", {
tabPosition: this.tabPosition,
actual_Settlement_amount: this.actual_Settlement_amount,
});
},
submitForm(formName, name, DialogTitle) {
this.$refs[formName].validate((valid, obj) => {
if (valid) {
if (this.ruleForm.price && this.ruleForm.textarea_price) {
this.$message({
type: "warning",
message: "填写一个即可,禁止填写两个",
});
return;
}
if (this.ruleForm.remark && this.ruleForm.textarea_remark) {
this.$message({
type: "warning",
message: "填写一个即可,禁止填写两个",
});
return;
}
if (this.ruleForm.grade_list && this.ruleForm.textarea_grade_list) {
this.$message({
type: "warning",
message: "填写一个即可,禁止填写两个",
});
return;
}
this.$emit("save", {
row: this.ruleForm,
original: this.original,
tabPosition: this.tabPosition,
checked: this.checked,
name: name,
DialogTitle: DialogTitle,
});
this.tabPosition = "不使用预付款";
this.$emit("update:dialogVisible", false);
} else {
return false;
}
});
},
resetForm() {
this.tabPosition = "不使用预付款";
this.$emit("colse");
this.$emit("update:dialogVisible", false);
this.$emit("closeDialog");
},
close() {
this.tabPosition = "不使用预付款";
this.$emit("colse");
this.$emit("update:dialogVisible", false);
this.$emit("closeDialog");
},
//
UrlImg(data) {
this.$emit("img", data);
},
addsave(data) {
if (data.Sales == "Sales") {
save(data.row).then((res) => {
this.$emit("update");
});
} else {
save_User(data.row).then((res) => {});
}
},
addplus() {
this.Sales.brokerage.push({ range: [], type: "", value: "" });
},
del(data) {
this.$delete(this.Sales.brokerage, data);
},
//
operation(r, i, name) {
this.$emit("operation", { row: r, index: i, name: name });
},
ImgSrc(data) {
if (data.type == "alipay") {
this.rule.pay_info.alipay.qr_code = data.imageUrl;
} else {
this.rule.pay_info.wechat.qr_code = data.imageUrl;
}
},
// Tag
removetag(r) {
this.$emit("removetag", r);
},
},
};
</script>
<style scoped lang="scss">
.fonticon {
color: #fff;
padding: 0px 15px;
font-size: 24px;
position: relative;
top: 5px;
}
.fontcont {
padding: 0px 15px;
font-size: 24px;
}
.IconClass {
display: flex;
display: -webkit-flex;
align-items: center;
justify-content: center;
position: relative;
top: 40px;
}
.Font {
font-size: 20px;
}
.content ::v-deep .el-form-item {
margin-bottom: 18px;
}
.pay_info {
span {
padding: 0 20px 0 0;
}
}
.accessclass {
width: 100%;
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
}
::v-deep .el-form--label-top .el-form-item__label {
padding: 0;
}
</style>

168
Dialog/PopupMessage.vue Normal file
View File

@ -0,0 +1,168 @@
<template>
<div class="popup-message warning" :class="type">
<div class="pop-view">
<span class="pop-title">{{ this.tips || ''}}</span>
<p class="pop-content" v-if="this.msg">{{ this.msg }}</p>
<div class="pop-btn" v-if="button">
<el-button type="primary" class="save" @click="closeMessage">确定</el-button>
</div>
<i class="delete" @click="closeMessage"></i>
</div>
</div>
</template>
<script>
export default {
name: 'PopupMessage',
// props: ["timeVisible", "cfgData", "timeTitle"],
data() {
return {
//
callback: null,
tips: '',
type: '',
msg: '',
button: false,
duration: 0,
};
},
computed: {
//
},
methods: {
getParams(options) {
this.callBack = options.callBack;
this.type = options.type || ''
this.tips = options.tips || ''
this.msg = options.msg || ''
this.button = options.button || false
this.duration = options.duration || 0
this.changePosition()
if(this.duration > 0){
window.setTimeout(() => {
this.$destroy(true)
if(this.$el.parentNode){ //
this.$el.parentNode.removeChild(this.$el)
}
this.changePosition()
}, this.duration)
}
},
changePosition() {
let doc = document.body.getElementsByClassName('popup-message')
let sum = 0;
for(let i=0; i< doc.length; i++){
this.$nextTick(() => {
if(i>0){
sum = sum + document.body.getElementsByClassName('popup-message')[i-1].clientHeight + 5
document.body.getElementsByClassName('popup-message')[i].style = `top: ${sum}px`
}else{
document.body.getElementsByClassName('popup-message')[i].style = `top: 0`
}
})
}
},
closeMessage(){
this.$destroy(true)
this.$el.parentNode.removeChild(this.$el)
this.changePosition()
}
},
mounted() {
},
};
</script>
<style lang="scss" scoped>
.popup-message {
font-family: "Source Han Sans Regular";
color: #333333;
position: fixed;
top: 0;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 500px;
height: fit-content;
border-radius: 8px;
background: #FFFFFF;
border: 1px solid #C2C2C2;
z-index: 9999;
.pop-view{
position: relative;
min-height: 120px;
height: auto;
padding-bottom: 13px;
.pop-title{
display: block;
font-size: 18px;
font-weight: 500;
padding: 13px 52px 9px 52px;
position: relative;
&::before{
position: absolute;
content: '';
// background-image: url('~@/assets/popup/warning.png');
width: 22px;
height: 22px;
left: 20px;
}
}
.pop-content{
font-weight: 400;
font-size: 14px;
padding: 0 52px 5px 52px;
}
.pop-btn{
display: flex;
justify-content: flex-end;
.save{
margin-right: 20px;
}
}
.delete{
position: absolute;
content: '';
// background-image: url('~@/assets/popup/delete.png');
width: 22px;
height: 22px;
top: 18px;
right: 23px;
}
}
}
.success{
background: #F6FFED;
border: 1px solid #73D13D;
color: #73D13D;
.pop-view{
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.pop-view>.pop-title{
&::before{
// background-image: url('~@/assets/popup/success.png');
}
}
}
.error{
background: #FFF1F0;
border: 1px solid #FF7875;
// color: #FF7875;
.pop-view>.pop-title{
&::before{
// background-image: url('~@/assets/popup/error.png');
}
}
}
</style>

214
Dialog/Repeat.vue Normal file
View File

@ -0,0 +1,214 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
title="重复提醒"
:visible.sync="dialogVisible"
width="840px"
:before-close="handleClose"
>
<div>
<div class="top">
<span>
<span style="color:red">以下质检码被 (
<span style="color:blue">
上架/铺货/销售
</span>
)使用过
</span>
现在不能再次使用可使用
<span style="color:blue">替换上架功能</span>
继续上架
</span>
</div>
<div class="mid">
<el-table
:data="repeatdata"
style="width: 100%"
>
<el-table-column label="">
<el-table-column
align="center"
prop="num"
label="序号"
width="80"
/>
<el-table-column
align="center"
prop="qc_code"
label="质检码"
width="180"
/>
</el-table-column>
<el-table-column label="当前机器" align="center">
<el-table-column
align="center"
prop="imei"
label="imei/sn"
width="180"
/>
<el-table-column
align="center"
prop="op_status2"
label="状态"
width="80"
>
<template slot-scope="slot">
<!-- <el-tag> {{ change(row) }}</el-tag> -->
<span v-if="slot.row.op_status2">
<el-tag> {{ change(slot.row.op_status2) }}</el-tag>
</span>
<span v-else>
<el-tag> {{ slot.row.op_status2 }}</el-tag>
</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="质检码已被使用" align="center">
<el-table-column
align="center"
prop="serial_number"
label="编号"
width="180"
/>
<el-table-column
align="center"
prop="op_status1"
label="状态"
width="80"
>
<template slot-scope="slot">
<span v-if="slot.row.op_status1">
<el-tag> {{ change(slot.row.op_status1) }}</el-tag>
</span>
<span v-else>
<el-tag> {{ slot.row.op_status1 }}</el-tag>
</span>
</template>
</el-table-column>
</el-table-column>
</el-table>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="cancleemit"> </el-button>
<el-button type="primary" @click="surerepeat()">确认替换上架</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { zz_new_status, rollback_get_tracking, replace_qc_code } from '@/api/machineList' //
export default {
name: 'Repeat',
components: {
},
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false
}
},
repeatdata: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
}
},
mounted() {
},
methods: {
change(v) { //
if (v === 10) {
return '采购待入库'
} else if (v === 11) {
return '待分拣'
} else if (v === 12) {
return '采购退货'
}  else if (v === 13) {
return '质检中'
} else if (v === 14) {
return '调拨中'
} else if (v === 15) {
return '质检完成'
} else if (v === 16) {
return '采购待退货'
} else if (v === 21) {
return '现场维修中'
} else if (v === 22) {
return '寄修待回机'
} else if (v === 23) {
return '维修完成'
} else if (v === 31) {
return '销售'
} else if (v === 32) {
return '上架'
} else if (v === 33) {
return '铺货'
} else if (v === 34) {
return '销售退货(已收货)'
} else if (v === 35) {
return '下架'
} else if (v === 36) {
return '配件销售'
} else if (v === 37) {
return '预售'
} else if (v === 38) {
return '寄卖中'
} else if (v === 20) {
return '待维修'
} else if (v === 42) {
return '销售退货(待收货)'
} else if (v === 51) {
return '手动出库'
} else if (row.instorage_type === 3) {
return '代卖'
} else {
return '未入库'
}
},
cancleemit() {
this.$emit('close')
},
handleClose() {
this.dialogVisible = false
},
surerepeat() {
const sales_reshelves_id = this.repeatdata.map(v => {
return v.sales_reshelves_id
})
const params = {
sales_reshelves_id: sales_reshelves_id
}
replace_qc_code(params).then(res => {
if (res.errcode == 0) {
setTimeout(() => {
this.$emit('choose')
}, 500);
// this.$message.success('')
}
})
this.dialogVisible = false
}
}
}
</script>
<style>
</style>

465
Dialog/Warehousingprint.vue Normal file
View File

@ -0,0 +1,465 @@
<template>
<el-dialog
:visible.sync="dialogVisible"
width="70%"
top='5vh'
append-to-body
:close-on-click-modal = "false"
:before-close="handleClose"
>
<div class="main" id="printTest" ref="printTest">
<div class="header">
<span style="font-size: 30px; font-weight: bold">入库打印单</span>
</div>
<el-row :gutter="24">
<el-col :span="6">
<div class="body-text">
<span class="text">入库类型:</span>
<span class="text1">{{ aaa.warehousing_type }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">订单名称:</span>
<span class="text1">{{ aaa.order_name }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">客户:</span>
<span class="text1">{{ aaa.customer_id }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">入库仓库:</span>
<span class="text1">{{aaa.op_user_id}}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">业务员:</span>
<span class="text1">{{ aaa.salesman_info }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">入库日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">收款状态:</span>
<span class="text1">{{ aaa.pay_status }}{{aaa.pay_channel ? `(${aaa.pay_channel})` : '' }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">单号:</span>
<span class="text1">{{id}}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">入库数量:</span>
<span class="text1">{{ tableData.length }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">质检员:</span>
<span class="text1">{{aaa.op_user_id}}</span>
</div>
</el-col>
<!-- <el-col :span="6">
<div class="body-text">
<span class="text">库位:</span>
<span class="text1">{{ aaa.location_id }}</span>
</div>
</el-col> -->
</el-row>
<!--引入表格组件-->
<el-table border :data="tableData">
<el-table-column
v-for="(item, index) in tableLabel"
:key="index"
:property="item.param"
:label="item.label"
:formatter="item.formatter"
>
</el-table-column>
</el-table>
<div>
<table style="height: 40px;">
<tr>
<td class="text1">供应商:{{msg.company}}</td>
<td class="text1">联系方式:{{msg.phone}}</td>
<td class="text1">
发货地址:{{msg.address}}
</td>
<td class="text1">总金额:{{ sumprice }}</td>
</tr>
<!-- <tr>
</tr> -->
</table>
</div>
<div class="footer">
<div class="fotter-top" >
<span class="footer-Toptext">{{msg.company}},{{msg.slogan}}</span>
<div class="fotter-main">
<span class="footer-maintext">感谢您选择爱果战壕ERP,我们将竭诚为您服务!!!</span>
<span style="margin-left:5px" class="footer-maintext">服务热线:{{msg.tel}}</span>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-popover
@hide="hide"
title="扫描查看明细"
placement="top-start"
width="100"
trigger="click"
>
<div class="qrcode" ref="qrCodeUrl"></div>
<el-button slot="reference" style="margin:0 10px" @click="share()">分享</el-button>
</el-popover>
<el-button type="primary" v-print="'#printTest'">确认打印</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import {pre_print} from "@/api/machineList"; //
import { op_order_details_code } from "@/api/Warehousing"; //
export default {
name: "Warehousingprint",
data() {
let that = this
const style = '@page { margin: 0 } @media print { zoom:100% }'//
return {
printobj:{
id:'#printTest',
popTitle:'打印',
style:style,
scanStyles:true,
closeCallback(e){
that.$emit("update:dialogVisible", false);
}
},
tableLabel: [
{
label: "序号",
param: "Serial",
align: "center",
width: "100",
show: true,
},
{
label: "IMEI/SN",
input: true,
param: "sn_or_imei",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
formatter:(row)=>{
// console.log(row,666)
let obj = row.sn_or_imei.imei
return obj
}
},
{
label: "机器信息",
param: "phone_list",
align: "center",
show: true,
ortable: true,
formatter:(row)=>{
// console.log(row,666)
let obj = row.phone_list.brand_name+' '+row.phone_list.model_name+' '+row.phone_list.rom_name+' '+row.phone_list.color_name
// let a={brand_name:'',model_name:'',color_name:'',rom_name:'' }
// {{phone_list.brand_name}} {{phone_list.model_name}}{{phone_list.rom_name}} {{phone_list.color_name}}
// for (const key in a) {
// obj +=' ' + row.phone_list[0][key]
// }
return obj
}
},
{
label: "机器等级(成色)",
select: true,
param: "grade_list",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
formatter:(row)=>{
let obj = ''
this.jiqidata.map((res) => {
if(row.grade_list.grade == res.value){
obj = res.label
}else{
return '/'
}
})
return obj
}
},
{
label: "价格",
input: true,
param: "price",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
{
label: "备注",
input: true,
param: "remark",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
],
};
},
computed:{
date() {
var date = new Date();
return date.toLocaleDateString();
},
sumprice() {
var price = 0;
this.tableData.map((res) => {
price += Number(res.price);
});
return price;
},
aaa(){
let obj = JSON.parse(JSON.stringify(this.formLabelAlign))
for(let key in obj){
this.input.map((res,index) => {
if (res.enName == key) {
if(Array.isArray(res.options)){
res.options.map(r=>{
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
}
// window.localStorage.setItem("setform",JSON.stringify(this.formLabelAlign));//
return obj
},
},
watch: {},
created(){
// if(localStorage.getItem("setform")){
// let lastname = JSON.parse(localStorage.getItem("setform"));//
// this.formLabelAlign = lastname
// }
// console.log(this.formLabelAlign,'thisformLabelAlign')
},
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false;
},
},
tableData: {
type: Array,
default: () => {
return [];
},
},
msg: {
type: Object,
default: () => {
return {};
},
},
id: {
type: String,
default: () => {
return '';
},
},
input: {
type: Array,
default: () => {
return [];
},
},
formLabelAlign: {
type: Object,
default: () => {
return {};
},
},
jiqidata: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
toImg() { //
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true,
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
handleClose() {
this.$emit("update:dialogVisible", false);
this.$emit('showbox','false');
},
share() { //
op_order_details_code({order_op_id:this.id}).then((res) => {
this.$delete(this.formLabelAlign,'phone_list');
var list = JSON.stringify(this.formLabelAlign)
var host = window.location.host;
var http = window.location.protocol
// console.log(`${http}`+'//'+`${host}/#/share2?uuid=`+res.datas.uuid+'&formLabelAlign='+list)
new QRCode(this.$refs.qrCodeUrl, {
// text:'https://erpv2.aiguovip.com/#/share/share?uuid='+res.datas.uuid,
text:`${http}`+'//'+`${host}/#/share2?uuid=`+this.id+'&formLabelAlign='+list,
width: 120,
height: 110,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L, //L/M/H
});
})
},
//
hide() {
this.$nextTick(function () {
this.$refs.qrCodeUrl.innerHTML = "";
});
},
},
};
</script>
<style lang="less" scoped>
.body {
display: flex;
flex-direction: column;
}
.body-text {
// display: flex;
// flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
// height: 20px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
</style>

272
Dialog/addStaff.vue Normal file
View File

@ -0,0 +1,272 @@
<!--
* @Author: your name
* @Date: 2021-01-30 11:18:29
* @LastEditTime: 2023-02-20 11:00:58
* @LastEditors: ckycjwds 1240973496@qq.com
* @Description: In User Settings Edit
* @FilePath: \aiguo_erp_vue\src\components\Dialog\addbrand.vue
-->
<template>
<div class="bodydialog">
<el-dialog
:title="Obj.DialogTitle"
:visible.sync="dialogVisible"
width="52%"
:before-close="handleClose"
:close-on-click-modal="false"
>
<!-- :close-on-click-modal="false"-->
<el-form
ref="ruleForm"
label-position="left"
:model="ruleForm"
label-width="100px"
:rules="rules"
size="small"
class="demo-ruleForm"
>
<el-row>
<el-col v-for="(item, index) in Input" :key="index" :span="item.span">
<el-form-item
v-if="item.show "
:prop="item.prop"
:label="item.label"
>
<div style="display: flex;width: 100%;">
<div v-if="item.label == '部门'" style="width: 100%;">
<!-- <cascader
:changeOnSelect="true"
canSearch
v-model="ruleForm[item.enName]"
expandType="hover"
:options="item.options"
:popperProps="popperProps"
></cascader> -->
<el-cascader
v-model="ruleForm[item.enName]"
clearable
:props="{ checkStrictly: true }"
:options="item.options"
/>
</div>
<el-input v-else-if="item.label == '基本薪资' || item.label == '登录时长'" v-model="ruleForm[item.enName]" size="mini" :placeholder="item.placeholder" @input="ruleForm[item.enName] = AmountInput(ruleForm[item.enName])">
<span v-if="!!item.append" slot="append">{{ item.append }}</span>
</el-input>
<div v-else-if="item.label == '状态'" style="width: 100%;">
<el-radio-group v-model="ruleForm[item.enName]">
<el-radio :label="0">正常</el-radio>
<el-radio :label="1">非正常</el-radio>
</el-radio-group>
</div>
<div v-else-if="item.label == '小程序'" style="width: 100%;">
<el-radio-group v-model="ruleForm[item.enName]">
<el-radio :label="0">允许</el-radio>
<el-radio :label="1">不允许</el-radio>
</el-radio-group>
</div>
<div v-else-if="item.label == '微信绑定'" style="width: 100%;">
<el-popover
v-if="!ruleForm['openid']"
v-model="popshow"
placement="top"
title=""
width="260"
trigger="click"
@hide="hide()"
>
<el-image src="https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/erp_img/logo.png" />
<div class="center qrcode">
<el-image style="height:200px;width:200px;" :src="imgurl">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</div>
<div slot="reference" style="color:#005bf5;cursor: pointer;" @click="bind()">
<i class="iconfont iconbangding4" style="margin-right:10px" />
<span>绑定微信</span>
</div>
</el-popover>
<span v-else style="color:green">扫码成功</span>
</div>
<div
:is="item.type"
v-else
v-model="ruleForm[item.enName]"
:placeholder="item.placeholder"
:value="item.value"
:style="item.width"
:format="item.format"
:type="item.TimeType"
:value-format="item.valueformat"
:clearable="true"
:filterable="item.filterable"
:disabled="item.disabled"
:allow-create="item.allowcreate"
:default-first-option="item.defaultfirstoption"
:multiple="item.multiple"
:props="item.props"
:name="item.name"
:show-password="item.showpassword"
@change="change(item.enName, ruleForm[item.enName], Obj.DialogTitle)"
@input="input($event)"
@focus="(v) => focus(ruleForm, item)"
>
<el-option
v-for="items in item.options"
:key="items.value"
:label="items.label"
:value="items.value"
/>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="resetForm()"> </el-button>
<el-button size="small" type="primary" @click="submitForm('ruleForm', Obj.Button, Obj.DialogTitle)"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { qrcode, wx_unbinding } from '@/api/qrcode'
import QRCode from 'qrcodejs2' // qrcode
export default {
name: 'AddStaff',
components: {
QRCode
},
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false
}
},
Obj: {
type: Object,
default: () => {
return {}
}
},
Input: {
type: Array,
default: () => {
return []
}
},
ruleForm: {
type: Object,
default: () => {
return {}
}
},
rules: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
popperProps: {
place: 'bottom-start',
positionFixed: true
},
imgurl: '',
timer: 0,
popshow: false
}
},
watch: {
ruleForm: {
handler() {
console.log(this.ruleForm)
},
deep: true
}
},
methods: {
hide() {
clearInterval(this.timer)
this.popshow = false
},
handleClose() {
this.$refs['ruleForm'].clearValidate()
this.$emit('update:dialogVisible', false)
},
resetForm() {
this.$refs['ruleForm'].clearValidate()
this.$emit('update:dialogVisible', false)
},
input(e) {
this.$forceUpdate()
},
change(enName, e, DialogTitle) {
this.$emit('hide', { enName: enName, e: e, DialogTitle: DialogTitle })
},
focus(row, item) {
this.$emit('Selectfocus', { row: row, item: item })
},
async bind() {
// this.popshow=true
clearInterval(this.timer)
const res = await qrcode({ type: 'erp', user_id: -1 })
this.$nextTick(() => {
this.imgurl = res.datas.qrcode
})
this.timer = setInterval(async() => {
this.$store.dispatch('user/wxbinding', { ticket: res.datas.ticket }).then((res) => {
if (res.errcode == 0) {
// this.$store.dispatch('user/getInfo')
this.ruleForm.openid = res.datas.openid
this.ruleForm.unionid = res.datas.unionid
this.popshow = false
clearInterval(this.timer)
}
})
}, 2000)
},
submitForm(formName, name, DialogTitle) {
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.ruleForm)
this.$emit('save', {
row: this.ruleForm,
tabPosition: this.tabPosition,
checked: this.checked,
name: name,
DialogTitle: DialogTitle
})
// this.$emit('update:dialogVisible', false)
} else {
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
.bodydialog ::v-deep .el-form-item{
margin-bottom: 18px;
margin-left: 18px;
}
.bodydialog ::v-deep .el-cascader--small{
width: 100%;
}
.center {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
flex-wrap: wrap;
}
</style>>

178
Dialog/addbrand.vue Normal file
View File

@ -0,0 +1,178 @@
<!--
* @Author: your name
* @Date: 2021-01-30 11:18:29
* @LastEditTime: 2021-03-03 10:24:42
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \aiguo_erp_vue\src\components\Dialog\addbrand.vue
-->
<template>
<el-dialog
:title="Obj.DialogTitle"
:visible.sync="Add_brand"
width="420px"
:close-on-click-modal="false"
:before-close="handleClose"
>
<el-form
:rules="rules"
label-position="top"
:model="ruleForm"
ref="ruleForm"
label-width="100px"
size="mini"
:inline="true"
class="demo-ruleForm"
>
<el-row>
<el-col style="display:flex;justify-content:space-between">
<el-form-item label="分类级别" prop="type">
<el-radio-group v-model="ruleForm.type">
<el-radio :label="1">分类</el-radio>
<el-radio :label="2">品牌</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="ruleForm.type == 2" label="上级分类" prop="cate_id">
<el-select v-model="ruleForm.cate_id" clearable @blur="e => searchKeyBlur(e, 'ruleForm','cate_id')" filterable placeholder="请选择上级分类">
<el-option
v-for="(item,index) in modaloptions.cate" :key="index"
:label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col style="display:flex;justify-content:space-between">
<el-form-item label="排序" prop="sort">
<el-input v-model="ruleForm.sort" placeholder="请输入排序"></el-input>
</el-form-item>
<el-form-item v-if="ruleForm.type == 1" label="分类名称" prop="name">
<el-input v-model="ruleForm.name" placeholder="请输入分类名称"></el-input>
</el-form-item>
<el-form-item v-if="ruleForm.type == 2" label="选择品牌" prop="brand_id">
<el-select v-model="ruleForm.brand_id" clearable filterable placeholder="请选择品牌">
<el-option
v-for="(item,index) in modaloptions.brand" :key="index"
:label="item.label" :value="item.value"></el-option>
</el-select>
<span @click="addbrands()" style="float:right;color:#409EFF;cursor: pointer;">自定义品牌</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="resetForm()"> </el-button>
<el-button size="small" type="primary" @click="submitForm('ruleForm', Obj.Button, Obj.DialogTitle)"> </el-button
>
</span>
</el-dialog>
</template>
<script>
export default {
name: "addbrand",
data() {
var checkCate_id = (rule, value, callback) => {
if (this.modaloptions.cate.length == 0) {
return callback(new Error('请先添加上级分类'));
}else if (!value) {
return callback(new Error('请选择上级'));
}else{
callback()
}
};
return {
rules: {
type: [
{ required: true, message: '请输入选择类型', trigger: 'change' },
],
name: [
{ required: true, message: '请输入名称', trigger: ['blur','change'] },
],
sort: [
{ required: true, message: '请输入排序', trigger: ['blur','change'] },
],
cate_id: [
{ required: true,validator:checkCate_id, trigger: ['blur','change'] },
],
brand_id: [
{ required: true, message: '请选择品牌', trigger: ['blur','change'] }
],
}
};
},
props: {
Add_brand: {
type: Boolean,
default: () => {
return false;
},
},
modaloptions: {
type: Object,
default: () => {
return {};
},
},
Obj: {
type: Object,
default: () => {
return {};
},
},
Input: {
type: Array,
default: () => {
return [];
},
},
ruleForm: {
type: Object,
default: () => {
return {};
},
},
},
methods: {
searchKeyBlur(e, formName, type) {
// formName type
this.$refs[formName].validateField(type)
},
handleClose() {
this.$emit("update:Add_brand", false);
},
resetForm() {
this.$emit("update:Add_brand", false);
},
input(e){
this.$forceUpdate();
},
change(enName, e, DialogTitle) {
this.$emit("hide", { enName: enName, e: e, DialogTitle: DialogTitle });
},
focus(row, item) {
this.$emit("Selectfocus", { row: row, item: item });
},
addbrands(){
this.$emit('addbrands')
},
submitForm(formName, name, DialogTitle) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$emit("save", {
row: this.ruleForm,
tabPosition:this.tabPosition,
checked:this.checked,
name: name,
DialogTitle: DialogTitle,
});
this.$emit("update:Add_brand", false);
} else {
return false;
}
});
},
},
};
</script>
<style>
</style>

1087
Dialog/batchinfo.vue Normal file

File diff suppressed because it is too large Load Diff

756
Dialog/break.vue Normal file
View File

@ -0,0 +1,756 @@
<template>
<div :v-if="breakshow">
<el-dialog :visible.sync="itemshow" width="56%" top='30vh' append-to-body :close-on-click-modal = "false" :before-close="handleClose">
<div class="scan_box2">
<el-input value="" clearable v-model="text" placeholder="请输入需要评估的机器条码" @input="getnum" />
<i class="iconfont iconsousuo1" style="font-size:28px;" @click="getbreak"></i>
</div>
</el-dialog>
<el-dialog :visible.sync="itemshow2" width="56%" top='5vh' append-to-body :close-on-click-modal = "false" :before-close="handleClose">
<div class="content">
<div style="padding: 15px 15px 0 15px;">当前选择机型{{phone}}</div>
<div style="margin: 15px;">
<div class="line">
<div class="line_item" :style="width"></div>
</div>
</div>
<div class="list_box">
<div class="list">
<div class="list_item" v-for="(item,index) in list1" :key="index" v-if="item.chooseid<num" :style="index==list1.length-1?'border:none':''" >
<div class="item_title">
<div>({{index+1}}){{item.property_name}}</div>
<div style="display: flex;">
<div class="t1">{{item.text}}</div>
<i class="iconfont iconceshishenqing" style="font-size:20px;font-weight:400;" @click="changelist" :data-index='index'>
<span style='font-size: 14px;'></span>
</i>
</div>
</div>
<div class="item_nav" v-if="item.newCreated">
<div class="item" v-for="(item2,index2) in item.children" :key="index2" :class="item2.isChoose==false?'item':'item1'" @click="getGrade(item2,index)" :data-id='item2.id' :data-index='index'>
<div style="word-wrap: normal;">{{item2.property_name}}</div>
</div>
</div>
</div>
</div>
<div style="height: 75px;" v-if="num>list1.length"></div>
<div class="btn_box" v-if="num>list1.length">
<div class="btn" @click="next">下一步</div>
</div>
</div>
</div>
</el-dialog>
<el-dialog :visible.sync="itemshow3" width="56%" top='5vh' append-to-body :close-on-click-modal = "false" :before-close="handleClose">
<div class="content2">
<div style="padding: 15px 15px 0 15px;">当前选择机型{{phone}}</div>
<div class="list_box">
<div class="list">
<div class="list_text">是否存在以下功能问题</div>
<div class="list_item" v-for="(item,index) in list2" :key='index'>
<div class="item_title">
<div>({{index+1}}){{item.property_name}}单选</div>
</div>
<div class="item_nav">
<div class="item" v-for="(item2,index2) in item.children" :key='index2' :class="item2.isChoose==false?'item':'item1'" @click="getGrade2(item2,index)" :data-id='item2.id' :data-index='index'>
<div style="word-wrap: normal;">{{item2.property_name}}</div>
</div>
</div>
</div>
<div class="list_item">
<div class="item_title">
<div>其他功能问题多选或不选</div>
</div>
<!-- <checkbox-group name=""> -->
<div class="item_nav">
<div v-for="(item,index) in list3" :key='index' :class="item.isChoose==false?'item':'item1'" @click="getGrade3(item,index)">
<div v-for="(item2,index2) in item.children" :key='index2' v-if="item2.is_preferred==0" :data-id='item.id' :data-index='index' style="display: flex;align-items: center;">
<div style="word-wrap: normal;">{{item2.property_name}}</div>
</div>
</div>
</div>
<!-- </checkbox-group> -->
</div>
</div>
<div style="height: 75px;"></div>
<div class="btn_box">
<div class="btn" @click="next2">确认</div>
</div>
</div>
<!-- 弹窗 -->
<div class="show_box" v-if="show">
<div class="show_bg">
<div class="show_item1">
{{level_name}}
</div>
<div class="show_item2">当前评级为{{level_name}}</div>
<div class="show_item3">
<div class="showbtn1" @click="agree" style="height: 30px;">确定</div>
<!-- <div class="showbtn2" style="height: 30px;" @click="photo">拍摄详情</div> -->
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
var that;
import { pjt_model_fault,recycle_img_save,pjt_fault_level } from "@/api/machineList"; //
import { MessageBox, Message } from 'element-ui'
export default {
name: "break",
data() {
return {
text:'',
scan_num:'',
// itemshow:false,
itemshow2:false,
itemshow3:false,
show:false,
phone:'',
list1:[],
list2:[],
list3:[],
width:'width:0%',
num:1,
chooselist:[],
level_name:'',
};
},
created() {
that = this
// that.getbreak()
},
computed:{
date() {
var date = new Date();
return date.toLocaleDateString();
},
},
props: {
breakshow: {
type: Boolean,
default: () => {
return false;
},
},
itemshow: {
type: Boolean,
default: () => {
return false;
},
}
},
methods: {
agree(){
that.$emit("showbox", 'false');
that.itemshow2 = false
that.itemshow3 = false
that.text = ''
that.scan_num = ''
that.phone= ''
that.list1= []
that.list2= []
that.list3= []
that.width= 'width:0%'
that.num= 1
that.chooselist= []
that.level_name= ''
that.show = false
},
getnum(e){
that.scan_num = e
},
handleClose(){
that.text = ''
that.scan_num = ''
that.phone= ''
that.list1= []
that.list2= []
that.list3= []
that.width= 'width:0%'
that.num= 1
that.chooselist= []
that.level_name= ''
console.log(that.text)
that.itemshow2 = false
that.itemshow3 = false
that.$emit("showbox", 'false');
// that.$emit("breakshow", 'false');
},
getbreak(){
// that.itemshow = false
if (!!that.scan_num) {
pjt_model_fault({serial_number:that.scan_num}).then((res) => {
console.log('获取故障',res)
var list = res.datas.p_property_list
that.phone = res.datas.model_info
that.model_id = res.datas.model_id
if(list.length!=0){
console.log(1)
that.itemshow2 = true
var arr = []
var arr2 = []
var arr3 = []
list.forEach(function(item,index){
if(item.group_type==1){
arr.push(item)
}
if(item.group_type==2){
arr2.push(item)
}
if(item.group_type==3){
arr3.push(item)
}
})
arr.forEach(function(item,index){
item.newCreated = true
item.chooseid = index
item.children.forEach(function(item2,index2){
item2.isChoose=false
})
})
console.log(12)
arr2.forEach(function(item,index){
item.newCreated = true
item.children.forEach(function(item2,index2){
if(index2==0){
item2.isChoose=true
}else{
item2.isChoose=false
}
})
})
that.list1 = arr
arr3.forEach(function(item,index){
item.isChoose=false
})
that.list3 = arr3
that.list2 = arr2
}else{
Message({
duration:4000,
message: '该机型暂无评估数据',
type: 'warning',
showClose:true,
})
}
});
}else{
this.$message({type:'warning',message:"请输入需要评估的机器条码"})
}
},
getGrade(e,i){//
// console.log(e.target.parentElement.dataset.index,'index')
var indexid = i
var id = e.id
if(that.num==1){
that.width = 'width:'+100/that.list1.length+'%'
console.log(123)
}
var widthnum = 100/that.list1.length.toFixed(2)
console.log(indexid*1+1, that.num)
if((indexid*1+1)==that.num){
that.num++
that.width = 'width:'+widthnum*(indexid*1+1)+'%'
console.log('n', that.num)
}
that.list1.forEach(function(item,index){
if(indexid == index){
item.newCreated = false
item.children.forEach(function(item2,index2){
// console.log(indexid,index,id)
item2.isChoose=false
if(id == item2.id){
item2.isChoose = true
item.text=item2.property_name
}
})
}
})
console.log(that.list1)
},
changelist(e){
var id = e.target.parentElement.dataset.index
var list = that.list1
that.list1.forEach(function(item,index){
if(id == index){
console.log(id,index)
item.newCreated = !item.newCreated
}
})
},
next(){
var chooselist = []
that.text = ''
that.list1.forEach(function(item,index){
item.children.forEach(function(item2,index2){
if(item2.isChoose == true){
chooselist.push(item2.id)
}
})
})
that.chooselist = chooselist
that.itemshow2 = false
that.itemshow3 = true
},
//
backhome(){
uni.switchTab({
url:'../index/index'
})
},
photo(){
uni.reLaunch({
url:'../break_detail/break_detail?level_name='+that.level_name+'&scan_num='+that.scan_num+'&phone='+that.phone
})
},
getGrade2(e,i){//
console.log(e)
var indexid = i
var id = e.id
that.list2.forEach(function(item,index){
if(indexid == index){
item.newCreated = false
item.children.forEach(function(item2,index2){
console.log(indexid,index,id)
item2.isChoose=false
if(id == item2.id){
item2.isChoose = true
item.text=item2.property_name
}
})
}
})
console.log(that.list2)
},
getGrade3(e,i){//
console.log(e)
var indexid = i
var id = e.id
console.log('tag', indexid)
that.list3.forEach(function(item,index){
if(indexid == index){
item.isChoose=!item.isChoose
}
})
console.log(that.list3)
},
// changelist2(e){
// var id = e.target.parentElement.dataset.index
// var list = that.list2
// that.list2.forEach(function(item,index){
// if(id == index){
// console.log(id,index)
// item.newCreated = !item.newCreated
// }
// })
// console.log(that.list2)
// },
next2(){
// uni.showLoading({
// title:'...'
// })
// Message({
// duration:4000,
// message: '...',
// type: 'success',
// showClose:true,
// })
const loading = this.$loading({
lock: true,
text: '评估中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)'
});
// setTimeout(() => {
// loading.close();
// }, 2000);
var chooselist = that.chooselist
that.list2.forEach(function(item,index){
item.children.forEach(function(item2,index2){
if(item2.isChoose == true){
chooselist.push(item2.id)
}
})
})
that.list3.forEach(function(item,index){
if(item.isChoose == true){
item.children.forEach(function(item2,index2){
if(item2.is_preferred == 0){
chooselist.push(item2.id)
}
})
}else{
item.children.forEach(function(item2,index2){
if(item2.is_preferred == 1){
chooselist.push(item2.id)
}
})
}
})
console.log(chooselist,'参数')
pjt_fault_level({property:chooselist,model_id:that.model_id,serial_number:that.scan_num}).then((res) => {
console.log('提交故障',res)
loading.close();
// Message({
// duration:4000,
// message: '',
// type: 'success',
// showClose:true,
// })
that.level_name = res.datas.level_name
that.show = true
console.log(123)
that.postlevel()
// setTimeout(function() {
// that.$emit("showbox", 'false');
// that.itemshow2 = false
// that.itemshow3 = false
// that.text = ''
// that.scan_num = ''
// that.phone= ''
// that.list1= []
// that.list2= []
// that.list3= []
// that.width= 'width:0%'
// that.num= 1
// that.chooselist= []
// that.level_name= ''
// }, 5000)
});
// post_request('/api/recycle/pjt_fault_level',{property:chooselist,model_id:that.model_id,serial_number:that.scan_num}, (res) =>{
// console.log('',res)
// uni.hideLoading()
// that.level_name = res.data.datas.level_name
// that.postlevel()
// that.show = true
// })
},
postlevel(){
recycle_img_save({serial_number:21112132480,level_name:that.level_name}).then((res) => {
console.log('保存等级',res)
});
}
},
};
</script>
<style lang="less" scoped>
.scan_box2{
background-color: white;
border-radius: 5px;
box-shadow: 0px 0px 5px 1px rgba(0,0,0,0.14);
padding: 10px;
display: flex;
align-items: center;
justify-content: center;
width: 500px;
margin: 0 auto;
}
input{
width: 80%;
height: 50px;
border-radius: 30px;
border: none;
font-size: 18px;
}
page{
background-color: #FFFFFF;
}
.icon-img{
font-size: 20px;
color: rgba(187, 187, 187, 1);
font-weight: 400;
}
.list_box{
padding: 0 15px;
margin: 15px;
background-color: #FFFFFF;
border-radius: 5px;
font-size: 13px;
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.14);
}
.list_title{
color: #101010;
font-size: 16px;
font-weight: 600;
height: 50px;
line-height: 50px;
}
.list_item{
border-bottom: 1px solid #ececec;
}
.item_title{
color: #5b5b5b;
font-weight: 600;
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 15px;
}
.item_nav{
flex-wrap: nowrap;
font-size: 13px;
}
.item{
margin-bottom: 10px;
padding: 13px;
text-align: left;
font-size: 13px;
background-color: rgba(187, 187, 187, 0.2);
color: rgba(88, 88, 88, 1.0);
border:1px solid rgba(187, 187, 187, 0.2);
border-radius: 5px;
}
.item1{
margin-bottom: 10px;
padding: 10px;
text-align: left;
font-size: 13px;
background-color: rgba(255,87,48,0.1);
border:1px solid rgba(255,87,48,0.5);
color: #FF5730;
border-radius: 5px;
}
.t1{
width: 175px;
text-align: right;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-right: 5px;
font-size: 13px;
color: #8c8c8c;
}
/* 进度条 */
.line{
height: 10px;
width: 100%;
background-color: #E5E5E5;
border-radius:5px ;
}
.line_item{
height: 10px;
background-color: #FF5730;
border-radius:5px ;
}
/* 按钮 */
.btn_box{
height: 75px;
background-color: #FFFFFF;
width: 100%;
margin: 0 auto;
// box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.14);
}
.btn{
background-color: #FF5730;
color: #FFFFFF;
font-size: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 80%;
padding: 10px 0;
margin: 10px auto 0;
}
.content2 page{
background-color: #FFFFFF;
}
.content2 .icon-img{
font-size: 20px;
color: rgba(187, 187, 187, 1);
font-weight: 400;
}
.content2 .list_box{
padding: 0 15px;
margin: 15px;
background-color: #FFFFFF;
border-radius: 5px;
font-size: 13px;
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.14);
}
.content2 .list_title{
color: #101010;
font-size: 16px;
font-weight: 600;
height:50px;
line-height: 50px;
}
.content2 .list_text{
padding: 10px 0;
border-bottom: 1px solid #E5E5E5;
}
.content2 .list_item{
border-bottom: 1px solid #ececec;
}
.content2 .item_title{
color: #5b5b5b;
font-weight: 600;
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 15px;
}
.content2 .item_nav{
font-size: 13px;
display: flex;
align-items: inherit;
justify-content: space-between;
flex-wrap: wrap;
}
.content2 .item{
margin-bottom: 10px;
padding: 10px;
text-align: left;
font-size: 13px;
background-color: rgba(187, 187, 187, 0.2);
color: rgba(88, 88, 88, 1.0);
border:1px solid rgba(187, 187, 187, 0.2);
border-radius: 5px;
width: 48%;
display: flex;
align-items: center;
}
.content2 .item1{
width: 48%;
margin-bottom: 10px;
padding: 10px;
text-align: left;
font-size: 13px;
background-color: rgba(255,87,48,0.1);
border:1px solid rgba(255,87,48,0.5);
color: #FF5730;
border-radius: 5px;
display: flex;
align-items: center;
}
.content2 .t1{
width: 125px;
text-align: right;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-right: 5px;
font-size: 13px;
color: #8c8c8c;
}
/* 按钮 */
.content2 .btn_box{
height: 75px;
background-color: #FFFFFF;
width: 100%;
margin: 0 auto;
}
.content2 .btn{
background-color: #FF5730;
color: #FFFFFF;
font-size: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 80%;
padding: 10px 0;
margin: 10px auto 0;
}
/* 多选框 */
.content2 checkbox .wx-checkbox-input {
border-radius: 50% !important;
width: 15px;
height: 15px;
}
.content2 checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border-radius: 50% !important;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
color: #fff;
background: #FF5730;
border: 1px solid #FF5730;
}
/* 弹窗 */
.content2 .show_box{
width: 100%;
height: 100vh;
background-color: rgba(0,0,0,0.2);
position: fixed;
top: 0;
left: 0;
overflow: hidden;
z-index: 999;
}
.content2 .show_box image{
width: 110px;
}
.content2 .show_bg{
width: 275px;
background-color: white;
margin: 160px auto 0;
border-radius: 15px;
padding: 20px 15px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.content2 .show_item1{
color: #409eff;
font-size: 40px;
font-weight: 600;
}
.content2 .show_item2{
font-size: 14px;
color: #101010;
margin: 10px;
}
.content2 .show_item3{
display: flex;
align-items: center;
justify-content: center;
margin: 10px 0;
}
.content2 .showbtn2{
padding: 0 18px;
background-color: #409EFF;
border: 1px solid #409EFF;
color: #FFFFFF;
font-size: 13px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
margin: 0 15px;
}
.content2 .showbtn1{
padding: 0px 18px;
background-color: #FFFFFF;
border: 1px solid #409EFF;
color: #409EFF;
font-size: 13px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
margin: 0 15px;
}
</style>

767
Dialog/break2.vue Normal file
View File

@ -0,0 +1,767 @@
<template>
<div :v-if="breakshow">
<!-- <el-dialog :visible.sync="itemshow" width="56%" top='30vh' append-to-body :close-on-click-modal = "false" :before-close="handleClose">
<div class="scan_box2">
<input type="text" value="" v-model="text" placeholder="请输入需要评估的机器条码" @input="getnum" />
<i class="iconfont iconsousuo1" style="font-size:28px;" @click="getbreak"></i>
</div>
</el-dialog> -->
<el-dialog :visible.sync="itemshow2" width="56%" top='5vh' append-to-body :close-on-click-modal = "false" :before-close="handleClose">
<div class="content">
<div style="padding: 15px 15px 0 15px;">当前选择机型{{phone}}</div>
<div style="margin: 15px;">
<div class="line">
<div class="line_item" :style="width"></div>
</div>
</div>
<div class="list_box">
<div class="list">
<div class="list_item" v-for="(item,index) in list1" :key="index" v-if="item.chooseid<num" :style="index==list1.length-1?'border:none':''" >
<div class="item_title">
<div>({{index+1}}){{item.property_name}}</div>
<div style="display: flex;">
<div class="t1">{{item.text}}</div>
<i class="iconfont iconceshishenqing" style="font-size:20px;font-weight:400;" @click="changelist" :data-index='index'>
<span style='font-size: 14px;'></span>
</i>
</div>
</div>
<div class="item_nav" v-if="item.newCreated">
<div class="item" v-for="(item2,index2) in item.children" :key="index2" :class="item2.isChoose==false?'item':'item1'" @click="getGrade(item2,index)" >
<div style="word-wrap: normal;">{{item2.property_name}}</div>
</div>
</div>
</div>
</div>
<div style="height: 75px;" v-if="num>list1.length"></div>
<div class="btn_box" v-if="num>list1.length">
<div class="btn" @click="next">下一步</div>
</div>
</div>
</div>
</el-dialog>
<el-dialog :visible.sync="itemshow3" width="56%" top='5vh' append-to-body :close-on-click-modal = "false" :before-close="handleClose">
<div class="content2">
<div style="padding: 15px 15px 0 15px;">当前选择机型{{phone}}</div>
<div class="list_box">
<div class="list">
<div class="list_text">是否存在以下功能问题</div>
<div class="list_item" v-for="(item,index) in list2" :key='index'>
<div class="item_title">
<div>({{index+1}}){{item.property_name}}单选</div>
</div>
<div class="item_nav">
<div class="item" v-for="(item2,index2) in item.children" :key='index2' :class="item2.isChoose==false?'item':'item1'" @click="getGrade2(item2,index)" >
<div style="word-wrap: normal;">{{item2.property_name}}</div>
</div>
</div>
</div>
<div class="list_item">
<div class="item_title">
<div>其他功能问题多选或不选</div>
</div>
<!-- <checkbox-group name=""> -->
<div class="item_nav">
<div v-for="(item,index) in list3" :key='index' :class="item.isChoose==false?'item':'item1'" @click="getGrade3(item,index)">
<div v-for="(item2,index2) in item.children" :key='index2' v-if="item2.is_preferred==0" style="display: flex;align-items: center;">
<div style="word-wrap: normal;">{{item2.property_name}}</div>
</div>
</div>
</div>
<!-- </checkbox-group> -->
</div>
</div>
<div style="height: 75px;"></div>
<div class="btn_box">
<div class="btn" @click="next2">确认</div>
</div>
</div>
<!-- 弹窗 -->
<div class="show_box" v-if="show">
<div class="show_bg">
<div class="show_item1">
{{level_name}}
</div>
<div class="show_item2">当前评级为{{level_name}}</div>
<div class="show_item3">
<div class="showbtn1" @click="agree" style="height: 30px;">确定</div>
<!-- <div class="showbtn2" style="height: 30px;" @click="photo">拍摄详情</div> -->
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
var that;
import { pjt_model_fault,recycle_img_save,pjt_fault_level } from "@/api/machineList"; //
import { MessageBox, Message } from 'element-ui'
export default {
name: "listbreak",
data() {
return {
text:'',
// scan_num:'',
// itemshow:false,
// itemshow2:false,
itemshow3:false,
show:false,
phone:'',
list1:[],
list2:[],
list3:[],
width:'width:0%',
num:1,
chooselist:[],
level_name:'',
};
},
created() {
that = this
},
watch:{
"breakshow"(newVal,oldVal){
console.log(newVal,oldVal)
if(newVal==true){
that.getbreak()
}
},
},
computed:{
date() {
var date = new Date();
return date.toLocaleDateString();
},
},
props: {
breakshow: {
type: Boolean,
default: () => {
return false;
},
},
scan_num:{
type:String,
default:()=>{
return ''
}
},
itemshow2: {
type: Boolean,
default: () => {
return false;
},
}
},
methods: {
agree(){
that.$emit("showbox", 'false');
// that.itemshow2 = false
that.itemshow3 = false
// that.text = ''
// that.scan_num = ''
// that.phone= ''
that.list1= []
that.list2= []
that.list3= []
that.width= 'width:0%'
that.num= 1
that.chooselist= []
that.level_name= ''
that.show = false
that.getbreak()
},
handleClose(){
console.log('tag', '')
// that.itemshow = false
// that.breakshow = false
// that.text = ''
// that.scan_num = ''
// that.phone= ''
// that.width= 'width:0%'
// that.num = 1
// that.chooselist= []
// that.level_name= ''
// that.itemshow2 = false
that.itemshow3 = false
that.$emit("showbox", 'false');
// that.$emit("breakshow", 'false');
},
getbreak(){
// that.itemshow = false
pjt_model_fault({serial_number:that.scan_num}).then((res) => {
console.log('获取故障',res)
var list = res.datas.p_property_list
that.phone = res.datas.model_info
that.model_id = res.datas.model_id
if(list.length!=0){
console.log(1)
// that.itemshow2 = true
var arr = []
var arr2 = []
var arr3 = []
list.forEach(function(item,index){
if(item.group_type==1){
arr.push(item)
}
if(item.group_type==2){
arr2.push(item)
}
if(item.group_type==3){
arr3.push(item)
}
})
arr.forEach(function(item,index){
item.newCreated = true
item.chooseid = index
item.children.forEach(function(item2,index2){
item2.isChoose=false
})
})
console.log(12)
arr2.forEach(function(item,index){
item.newCreated = true
item.children.forEach(function(item2,index2){
if(index2==0){
item2.isChoose=true
}else{
item2.isChoose=false
}
})
})
that.list1 = arr
arr3.forEach(function(item,index){
item.isChoose=false
})
that.list3 = arr3
that.list2 = arr2
}else{
Message({
duration:4000,
message: '该机型暂无评估数据',
type: 'warning',
showClose:true,
})
}
});
},
getGrade(e,i){//
var indexid = i
var id = e.id
if(that.num==1){
that.width = 'width:'+100/that.list1.length+'%'
console.log(123)
}
var widthnum = 100/that.list1.length.toFixed(2)
console.log(indexid*1+1, that.num)
if((indexid*1+1)==that.num){
that.num++
that.width = 'width:'+widthnum*(indexid*1+1)+'%'
console.log('n', that.num)
}
that.list1.forEach(function(item,index){
if(indexid == index){
item.newCreated = false
item.children.forEach(function(item2,index2){
// console.log(indexid,index,id)
item2.isChoose=false
if(id == item2.id){
item2.isChoose = true
item.text=item2.property_name
}
})
}
})
console.log(that.list1)
},
changelist(e){
var id = e.target.parentElement.dataset.index
var list = that.list1
that.list1.forEach(function(item,index){
if(id == index){
console.log(id,index)
item.newCreated = !item.newCreated
}
})
console.log(that.list1)
},
next(){
var chooselist = []
that.text = ''
that.list1.forEach(function(item,index){
item.children.forEach(function(item2,index2){
if(item2.isChoose == true){
chooselist.push(item2.id)
}
})
})
that.chooselist = chooselist
that.itemshow2 = false
that.itemshow3 = true
},
//
backhome(){
uni.switchTab({
url:'../index/index'
})
},
photo(){
uni.reLaunch({
url:'../break_detail/break_detail?level_name='+that.level_name+'&scan_num='+that.scan_num+'&phone='+that.phone
})
},
getGrade2(e,i){//
console.log(e)
console.log(i);
var indexid = i
var id = e.id
console.log(that.list2);
that.list2.forEach(function(item,index){
if(indexid == index){
item.newCreated = false
item.children.forEach(function(item2,index2){
console.log(item2);
console.log(indexid,index,id)
item2.isChoose=false
if(id == item2.id){
item2.isChoose = true
item.text=item2.property_name
}
})
}
})
console.log(that.list2)
},
getGrade3(e,i){//
console.log(e)
var indexid = i
var id = e.id
// console.log('tag', indexid)
that.list3.forEach(function(item,index){
if(indexid == index){
item.isChoose=!item.isChoose
}
})
console.log(that.list3)
},
// changelist2(e){
// var id = e.target.parentElement.dataset.index
// var list = that.list2
// that.list2.forEach(function(item,index){
// if(id == index){
// console.log(id,index)
// item.newCreated = !item.newCreated
// }
// })
// console.log(that.list2)
// },
next2(){
// uni.showLoading({
// title:'...'
// })
// Message({
// duration:4000,
// message: '...',
// type: 'success',
// showClose:true,
// })
const loading = this.$loading({
lock: true,
text: '评估中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)'
});
// setTimeout(() => {
// loading.close();
// }, 2000);
var chooselist = that.chooselist
that.list2.forEach(function(item,index){
item.children.forEach(function(item2,index2){
if(item2.isChoose == true){
chooselist.push(item2.id)
}
})
})
that.list3.forEach(function(item,index){
if(item.isChoose == true){
item.children.forEach(function(item2,index2){
if(item2.is_preferred == 0){
chooselist.push(item2.id)
}
})
}else{
item.children.forEach(function(item2,index2){
if(item2.is_preferred == 1){
chooselist.push(item2.id)
}
})
}
})
console.log(chooselist,'参数')
pjt_fault_level({property:chooselist,model_id:that.model_id,serial_number:that.scan_num}).then((res) => {
console.log('提交故障',res)
loading.close();
// Message({
// duration:4000,
// message: '',
// type: 'success',
// showClose:true,
// })
that.level_name = res.datas.level_name
that.show = true
console.log(123)
that.postlevel()
// setTimeout(function() {
// that.$emit("showbox", 'false');
// that.itemshow2 = false
// that.itemshow3 = false
// that.text = ''
// that.scan_num = ''
// that.phone= ''
// that.list1= []
// that.list2= []
// that.list3= []
// that.width= 'width:0%'
// that.num= 1
// that.chooselist= []
// that.level_name= ''
// }, 5000)
});
// post_request('/api/recycle/pjt_fault_level',{property:chooselist,model_id:that.model_id,serial_number:that.scan_num}, (res) =>{
// console.log('',res)
// uni.hideLoading()
// that.level_name = res.data.datas.level_name
// that.postlevel()
// that.show = true
// })
},
postlevel(){
recycle_img_save({serial_number:21112132480,level_name:that.level_name}).then((res) => {
console.log('保存等级',res)
});
}
},
};
</script>
<style lang="less" scoped>
.scan_box2{
background-color: white;
border-radius: 5px;
box-shadow: 0px 0px 5px 1px rgba(0,0,0,0.14);
padding: 10px;
display: flex;
align-items: center;
justify-content: center;
width: 500px;
margin: 0 auto;
}
input{
width: 80%;
height: 50px;
border-radius: 30px;
border: none;
font-size: 18px;
}
page{
background-color: #FFFFFF;
}
.icon-img{
font-size: 20px;
color: rgba(187, 187, 187, 1);
font-weight: 400;
}
.list_box{
padding: 0 15px;
margin: 15px;
background-color: #FFFFFF;
border-radius: 5px;
font-size: 13px;
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.14);
}
.list_title{
color: #101010;
font-size: 16px;
font-weight: 600;
height: 50px;
line-height: 50px;
}
.list_item{
border-bottom: 1px solid #ececec;
}
.item_title{
color: #5b5b5b;
font-weight: 600;
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 15px;
}
.item_nav{
flex-wrap: nowrap;
font-size: 13px;
}
.item{
margin-bottom: 10px;
padding: 13px;
text-align: left;
font-size: 13px;
background-color: rgba(187, 187, 187, 0.2);
color: rgba(88, 88, 88, 1.0);
border:1px solid rgba(187, 187, 187, 0.2);
border-radius: 5px;
}
.item1{
margin-bottom: 10px;
padding: 10px;
text-align: left;
font-size: 13px;
background-color: rgba(255,87,48,0.1);
border:1px solid rgba(255,87,48,0.5);
color: #FF5730;
border-radius: 5px;
}
.t1{
width: 175px;
text-align: right;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-right: 5px;
font-size: 13px;
color: #8c8c8c;
}
/* 进度条 */
.line{
height: 10px;
width: 100%;
background-color: #E5E5E5;
border-radius:5px ;
}
.line_item{
height: 10px;
background-color: #FF5730;
border-radius:5px ;
}
/* 按钮 */
.btn_box{
height: 75px;
background-color: #FFFFFF;
width: 100%;
margin: 0 auto;
// box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.14);
}
.btn{
background-color: #FF5730;
color: #FFFFFF;
font-size: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 80%;
padding: 10px 0;
margin: 10px auto 0;
}
.content2 page{
background-color: #FFFFFF;
}
.content2 .icon-img{
font-size: 20px;
color: rgba(187, 187, 187, 1);
font-weight: 400;
}
.content2 .list_box{
padding: 0 15px;
margin: 15px;
background-color: #FFFFFF;
border-radius: 5px;
font-size: 13px;
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.14);
}
.content2 .list_title{
color: #101010;
font-size: 16px;
font-weight: 600;
height:50px;
line-height: 50px;
}
.content2 .list_text{
padding: 10px 0;
border-bottom: 1px solid #E5E5E5;
}
.content2 .list_item{
border-bottom: 1px solid #ececec;
}
.content2 .item_title{
color: #5b5b5b;
font-weight: 600;
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 15px;
}
.content2 .item_nav{
font-size: 13px;
display: flex;
align-items: inherit;
justify-content: space-between;
flex-wrap: wrap;
}
.content2 .item{
margin-bottom: 10px;
padding: 10px;
text-align: left;
font-size: 13px;
background-color: rgba(187, 187, 187, 0.2);
color: rgba(88, 88, 88, 1.0);
border:1px solid rgba(187, 187, 187, 0.2);
border-radius: 5px;
width: 48%;
display: flex;
align-items: center;
}
.content2 .item1{
width: 48%;
margin-bottom: 10px;
padding: 10px;
text-align: left;
font-size: 13px;
background-color: rgba(255,87,48,0.1);
border:1px solid rgba(255,87,48,0.5);
color: #FF5730;
border-radius: 5px;
display: flex;
align-items: center;
}
.content2 .t1{
width: 125px;
text-align: right;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-right: 5px;
font-size: 13px;
color: #8c8c8c;
}
/* 按钮 */
.content2 .btn_box{
height: 75px;
background-color: #FFFFFF;
width: 100%;
margin: 0 auto;
}
.content2 .btn{
background-color: #FF5730;
color: #FFFFFF;
font-size: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 80%;
padding: 10px 0;
margin: 10px auto 0;
}
/* 多选框 */
.content2 checkbox .wx-checkbox-input {
border-radius: 50% !important;
width: 15px;
height: 15px;
}
.content2 checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border-radius: 50% !important;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
color: #fff;
background: #FF5730;
border: 1px solid #FF5730;
}
/* 弹窗 */
.content2 .show_box{
width: 100%;
height: 100vh;
background-color: rgba(0,0,0,0.2);
position: fixed;
top: 0;
left: 0;
overflow: hidden;
z-index: 999;
}
.content2 .show_box image{
width: 110px;
}
.content2 .show_bg{
width: 275px;
background-color: white;
margin: 160px auto 0;
border-radius: 15px;
padding: 20px 15px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.content2 .show_item1{
color: #409eff;
font-size: 40px;
font-weight: 600;
}
.content2 .show_item2{
font-size: 14px;
color: #101010;
margin: 10px;
}
.content2 .show_item3{
display: flex;
align-items: center;
justify-content: center;
margin: 10px 0;
}
.content2 .showbtn2{
padding: 0 18px;
background-color: #409EFF;
border: 1px solid #409EFF;
color: #FFFFFF;
font-size: 13px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
margin: 0 15px;
}
.content2 .showbtn1{
padding: 0px 18px;
background-color: #FFFFFF;
border: 1px solid #409EFF;
color: #409EFF;
font-size: 13px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
margin: 0 15px;
}
</style>

244
Dialog/getoff.vue Normal file
View File

@ -0,0 +1,244 @@
<!--
* @Author: your name
* @Date: 2021-01-30 11:18:29
* @LastEditTime: 2021-03-03 10:24:42
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \aiguo_erp_vue\src\components\Dialog\addbrand.vue
-->
<template>
<el-dialog
:visible.sync="visible"
width="620px"
class="modal"
:close-on-click-modal="false"
:before-close="handleClose"
>
<div style="display:flex;align-items: center;">
<el-image src="https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/erp/img/zhuanzhuan.png"></el-image>
<span>已自动过滤不可下架的机器</span>
</div>
<!-- <div class="cass">
<span style="margin-left:5px">5s内将确认最新状态</span>
<span style="margin-right:5px">正在确认</span>
</div> -->
<div style="display:flex;justify-content:space-between">
<!-- <div>
<h3>客户 {{getoffform.text.name}}</h3>
<h3>操作订单号 {{getoffform.text.order}}</h3>
</div>
<div style="height:50px;display:flex;align-items:center;justify-content:center;">
<el-tag style="margin-right:10px">上架中</el-tag>
<span style="color:#909399; display:flex;flex-direction:column;align-items:center">
<span>{{getoffform.text.cz}}</span>
<i style="font-size:10px;margin-top: -12px;" class="iconfont iconguocheng"></i>
</span>
<el-tag style="margin-left:10px">{{getoffform.text.zt}}</el-tag>
</div> -->
<!-- <span style="color:#9AAFC0;cursor: pointer;float: right;">
<i class="el-icon-refresh"></i>
刷新获取最新结果</span> -->
</div>
<!-- 下架中 -->
<div v-if="activeName=='1'">
<div style="display:flex;align-items:center;justify-content:space-between">
<span style="display:flex;align-items:center;">
<el-image style="widith:50px;height:50px" src="https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/erp/img/sample.gif"></el-image>
正在下架中
</span>
<span style="margin-right:60px;font-size:16px">预计下架时间 {{getoffform.time}}</span>
</div>
<div class="phoneclass">
<div v-for="(item,index) in getoffform.data" :key="index" style="display:flex;align-items:center;justify-content:space-between">
<div style="display:flex;align-items:center;">
<el-image v-if="!!item.color_img" style="width:100px;height:100px" :src="item.color_img"></el-image>
<el-image v-else style="width:120px;height:120px" src="https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/aiguo2022/errimg.png"></el-image>
<div class="items" style="margin-left:10px">
<!-- <h3 style="font-weight:bold">{{item.sku_name}}</h3> -->
<span style="font-weight:bold">IMEI/SN {{item.imei}}</span>
</div>
</div>
</div>
</div>
</div>
<!-- 下架完成 -->
<div v-else >
<div v-loading="loading">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane :label="'下架失败('+getoffform.fail_datas.length+')'" name="error">
<div class="phoneclass">
<div v-for="(item,index) in getoffform.fail_datas" :key="index" style="display:flex;align-items:center;justify-content:space-between">
<div style="display:flex;align-items:center;">
<el-image v-if="!!item.color_img" style="width:100px;height:100px" :src="item.color_img"></el-image>
<el-image v-else style="width:120px;height:120px" src="https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/aiguo2022/errimg.png"></el-image>
<div class="items" style="margin-left:10px">
<h3 style="font-weight:bold">{{item.sku_name}}</h3>
<span style="font-weight:bold">IMEI/SN {{item.imei}}</span>
</div>
</div>
<div style="margin-right:10px">
失败原因{{item.msg}}
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane :label="'下架成功('+getoffform.success_datas.length+')'" name="success">
<div class="phoneclass">
<div v-for="(item,index) in getoffform.success_datas" :key="index" style="display:flex;align-items:center;justify-content:space-between">
<div style="display:flex;align-items:center;">
<el-image v-if="!!item.color_img" style="width:100px;height:100px" :src="item.color_img"></el-image>
<el-image v-else style="width:120px;height:120px" src="https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/aiguo2022/errimg.png"></el-image>
<div class="items" style="margin-left:10px">
<h3 style="font-weight:bold">{{item.sku_name}}</h3>
<span style="font-weight:bold">IMEI/SN {{item.imei}}</span>
</div>
</div>
<div style="margin-right:10px">
<p v-if="item.state_name">
转转状态:
<el-tag>{{item.state_name}}</el-tag>
</p>
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="resetForm()"> </el-button>
<el-button v-if="getoffform.fail_datas.length>0" size="small" type="primary" @click="off()">重新下架</el-button
>
</span>
</el-dialog>
</template>
<script>
import {grpc_off_shelf} from "@/api/Jiqidetails"; //select Api
export default {
name: "addbrand",
data() {
return {
activeName:'1',
percentage:50,
loading:true,
};
},
props: {
visible: {
type: Boolean,
default: () => {
return false;
},
},
modaloptions: {
type: Object,
default: () => {
return {};
},
},
Obj: {
type: Object,
default: () => {
return {};
},
},
Input: {
type: Array,
default: () => {
return [];
},
},
getoffform: {
type: Object,
default: () => {
return {};
},
},
},
methods: {
searchKeyBlur(e, formName, type) {
// formName type
this.$refs[formName].validateField(type)
},
handleClick(){
},
handleClose() {
this.$emit("handleClose");
},
resetForm() {
this.$emit("handleClose");
},
input(e){
this.$forceUpdate();
},
change(enName, e, DialogTitle) {
this.$emit("hide", { enName: enName, e: e, DialogTitle: DialogTitle });
},
focus(row, item) {
this.$emit("Selectfocus", { row: row, item: item });
},
addbrands(){
this.$emit('addbrands')
},
off() {
if (this.getoffform.fail_datas) {
this.getoffform.time = this.getoffform.fail_datas.length * 3 + ``
this.getoff.activeName == '1'
let that = this
grpc_off_shelf({list:this.getoffform.fail_datas}).then(res=>{
that.getoff.activeName = 'error'
that.getoffform.data.map(e=>{
that.getoffform.fail_datas = res.datas.fail_datas.map(k=>{
if (e.qc_code == k.datas.qc_code) {
return {...e,...k}
}
})
})
that.getoffform.data.map(e=>{
that.getoffform.success_datas =res.datas.success_datas.map(k=>{
if (e.qc_code == k.datas.qc_code) {
return {...e,...k}
}
})
})
})
}
},
},
};
</script>
<style lang="scss" scoped>
.modal ::v-deep .el-dialog__body{
padding: 0px 20px;
}
.items{
display: flex;
flex-direction: column;
}
.cass{
display: flex;
justify-content: space-between;
background: #eee;
height: 20px;
margin-bottom: 5px;
}
.phoneclass{
height: 400px;
overflow: auto;
}
.image-slot{
font-size: 30px;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.dialog-footer{
display: flex;
justify-content: space-between;
}
</style>

View File

@ -0,0 +1,145 @@
<template>
<div class="dilog">
<el-dialog :title="!isfabu ? '亮灯提示' : '发布结果'" :visible.sync="dialogTableVisibleTips" :before-close="close">
<el-table :data="gridData" height="300px" v-if="!isfabu" @selection-change="handleSelectionChange"
ref="multipleTable">
<el-table-column type="selection" width="55" :selectable="selectable">
</el-table-column>
<el-table-column property="imei1" label="IMEI/SN" width="150">
<template slot-scope="{row}">
<span>
{{ row.imei1 || row.imei2 || row.sn }}
</span>
</template>
</el-table-column>
<el-table-column property="model_info" label="机器信息" width="200">
<template slot-scope="{row}">
<span style="display:felx;align-items:center;">
<el-popover placement="right" width="350" trigger="click">
<img v-if="!!row['img']" style="height: 350px" :src="row['img']">
<img v-if="!!row['img']" slot="reference" style="float: left;height: 50px"
:src="row['img']">
</el-popover>
{{ row['brand_name'] }} {{ row['model_name'] }} {{ row['rom_name'] }} {{ row['color_name'] }}
</span>
</template>
</el-table-column>
<el-table-column property="status" label="亮灯状态">
<template slot-scope="{row}">
<span>
{{ row.tipsStatus == 0 ? '不在货架' : '成功' }}
</span>
</template>
</el-table-column>
</el-table>
<el-table :data="fabuData" height="300px" v-if="isfabu">
<el-table-column property="business_id" label="质检码" width="150">
<template slot-scope="{row}">
<span>
{{ row.business_id }}
</span>
</template>
</el-table-column>
<el-table-column property="status" label="发布状态">
<template slot-scope="{row}">
<span>
{{ row.msg }}
</span>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="warning" @click="closeLight">关灯</el-button>
<el-button @click="quzou">已取走</el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
gridDataList: [],
}
},
props: {
dialogTableVisibleTips: {
type: Boolean,
default: () => {
return false;
}
},
gridData: {
default: () => {
return [{
imei: '666',
name: '王小虎',
status: '0'
}]
}
},
fabuData: {
default: () => {
return []
}
},
isfabu: {
default: () => {
return false
}
}
},
watch: {
gridData(newval) {
console.log(newval, '子------------gridData');
if (newval.length > 0) {
newval.forEach(row => {
this.$nextTick(() => {
if (row.tipsStatus != 0) {
this.$refs.multipleTable.toggleRowSelection(row)
}
})
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
fabuData(newval) {
console.log(newval, '子------------fabuData');
},
},
methods: {
confirm() {
this.$emit('dialogTipsChange', false)
},
close() {
this.confirm();
},
//
closeLight() {
this.$emit('tipCloseLight', this.gridDataList)
},
//
quzou() {
this.$emit('tipCloseLight', this.gridDataList,1)
},
//
handleSelectionChange(e) {
this.gridDataList = e;
console.log(e);
},
selectable(row,rowIndex){
if(row.tipsStatus == 0){
return false;
}else {
return true;
}
},
},
}
</script>
<style></style>

638
Dialog/index.vue Normal file
View File

@ -0,0 +1,638 @@
<template>
<div class="content">
<el-dialog
:title="Obj.DialogTitle"
:visible.sync="dialogVisible"
width="40%"
:before-close="close"
:close-on-click-modal="closeclickmodal"
class="abow_dialog"
>
<span v-if="Obj.DialogTitle == '添加销售'" style="display:flex">
<el-radio-group v-model="ruleForm.is_sales_accessories" @change="radio_change">
<el-radio-button :label="0">手机销售</el-radio-button>
<el-radio-button :label="1">配件销售</el-radio-button>
</el-radio-group>
</span>
<span v-if="Obj.DialogTitle == '品牌转移'" style="display:flex">
原品牌信息:品牌:{{ original.brand }} 型号:{{ original.model_set }} 容量:{{ original.ram }} 颜色:{{ original.color }}
</span>
<el-form
ref="ruleForm"
label-position="top"
:model="ruleForm"
label-width="100px"
size="mini"
>
<el-row>
<el-col v-for="(item, index) in Input" :key="index" :span="item.span">
<el-form-item
v-if="item.Typeshow"
:prop="item.prop"
:rules="{
required: item.required,
message: item.placeholder,
trigger: ['blur', 'change'],
}"
:label="item.label"
>
<template slot="label">
<div v-if="Obj.DialogTitle == '添加销售'&&item.label=='条形码'" style="display:flex;align-items: center;justify-content: space-between;">
<div>条形码</div>
<div v-if="imei.zljshow" style="margin-left:20px">
<div v-if="loadinglist.codeloading==1" style="display:flex;align-items: center;color:#9AAFC0">
<i class="el-icon-loading" style="color:orange;font-size:20px" />
<span>自动查询中</span>
</div>
<div v-else-if="loadinglist.codeloading==3" style="display:flex;align-items: center;">
<!-- <i class="el-icon-error" style="color:#F56C6C;font-size:20px"></i>
<span style="color:#F56C6C">查询失败</span> -->
<a style="display:flex;align-items: center;" @click="getcode()">
<i class="el-icon-refresh-right" style="color:#9AAFC0;margin-left:15px;font-size:20px" />
<span style="color:#9AAFC0">重新获取</span>
</a>
</div>
<div v-else-if="loadinglist.codeloading==2" style="display:flex;align-items: center;color:#9AAFC0">
<!-- <i class="el-icon-success" style="color:#67C23A;font-size:20px"></i>
<span style="color:#67C23A">查询成功</span> -->
<span style="margin-left:15px">状态:</span>
<span :style="loadinglist.state_name=='上架中'?'color:green':'color:red'">{{ loadinglist.state_name }}</span>
<el-popover placement="bottom" trigger="click">
<el-table :data="[loadinglist.gridData]">
<el-table-column type="index" width="50" label="编号" align="center" />
<el-table-column width="150" property="imei" label="IMEI" align="center" />
<el-table-column width="150" property="qc_code" label="质检码/商品Id" align="center" />
<el-table-column width="150" property="order_time" label="供货时间" align="center">
<template slot-scope="scope">
{{ scope.row['order_time'] | dateformat("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<el-table-column width="150" property="sold_time" label="售出时间" align="center">
<template slot-scope="scope">
<span v-if="!!scope.row['sold_time']">{{ scope.row['sold_time'] | dateformat("YYYY-MM-DD HH:mm:ss") }}</span>
<span v-else>-</span>
</template>
</el-table-column>
</el-table>
<i slot="reference" class="el-icon-info" style="font-size:20px" />
</el-popover>
</div>
</div>
</div>
<div v-if="Obj.DialogTitle == '添加销售'&&item.label=='快递单号'" style="display:flex;align-items: center;justify-content: space-between;">
<div>快递单号</div>
<div v-if="imei.zljshow" style="margin-left:20px">
<div v-if="loadinglist.codeloading==1" style="display:flex;align-items: center;color:#9AAFC0">
<i class="el-icon-loading" style="color:orange;font-size:20px" />
<span>自动查询中</span>
</div>
<div v-else-if="loadinglist.codeloading==3" style="display:flex;align-items: center;">
<!-- <i class="el-icon-error" style="color:#F56C6C;font-size:20px"></i>
<span style="color:#F56C6C">查询失败</span> -->
<a style="display:flex;align-items: center;" @click="getcode()">
<i class="el-icon-refresh-right" style="color:#9AAFC0;margin-left:15px;font-size:20px" />
<span style="color:#9AAFC0">重新获取</span>
</a>
</div>
<div v-else-if="loadinglist.codeloading==2" style="display:flex;align-items: center;color:#9AAFC0">
<!-- <i class="el-icon-success" style="color:#67C23A;font-size:20px"></i>
<span style="color:#67C23A">查询成功</span> -->
<span style="margin-left:15px">状态:</span>
<span :style="loadinglist.state_name=='上架中'?'color:green':'color:red'">{{ loadinglist.state_name }}</span>
<el-popover placement="bottom" trigger="click">
<el-table :data="[loadinglist.gridData]">
<el-table-column type="index" width="50" label="编号" align="center" />
<el-table-column width="150" property="imei" label="IMEI" align="center" />
<el-table-column width="150" property="qc_code" label="质检码/商品Id" align="center" />
<el-table-column width="150" property="order_time" label="供货时间" align="center">
<template slot-scope="scope">
{{ scope.row['order_time'] | dateformat("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<el-table-column width="150" property="sold_time" label="售出时间" align="center">
<template slot-scope="scope">
<span v-if="!!scope.row['sold_time']">{{ scope.row['sold_time'] | dateformat("YYYY-MM-DD HH:mm:ss") }}</span>
<span v-else>-</span>
</template>
</el-table-column>
</el-table>
<i slot="reference" class="el-icon-info" style="font-size:20px" />
</el-popover>
</div>
</div>
</div>
</template>
<div style="display:flex;">
<el-input
v-if="item.label =='销售价格'|| item.label =='采购价格' || item.label =='支付金额' ||item.label =='销售总价格' "
v-model="ruleForm[item.enName]"
:style="item.width"
:clearable="true"
:props="item.props"
:placeholder="item.placeholder"
:value="item.value"
@input="ruleForm[item.enName] = AmountInput(ruleForm[item.enName],2,'exceed')"
/>
<div
:is="item.type"
v-else
v-model="ruleForm[item.enName]"
:placeholder="item.placeholder"
:value="item.value"
:style="item.width"
:format="item.format"
:type="item.TimeType"
:value-format="item.valueformat"
:clearable="true"
:filterable="item.filterable"
:disabled="item.disabled"
:allow-create="item.allowcreate"
:picker-options="item.pickerOptions"
:default-first-option="item.defaultfirstoption"
:multiple="item.multiple"
:props="item.props"
:name="item.name"
@change="change(item.enName,ruleForm[item.enName],Obj.DialogTitle,item.label,item.options,item)"
@remove-tag="removetag"
>
{{ item.name == 'is_accessories'? '' : item.name }}
<el-option
v-for="items in item.options"
:key="items.value"
:label="items.label"
:value="items.value"
>
<span v-if="item.label == '颜色'">
<span style="float: left">{{ items.label }}</span>
<el-popover
placement="right"
width="200"
trigger="hover"
>
<img
v-if="items.img"
style="height: 200px"
:src="items.img"
>
<img
v-if="items.img"
slot="reference"
style="float: right;height: 34px"
:src="items.img"
>
</el-popover>
</span>
</el-option>
</div>
</div>
</el-form-item>
<el-col
v-for="(r, i) in item.repair_customer"
:key="i"
:span="r.span"
>
<el-col v-for="(value, key, index) in r" :key="index" :span="value.span" :class="value.class">
<el-form-item
:label="value.label"
:prop="value.prop"
:rules="{
required: value.required,
message: value.placeholder,
trigger: ['blur', 'change'],
}"
>
<div style="display:flex">
<div
:is="value.type"
v-model="ruleForm.accessories[i][value.enName]"
:style="value.width"
:filterable="value.filterable"
clearable
:placeholder="value.placeholder"
onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"
>
<el-option
v-for="items in value.options"
:key="items.value"
:label="items.label"
:value="items.value"
:res_id="items.value"
>
<span v-if="value.label == '配件'" style="float: left">{{ items.label }}</span>
<span v-if="value.label == '配件'" style="float: right; color: #8492a6; font-size: 13px">{{ items.number ? `(${items.number})` : '' }}</span>
</el-option>
</div>
</div>
<i class="Font" :class="value.Icon" @click="operation(r,i,value.name)" />
</el-form-item>
</el-col>
</el-col>
<el-col
v-for="(items, i) in item.alipay"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.alipay[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="alipay"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:action-url="items.action"
:image-url="ruleForm.pay_info.alipay[items.enName]"
type="alipay"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col
v-for="(items, i) in item.wechat"
:key="i"
:span="items.span"
>
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.wechat[items.enName]"
:action="items.action"
:placeholder="items.placeholder"
type="wechat"
/>
<!--图片上传组件-->
<uploadImg
v-if="items.type == 'el-upload'"
:action-url="items.action"
:image-url="ruleForm.pay_info.wechat[items.enName]"
type="wechat"
@UrlImg="UrlImg"
/>
</el-form-item>
</el-col>
<el-col v-for="(items, i) in item.bank" :key="i" :span="items.span">
<el-form-item>
<div
:is="items.type"
v-model="ruleForm.pay_info.bank[items.enName]"
:placeholder="items.placeholder"
/>
</el-form-item>
</el-col>
</el-col>
</el-row>
<el-form-item>
<el-button @click="resetForm('ruleForm')">取消</el-button>
<el-button v-if="Obj.DialogTitle == '选择属性'" type="success" @click="Reexamination()">重查保修</el-button>
<el-button type="primary" @click="submitForm('ruleForm', Obj.Button, Obj.DialogTitle)">{{ Obj.Button }}</el-button>
</el-form-item>
</el-form>
<!--客户-->
<innerDIalog :inner-visible.sync="innerVisible" append-to-body :input="InputArr" :rule-form="rule" :obj="DiaButton" @save="addsave" @ImgSrc="ImgSrc" />
<Dialog :outer-visible.sync="outerVisible" :options="options" :statusoptions="statusoptions" :rule-form="Sales" :obj="DiaButton" @addplus="addplus" @del="del" @save="addsave" />
</el-dialog>
</div>
</template>
<script>
import { save_User } from '@/api/Suppliermanagement'
import { save } from '@/api/salesman'
import uploadImg from '@/components/Upload'
import innerDIalog from '@/components/Dialog/InnerDialog' //
import Dialog from '../../views/settings/dialog' //
import { zz_new_status } from '@/api/machineList' //
import { cate_brand_list_in_stock } from '@/api/Jiqidetails' //
export default {
components: {
uploadImg,
innerDIalog,
Dialog
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
closeclickmodal: {
type: Boolean,
default: true
},
list: {
type: Array,
default: () => {
return []
}
},
original: {
type: Object,
default: () => {
return {}
}
},
Obj: {
type: Object,
default: () => {
return {}
}
},
Obj_money: {
type: Object,
default: () => {
return {}
}
},
Input: {
type: Array,
default: () => {
return []
}
},
imei: {
type: Object,
default: () => {
return {}
}
},
ruleForm: {
type: Object,
default: () => {
return {}
}
},
amount_money: {
type: [Number, String],
default: () => {
return 0
}
},
Settlement_amount: {
type: [Number, String],
default: () => {
return 0
}
},
pay_customer: {
type: [Number, String],
default: () => {
return 0
}
},
/* 用户信息 二维码 银行卡*/
user_info: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
checked: false,
tabPosition: '不使用预付款',
radio1: '手机销售',
outerVisible: false,
innerVisible: false,
actionUrl: 'https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com',
Sales: {}, //
DiaButton: { DialogTitle: '', Button: '' },
rule: {},
enName: '',
//
InputArr: [],
options: [{ label: '固定值', value: 1 }, { label: '百分比', value: 2 }],
statusoptions: [{ label: '正常', status: 0 }, { label: '非正常', status: 1 }],
type: '',
loadinglist: []
}
},
computed: {
//
pay_info() {
return this.bank_info.pay_info ? JSON.parse(this.bank_info.pay_info) : { alipay: { qr_code: '', name: '' }, wechat: { qr_code: '', name: '' }, bank: { bank_no: '', name: '', kaihuhang: '' }}
}
},
watch: {
list: {
handler(newVal, value) {
if (newVal) {
// this.$set(this.loadinglist,'',newVal)
this.loadinglist = newVal
if (newVal.customer_barcode) {
// this.$set(this.ruleForm,'barcode',newVal.customer_barcode)
}
}
},
deep: true,
immediate: true
},
imei: {
handler(newVal, value) {
if (newVal) {
if (newVal.zljshow) {
this.$set(this.ruleForm, 'barcode', this.loadinglist.customer_barcode)
} else {
this.$set(this.ruleForm, 'barcode', '')
}
}
},
deep: true,
immediate: true
}
},
created() {
},
methods: {
getcode() {
const e = this.imei
if (e.account && e.account.length != 0) {
const Obj = { imei: e.imei1, imei2: e.imei2, account: e.account }
this.$set(this.loadinglist, 'codeloading', 1)
zz_new_status(Obj).then((res) => {
if (res.errcode == 0 && res.datas.length != 0) {
this.$set(this.loadinglist, 'gridData', res.datas)
this.$set(this.loadinglist, 'customer_barcode', res.datas[0].qc_code)
this.$set(this.loadinglist, 'codeloading', 2)
this.$set(this.loadinglist, 'state_name', res.datas[0].state_name)
this.$set(this.loadinglist, 'order_time', res.datas[0].order_time)
this.$set(this.loadinglist, 'sold_time', res.datas[0].sold_time)
} else {
this.$set(this.loadinglist, 'codeloading', 3)
}
})
}
},
// 使resetFields
clearcheck() {
if (this.$refs['ruleForm']) {
this.$refs['ruleForm'].clearValidate()
}
},
Reexamination() {
this.$emit('Reexamination')
},
//
radio_change(val) {
this.$emit('radio_change', val)
},
input(e) {
this.$forceUpdate()
},
change(enName, e, DialogTitle, label, options) {
if (DialogTitle == '选择属性') {
for (const key in this.ruleForm) {
if (key == enName) {
var str = enName.substring(0, enName.length - 2) // enName :brand_id brand_
str = str + 'name' // name brand_ band_name valuelabel
options.map((item) => {
if (item.value === e) {
this.ruleForm[str] = item.label // valuevalue label ruleForm
}
})
}
}
this.$emit('hide', { enName: enName, e: e, DialogTitle: DialogTitle, row: this.ruleForm, label: label })
}
if (enName == 'new_other') {
this.$emit('change_new_other', e)
} else if (DialogTitle == '添加销售') {
let account_class_code = '' //
if (Array.isArray(options)) {
options.map(r => {
if (e == r.value) {
account_class_code = r.account_class_code
}
})
}
this.$emit('hide', { enName: enName, e: e, DialogTitle: DialogTitle, row: this.ruleForm, label: label, account_class_code: account_class_code })
} else {
this.$emit('hide', { enName: enName, e: e, DialogTitle: DialogTitle, row: this.ruleForm, label: label })
}
},
focus(row, item) {
this.$emit('Selectfocus', { row: row, item: item })
},
tabclick(value) {
this.$emit('surplus_money', { tabPosition: this.tabPosition, actual_Settlement_amount: this.actual_Settlement_amount })
},
submitForm(formName, name, DialogTitle) {
this.$refs[formName].validate((valid, obj) => {
if (valid) {
if (this.ruleForm.price && this.ruleForm.textarea_price) {
this.$message({ type: 'warning', message: '填写一个即可,禁止填写两个' })
return
}
if (this.ruleForm.remark && this.ruleForm.textarea_remark) {
this.$message({ type: 'warning', message: '填写一个即可,禁止填写两个' })
return
}
if (this.ruleForm.grade_list && this.ruleForm.textarea_grade_list) {
this.$message({ type: 'warning', message: '填写一个即可,禁止填写两个' })
return
}
this.$emit('save', {
row: this.ruleForm,
original: this.original,
tabPosition: this.tabPosition,
checked: this.checked,
name: name,
DialogTitle: DialogTitle
})
this.tabPosition = '不使用预付款'
this.$emit('update:dialogVisible', false)
} else {
return false
}
})
},
resetForm() {
this.tabPosition = '不使用预付款'
this.$emit('colse')
this.$emit('update:dialogVisible', false)
},
close() {
this.tabPosition = '不使用预付款'
this.$emit('colse')
this.$emit('update:dialogVisible', false)
},
//
UrlImg(data) {
this.$emit('img', data)
},
addsave(data) {
if (data.Sales == 'Sales') {
save(data.row).then((res) => {
this.$emit('update')
})
} else {
save_User(data.row).then((res) => {})
}
},
addplus() {
this.Sales.brokerage.push({ 'range': [], 'type': '', 'value': '' })
},
del(data) {
this.$delete(this.Sales.brokerage, data)
},
//
operation(r, i, name) {
this.$emit('operation', { row: r, index: i, name: name })
},
ImgSrc(data) {
if (data.type == 'alipay') {
this.rule.pay_info.alipay.qr_code = data.imageUrl
} else {
this.rule.pay_info.wechat.qr_code = data.imageUrl
}
},
// Tag
removetag(r) {
this.$emit('removetag', r)
}
}
}
</script>
<style scoped lang="scss">
.fonticon{
color: #fff;
padding: 0px 15px;
font-size: 24px;
position: relative;
top: 5px;
}
.fontcont{
padding: 0px 15px;
font-size: 24px;
}
.IconClass{
display: flex;
display: -webkit-flex;
align-items: center;
justify-content: center;
position: relative;
top: 40px;
}
.Font{
font-size: 20px;
}
.content ::v-deep .el-form-item{
margin-bottom:18px;
}
.pay_info{
span{
padding: 0 20px 0 0;
}
}
.accessclass{
width: 100%;
border: 1px solid #EBEEF5;
padding: 10px;
font-size: 14px;
}
</style>

491
Dialog/printingDialog.vue Normal file
View File

@ -0,0 +1,491 @@
<template>
<el-dialog
:visible.sync="dialogVisible"
width="70%"
top='5vh'
append-to-body
:close-on-click-modal = "false"
:before-close="handleClose"
>
<div class="main" id="printTest" ref="printTest">
<div class="header">
<span style="font-size: 30px; font-weight: bold">销售发货单</span>
</div>
<el-row :gutter="24">
<el-col :span="6">
<div class="body-text">
<span class="text">销售类型:</span>
<span class="text1">{{ aaa.operation_type }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">订单名称:</span>
<span class="text1"></span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">往来单位:</span>
<span class="text1">{{aaa.customer_id}}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">出仓仓库:</span>
<span class="text1"></span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">送货方式:</span>
<span class="text1"></span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">出库日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">收款状态:</span>
<span class="text1">{{ aaa.pay_status }}{{aaa.pay_channel ? `(${aaa.pay_channel})` : '' }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">单号:</span>
<span class="text1">{{id}}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">出库数量:</span>
<span class="text1">{{ tableData.length }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">操作员:</span>
<span class="text1">{{ aaa.salesman_id }}</span>
</div>
</el-col>
<!-- <el-col :span="6">
<div class="body-text">
<span class="text">订单备注:</span>
<span class="text1">{{ aaa.order_notes }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">客户:</span>
<span class="text1">{{ aaa.customer_id }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">快递单号:</span>
<span class="text1">{{ aaa.tracking_num }}</span>
</div>
</el-col>
<el-col :span="6">
<div class="body-text">
<span class="text">订单日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col> -->
</el-row>
<!--引入表格组件-->
<el-table border :data="tableData">
<el-table-column
v-for="(item, index) in tableLabel"
:key="index"
:property="item.param"
:label="item.label"
:formatter="item.formatter"
>
</el-table-column>
</el-table>
<div>
<table style="height: 40px;">
<tr>
<td class="text1">供应商:<span>{{ msg?msg.company:'' }}</span>>
</td>
<td class="text1">联系方式:{{msg?msg.phone:''}}</td>
<td class="text1">
发货地址:{{msg?msg.address:''}}
</td>
<td class="text1">总金额:{{ sumprice }}</td>
</tr>
<!-- <tr>
</tr> -->
</table>
</div>
<div class="footer">
<div class="fotter-top" >
<span class="footer-Toptext">{{msg?msg.company:''}},{{msg?msg.slogan:''}}</span>
<div class="fotter-main">
<span class="footer-maintext">感谢您选择爱果战壕ERP,我们将竭诚为您服务!!!</span>
<span style="margin-left:5px" class="footer-maintext">服务热线:{{msg?msg.tel:''}}</span>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="mini" @click="handleClose()"> </el-button>
<el-popover
@hide="hide"
title="扫描查看明细"
placement="top-start"
width="100"
trigger="click"
>
<div class="qrcode" ref="qrCodeUrl"></div>
<el-button class="btn" slot="reference" size="mini" style="margin:0 10px" @click="share()">分享</el-button>
</el-popover>
<el-button type="primary" size="mini" v-print="'#printTest'">确认打印</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import {pre_print} from "@/api/machineList"; //
import { op_order_details_code } from "@/api/Warehousing"; //
export default {
name: "printingDialog",
data() {
let that = this
const style = '@page { margin: 0 } @media print { zoom:100% }'//
return {
printobj:{
id:'#printTest',
popTitle:'打印',
style:style,
closeCallback(e){
that.$emit("update:dialogVisible", false);
}
},
tableLabel: [
{
label: "序号",
param: "Serial",
align: "center",
width: "100",
show: true,
},
{
label: "编号",
param: "serial_number",
align: "center",
renderheader: this.renderheader,
show: true,
},
{
label: "状态",
param: "op_status",
align: "center",
width: "150",
show: true,
},
{
label: "IMEI/SN",
input: true,
param: "imei1",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
},
{
label: "条形码",
input: true,
param: "customer_barcode",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
},
{
label: "型号",
param: "phone_brand",
align: "center",
show: true,
ortable: true,
formatter:(row)=>{
// console.log('33', row)
let obj = ''
obj = row.model_name+' '+row.rom_name+' '+row.color_name
return obj
}
},
{
label: "机器等级(成色)",
select: true,
param: "grade_list",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
formatter:(row)=>{
let obj = ''
this.jiqidata.map((res) => {
if(row.grade_list == res.value){
obj = res.label
}else{
return '/'
}
})
return obj
}
},
{
label: "价格",
input: true,
param: "price",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
{
label: "备注",
input: true,
param: "remark",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
],
};
},
computed:{
date() {
var date = new Date();
return date.toLocaleDateString();
},
sumprice() {
var price = 0;
this.tableData.map((res) => {
price += Number(res.price);
});
return price;
},
aaa(){
let obj = JSON.parse(JSON.stringify(this.formLabelAlign))
// console.log(obj,132)
for(let key in obj){
this.customer.map((res,index) => {
if (res.enName == key) {
if(Array.isArray(res.options)){
res.options.map(r=>{
if (obj[key] == r.value) {
obj[key] = r.label
}
})
}
}
})
// console.log('999', this.customer)
}
return obj
},
},
watch: {},
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false;
},
},
tableData: {
type: Array,
default: () => {
return [];
},
},
customer: {
type: Array,
default: () => {
return [];
},
},
msg: {
type:Object,
default:() => {
return {};
}
},
formLabelAlign: {
type: Object,
default: () => {
return {};
},
},
jiqidata: {
type: Array,
default: () => {
return [];
},
},
id: {
type: String,
default: () => {
return '';
},
},
},
methods: {
toImg() { //
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true,
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
handleClose() {
this.$emit("update:dialogVisible", false);
},
share() { //
op_order_details_code({order_op_id:this.id}).then((res) => {
// console.log('res', res)
var list = JSON.stringify(this.formLabelAlign)
var host = window.location.host;
var http = window.location.protocol
new QRCode(this.$refs.qrCodeUrl, {
// text:'https://erpv2.aiguovip.com/#/share/share?uuid='+res.datas.uuid,
text:`${http}`+'//'+`${host}/#/share?uuid=`+res.datas.uuid+'&formLabelAlign='+list,
width: 120,
height: 110,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L, //L/M/H
});
});
},
//
hide() {
this.$nextTick(function () {
this.$refs.qrCodeUrl.innerHTML = "";
});
},
},
};
</script>
<style lang="less" scoped>
.body {
display: flex;
flex-direction: column;
}
.body-text {
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
</style>

532
Dialog/printingDialog2.vue Normal file
View File

@ -0,0 +1,532 @@
<template>
<el-dialog
:visible.sync="dialogVisible"
width="100%"
fullscreen='true'
:show-close='false'
append-to-body
:close-on-click-modal = "false"
>
<div class="main" id="printTest" ref="printTest">
<div class="top">
<img style="margin-left: 20px;width:55px;height:100%" :src="msg.logo">
<div style="margin-left: 15px;display:flex;flex-direction:column">
<span class="top-text">{{msg.company}}</span>
<span class="top-text1">AppleCare Service or sales</span>
</div>
</div>
<div class="header">
<span style="font-size: 30px; font-weight: bold">销售发货单</span>
</div>
<el-row :gutter="24" style="display:flex;align-items: inherit;flex-wrap: wrap;justify-content: space-between;margin-left:0;margin-right:0;">
<el-col :span="6">
<div class="body-text">
<span class="text">销售类型:</span>
<span class="text1">{{ status(list.operation_type) }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">订单备注:</span>
<span class="text1">{{ list.order_notes }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">客户:</span>
<span class="text1">{{ customerid(list.customer_id) }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">收款状态:</span>
<span class="text1" v-if="list.pay_status==0">未结算</span>
<span class="text1" v-if="list.pay_status==1">已结算</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">快递单号:</span>
<span class="text1">{{ list.tracking_num }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">数量:</span>
<span class="text1">{{ tableData.length }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">订单日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col>
</el-row>
<!--引入表格组件-->
<div>
<table>
<tr>
<td class="text1">供应商:{{msg.company}}</td>
<td class="text1">联系方式:{{msg.phone}}</td>
</tr>
<tr>
<td class="text1">
发货地址:{{msg.address}}
</td>
<td class="text1">总金额:{{ sumprice }}</td>
</tr>
</table>
</div>
<el-table border :data="tableData">
<el-table-column
v-for="(item, index) in tableLabel"
:key="index"
:property="item.param"
:label="item.label"
:formatter="item.formatter"
>
</el-table-column>
</el-table>
<div class="footer">
<div class="fotter-top" >
<span class="footer-Toptext">{{msg.company}},{{msg.slogan}}</span>
</div>
<div class="fotter-main">
<span class="footer-maintext">感谢您选择爱果战壕ERP,我们将竭诚为您服务!!!</span>
<span style="margin-left:5px" class="footer-maintext">服务热线:{{msg.tel}}</span>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<!-- <el-button size="mini" @click="handleClose()"> </el-button> -->
<el-button type="primary" size="mini" style="margin:0 0px 0 10px" @click="toImg">确认打印</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import {pre_print} from "@/api/machineList"; //
export default {
name: "printingDialog",
data() {
let that = this
const style = '@page { margin: 0 } @media print { zoom:100% }'//
return {
printobj:{
id:'#printTest',
popTitle:'打印',
style:style,
closeCallback(e){
that.$emit("update:dialogVisible", false);
}
},
tableLabel: [
{
label: "序号",
param: "Serial",
align: "center",
width: "100",
show: true,
},
{
label: "编号",
param: "serial_number",
align: "center",
renderheader: this.renderheader,
show: true,
},
{
label: "状态",
param: "op_status",
align: "center",
width: "150",
show: true,
formatter: (row,column) => {
//           render: row => {
            if (row.op_status== 11) {
              return "待分拣";
            } else if (row.op_status == 12) {
              return "采购退货";
            } else if (row.op_status == 21) {
              return "现场维修中";
            } else if (row.op_status == 22) {
              return "寄修待回机";
            } else if (row.op_status == 23) {
              return "维修完成";
            } else if (row.op_status == 31) {
              return "销售";
            } else if (row.op_status == 32) {
              return "上架";
            } else if (row.op_status == 33) {
              return "铺货";
            } else if (row.op_status == 34) {
              return "销售退货(已收货)";
            } else if (row.op_status == 35) {
              return "下架";
            } else if (row.op_status == 36) {
              return "配件销售";
            } else if (row.op_status == 20) {
              return "待维修";
            } else if (row.op_status == 13) {
              return "质检中";
            } else if (row.op_status == 42) {
              return "销售退货(待收货)";
            } else if (row.instorage_type== 3) {
              return "代卖";
            } else if (row.op_status == 12) {
              return "采购退货";
            }
//          }
},
},
{
label: "IMEI/SN",
input: true,
param: "imei1",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
},
// {
// label: "",
// input: true,
// param: "customer_barcode",
// align: "center",
// renderheader: this.renderheader,
// show: true,
// ortable: true,
// },
{
label: "型号",
param: "phone_brand",
align: "center",
show: true,
ortable: true,
},
{
label: "机器等级(成色)",
select: true,
param: "grade_list",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
formatter:(row)=>{
let obj = ''
this.jiqidata.map((res) => {
if(row.grade_list == res.value){
obj = res.label
}else{
return '/'
}
})
return obj
}
},
{
label: "价格",
input: true,
param: "price",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
{
label: "备注",
input: true,
param: "remark",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
],
};
},
computed:{
status(){
return function(val){
switch(Number(val)){
case 1:return '销售';break;
case 2:return '上架';break;
case 3:return '铺货';break;
case 4:return '销售回填价格';break;
case 5:return '下架';break;
case 6:return '销售退货';break;
case 7:return '铺货退货';break;
case 8:return '翻库';break;
return val;
}
}
},
customerid(){
return function(val){
switch(Number(val)){
case 596:return '转转';break;
case 597:return '拍机堂';break;
case 598:return '采货侠';break;
}
return val;
}
},
date() {
var date = new Date();
return date.toLocaleDateString();
},
sumprice() {
var price = 0;
this.tableData.map((res) => {
price += Number(res.price);
});
return price;
},
aaa(){
let obj = this.tableData[0]
// let obj = JSON.parse(JSON.stringify(this.formLabelAlign))
// console.log(obj,132)
// for(let key in obj){
// this.customer.map((res,index) => {
// if (res.enName == key) {
// if(Array.isArray(res.options)){
// res.options.map(r=>{
// if (obj[key] == r.value) {
// obj[key] = r.label
// }
// })
// }
// }
// })
// console.log('999', this.customer)
// }
return obj
},
},
watch: {},
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false;
},
},
tableData: {
type: Array,
default: () => {
return [];
},
},
msg: {
type: Object,
default: () => {
return {};
},
},
customer: {
type: Array,
default: () => {
return [];
},
},
list: {
type: Array,
default: () => {
return [];
},
},
formLabelAlign: {
type: Object,
default: () => {
return {};
},
},
jiqidata: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
toImg() { //
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true,
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
handleClose() {
this.$emit("update:dialogVisible", false);
},
share() { //
this.$nextTick(function () {
pre_print().then((res) => {
new QRCode(this.$refs.qrCodeUrl, {
text: res.datas.url,
width: 120,
height: 110,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L, //L/M/H
});
});
});
},
//
hide() {
this.$nextTick(function () {
this.$refs.qrCodeUrl.innerHTML = "";
});
},
},
};
</script>
<style lang="less" scoped>
.body {
display: flex;
flex-direction: column;
}
.body-text {
display: flex;
flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: center;
align-items: center;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 17px;
}
.fotter-main{
display: flex;
background-color:#fff;
// height:30px;
justify-content: center;
flex-wrap: wrap;
}
.main ::deep .el-col-6{
margin-left: 0;
margin-right: 0;
}
.el-col-6{
width: 120px;
}
.el-row::before{
content: none;
}
@media screen and (max-width: 500px) {
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 20px;
text-align: center;
}
.text {
font-size: 18px;
font-weight: bold;
}
.text1 {
font-size: 14px;
}
::v-deep .el-dialog__body{
padding: 0px;
}
::v-deep .el-dialog__header{
padding: 0;
}
.footer-maintext{
font-family: STHeiti;
color:#4ca48c;
font-size: 14px;
}
}
@media screen and (min-width: 500px) {
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
}
.footer-maintext{
font-family: STHeiti;
color:#4ca48c;
font-size: 20px;
}
}
</style>

444
Dialog/printingDialog3.vue Normal file
View File

@ -0,0 +1,444 @@
<template>
<el-dialog
:visible.sync="dialogVisible"
width="100%"
fullscreen='true'
:show-close='false'
append-to-body
:close-on-click-modal = "false"
style="padding:0px"
>
<div class="main" id="printTest" ref="printTest">
<div class="top">
<img style="margin-left: 20px;width:55px;height:100%" :src="msg.logo">
<div style="margin-left: 15px;display:flex;flex-direction:column">
<span class="top-text">{{msg.company}}</span>
<span class="top-text1">AppleCare Service or sales</span>
</div>
</div>
<div class="header">
<span style="font-size: 30px; font-weight: bold">入库打印单</span>
</div>
<el-row :gutter="24" style="display:flex;align-items: inherit;flex-wrap: wrap;justify-content: space-between;margin-left:0;margin-right:0;">
<el-col :span="6">
<div class="body-text">
<span class="text">入库类型:</span>
<span class="text1">{{ status(list.warehousing_type) }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">客户:</span>
<span class="text1">{{ customerid(list.customer_id) }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">收款状态:</span>
<span class="text1" v-if="list.pay_status==0">未结算</span>
<span class="text1" v-if="list.pay_status==1">已结算</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">业务员:</span>
<span class="text1">{{ list.shop_name }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">数量:</span>
<span class="text1">{{ tableData.length }}</span>
</div>
</el-col>
<el-col :span="6" style="margin-left:0;margin-right:0;">
<div class="body-text">
<span class="text">订单日期:</span>
<span class="text1">{{ date }}</span>
</div>
</el-col>
</el-row>
<!--引入表格组件-->
<div>
<table>
<tr>
<td class="text1">供应商:{{msg.company}}</td>
<td class="text1">联系方式:{{msg.phone}}</td>
</tr>
<tr>
<td class="text1">
发货地址:{{msg.address}}
</td>
<td class="text1">总金额:{{ sumprice }}</td>
</tr>
</table>
</div>
<el-table border :data="tableData">
<el-table-column
v-for="(item, index) in tableLabel"
:key="index"
:property="item.param"
:label="item.label"
:formatter="item.formatter"
>
</el-table-column>
</el-table>
<div class="footer">
<div class="fotter-top" >
<span class="footer-Toptext">{{msg.company}},{{msg.slogan}}</span>
</div>
<div class="fotter-main">
<span class="footer-maintext">感谢您选择爱果战壕ERP,我们将竭诚为您服务!!!</span>
<span class="footer-maintext">服务热线:{{msg.tel}}</span>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<!-- <el-button size="mini" @click="handleClose()"> </el-button> -->
<el-button type="primary" size="mini" style="margin:0 0px 0 10px" @click="toImg">确认打印</el-button>
</span>
</el-dialog>
</template>
<script>
import html2canvas from 'html2canvas' // html2Canvasprint-js
import printJS from 'print-js'
import QRCode from 'qrcodejs2'
import {pre_print} from "@/api/machineList"; //
export default {
name: "printingDialog3",
data() {
let that = this
const style = '@page { margin: 0 } @media print { zoom:100% }'//
return {
printobj:{
id:'#printTest',
popTitle:'打印',
style:style,
closeCallback(e){
that.$emit("update:dialogVisible", false);
}
},
tableLabel: [
{
label: "序号",
param: "Serial",
align: "center",
width: "100",
show: true,
},
{
label: "编号",
param: "serial_number",
align: "center",
renderheader: this.renderheader,
show: true,
},
{
label: "IMEI/SN",
input: true,
param: "imei1",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true,
},
{
label: "型号",
param: "phone_brand",
align: "center",
show: true,
ortable: true,
},
{
label: "机器等级(成色)",
param: "machine_grade_name",
align: "center",
renderheader: this.renderheader,
show: true,
ortable: true
},
{
label: "价格",
input: true,
param: "price",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
{
label: "备注",
input: true,
param: "i_remark",
align: "center",
width: "100",
show: true,
renderheader: this.renderheader,
ortable: true,
},
],
};
},
created() {
// console.log(this.tableData)
},
computed:{
status(){
return function(val){
switch(Number(val)){
case 1:return '采购';break;
case 2:return '其他';break;
case 3:return '代卖';break;
return val;
}
}
},
customerid(){
return function(val){
switch(Number(val)){
case 596:return '转转';break;
case 597:return '拍机堂';break;
case 598:return '采货侠';break;
}
return val;
}
},
date() {
var date = new Date();
return date.toLocaleDateString();
},
sumprice() {
var price = 0;
this.tableData.map((res) => {
price += Number(res.price);
});
return price;
},
aaa(){
let obj = this.tableData[0]
return obj
},
},
watch: {},
props: {
dialogVisible: {
type: Boolean,
default: () => {
return false;
},
},
tableData: {
type: Array,
default: () => {
return [];
},
},
msg: {
type: Object,
default: () => {
return {};
},
},
customer: {
type: Array,
default: () => {
return [];
},
},
list: {
type: Array,
default: () => {
return [];
},
},
formLabelAlign: {
type: Object,
default: () => {
return {};
},
},
jiqidata: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
toImg() { //
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
html2canvas(this.$refs.printTest, {
backgroundColor: false,
useCORS: true,
allowTaint: true,
}).then((canvas) => {
const url = canvas.toDataURL()
this.img = url
printJS({
printable: url,
type: 'image',
documentTitle: '打印'
})
// console.log(url)
})
},
// handleClose() {
// this.$emit("update:dialogVisible", false);
// },
// share() { //
// this.$nextTick(function () {
// pre_print().then((res) => {
// new QRCode(this.$refs.qrCodeUrl, {
// text: res.datas.url,
// width: 120,
// height: 110,
// colorDark: "#333333", //
// colorLight: "#ffffff", //
// correctLevel: QRCode.CorrectLevel.L, //L/M/H
// });
// });
// });
// },
// //
// hide() {
// this.$nextTick(function () {
// this.$refs.qrCodeUrl.innerHTML = "";
// });
// },
},
};
</script>
<style lang="less" scoped>
.body {
display: flex;
flex-direction: column;
}
.body-text {
display: flex;
flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: center;
align-items: center;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 17px;
}
.fotter-main{
display: flex;
background-color:#fff;
// height:30px;
justify-content: center;
flex-wrap: wrap;
}
.main ::deep .el-col-6{
margin-left: 0;
margin-right: 0;
}
.el-col-6{
width: 120px;
}
.el-row::before{
content: none;
}
@media screen and (max-width: 500px) {
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 20px;
text-align: center;
}
.text {
font-size: 18px;
font-weight: bold;
}
.text1 {
font-size: 14px;
}
::v-deep .el-dialog__body{
padding: 0px;
}
::v-deep .el-dialog__header{
padding: 0;
}
.footer-maintext{
font-family: STHeiti;
color:#4ca48c;
font-size: 14px;
}
}
@media screen and (min-width: 500px) {
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
}
.footer-maintext{
font-family: STHeiti;
color:#4ca48c;
font-size: 20px;
}
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<div class="replenishmentOrder">
<el-dialog title="补订单" :visible="replenishmentOrderVisible" :label-position="labelPosition" width="30%"
@close="replenishmentOrderClose">
<el-form :model="replenishmentOrderForm" :rules="rules" ref="replenishmentOrderForm">
<el-form-item label="订单号" label-width="60px" prop="biz_order_id">
<el-input size="small" v-model="replenishmentOrderForm.biz_order_id" placeholder="订单号"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="replenishmentOrderClose" size="small"> </el-button>
<el-button type="primary" @click="replenishmentOrderConfirm('replenishmentOrderForm')" size="small">
</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
replenishmentOrderForm: {
biz_order_id: ''
},
labelPosition: 'right',
rules: {
biz_order_id: [
{ required: true, message: '请输入订单号', trigger: 'blur' }],
}
};
},
props: {
replenishmentOrderVisible: {
type: Boolean,
default: () => {
return false;
},
},
},
watch: {
},
methods: {
//
replenishmentOrderClose() {
this.$emit("replenishmentOrderClose", false);
this.clear()
},
//
replenishmentOrderConfirm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$emit("replenishmentOrderConfirm",this.replenishmentOrderForm.biz_order_id);
} else {
return false;
}
});
},
//
clear(){
this.replenishmentOrderForm.biz_order_id = ''
},
},
};
</script>
<style lang="scss" scoped>
.box {
display: flex;
justify-content: center;
}
</style>

2190
Dialog/saleDialog.vue Normal file

File diff suppressed because it is too large Load Diff

141
Dialog/settlementok.vue Normal file
View File

@ -0,0 +1,141 @@
<!--
* @Author: your name
* @Date: 2021-01-30 11:18:29
* @LastEditTime: 2021-05-06 16:49:33
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \aiguo_erp_vue\src\components\Dialog\addbrand.vue
-->
<template>
<div class="bodydialog">
<el-dialog
:visible.sync="settleshow"
:close-on-click-modal="false"
width="450px"
:before-close="handleClose"
>
<div style='width:100%;display:flex;flex-direction:column;'>
<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;">
<i class="el-icon-success" style="color:#7ed321;font-size: 45px;"></i>
<span style="font-weight: bold;font-size:20px">结算成功</span>
</div>
<h3 style="color:#d0021b;text-align:center">{{settleform.moneytext}}</h3>
<el-row>
<el-col :span="24">
<div class="items">
<span>用户:</span>
<span>{{settleform.user_info}}</span>
</div>
</el-col>
<el-col :span="24">
<div class="items">
<span>支付方式:</span>
<span>{{settleform.zftext}}( {{settleform.zfzh}})</span>
</div>
</el-col>
<el-col :span="24">
<div class="items">
<span>核销金额:</span>
<span>{{settleform.amount}}</span>
</div>
</el-col>
<el-col :span="24">
<div class="items">
<span>优惠金额:</span>
<span>{{settleform.discount_amount ? '-'+settleform.discount_amount :'/'}}</span>
</div>
</el-col>
<el-col :span="24">
<div class="items">
<span>手续费:</span>
<span>{{settleform.poundage ? settleform.poundage :'/'}}</span>
</div>
</el-col>
<el-col :span="24">
<div class="items">
<span>第三方交易号:</span>
<span>{{settleform.pay_three_id}}</span>
</div>
</el-col>
</el-row>
<div class="items">
<span style="font-size:18px">ERP交易流水号:</span>
<el-row >
<el-col v-for="(item,i) in settleform.zfdata" :key="i" >
{{item}}
</el-col>
</el-row>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose"> </el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "settlementok",
data() {
return {
};
},
props: {
settleshow: {
type: Boolean,
default: () => {
return false;
},
},
settleform: {
type: Object,
default: () => {
return {};
},
},
Input: {
type: Array,
default: () => {
return [];
},
},
ruleForm: {
type: Object,
default: () => {
return {};
},
},
rules: {
type: Object,
default: () => {
return {};
},
},
},
methods: {
handleClose() {
this.$emit("update:settleshow", false);
},
resetForm() {
this.$emit("update:settleshow", false);
},
},
};
</script>
<style lang="scss" scoped>
.bodydialog ::v-deep .el-dialog__footer{
text-align: center;
}
.items{
display:flex;
align-items:center;
justify-content:space-between;
margin-bottom: 5px;
span{
font-size: 18px;
}
}
</style>

667
Dialog/updateinfo.vue Normal file
View File

@ -0,0 +1,667 @@
<template>
<el-dialog
title="批量更新机器"
:visible.sync="upshow"
width="1200px"
top="2vh"
append-to-body
class="dialogclass"
:close-on-click-modal="false"
:before-close="handleClose"
>
<span>更新信息时仅对<span style="color:#ff6b81">非采购单</span>的机器生效并且<span style="color:#ff6b81">按照列表顺序</span>进行更新</span>
<div class="main" style="display:flex">
<div class="topclass">
<div>
<template>
<el-select v-model="imei_type" placeholder="请选择" size="small" style="margin-bottom:5px">
<el-option
v-for="item in [{label:'IMEI/IMEI2/SN',value:1},{label:'第三方条码',value:2},]"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
<el-input v-model="imei" type="textarea" :rows="8" :placeholder="imei_type ==1 ? '请输入IME/IME2/SN,换行表示一行一台机器865928061032740 865928061032740 865928061032740':'请输入第三方条码 一行一台机器'" />
</div>
<div>
<span>备注</span>
<el-input v-model="remark" size="small" placeholder="请输入内容" clearable @input="editchange(remark,'remarkall')" />
<el-input v-model="remarkall" type="textarea" :rows="6" placeholder="请输入内容" style="margin-top:10px" @input="editchange(remarkall,'remark')" />
</div>
<div>
<div>机器等级(成色)</div>
<el-select v-model="grade" style="width:100%" size="small" placeholder="请选择机器等级(成色)" clearable @input="editchange(grade,'gradeall')">
<el-option
v-for="item in grade_options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input v-model="gradeall" type="textarea" :rows="6" :placeholder="(grade_options && grade_options.length>0) ? '请输入机器等级(成色) 一行一台机器' : '暂无机器等级(成色)无法批量添加'" style="margin-top:10px" @input="editchange(gradeall,'grade')" />
</div>
</div>
<div style="margin-left: 20px;">
<div class="flex-b">
<div v-if="(formLabelAlign && formLabelAlign['warehousing_type'] == 1) || $route.name=='Createpurchaseorder'">
<span>价格</span>
<el-input v-model="price" size="small" placeholder="请输入内容" clearable @input=" price = AmountInput(price,2,'exceed');priceall=''" />
<el-input v-model="priceall" type="textarea" :rows="6" placeholder="请输入内容" style="margin-top:10px" @input="priceall = ssaa(priceall,2);price=''" />
</div>
<div v-if="formLabelAlign && formLabelAlign['warehousing_type'] == 2">
<span>参考价</span>
<el-input v-model="reference_price" size="small" placeholder="请输入参考价" clearable @input=" reference_price = AmountInput(reference_price,2,'exceed');reference_priceall=''" />
<el-input v-model="reference_priceall" type="textarea" :rows="6" placeholder="请输入价格 一行一台机器" style="margin-top:10px" @input="reference_priceall = ssaa(reference_priceall,2);reference_price=''" />
</div>
<div style="margin-left:10px">
<div>账号锁/密码</div>
<el-select v-model="idlock" style="width:100%" size="small" placeholder="请选择ID锁" clearable @input="editchange(idlock,'idlockall')">
<el-option
v-for="item in id_options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input v-model="idlockall" type="textarea" :rows="6" placeholder="请输入内容" style="margin-top:10px" @input="editchange(idlockall,'idlock')" />
</div>
</div>
<h3 style="font-weight: bold;">机器信息</h3>
<div v-if="bandshow==false">
<el-row :gutter="10">
<el-col :span="8">
<span>分类:</span>
<el-select v-model="form.cate_id" size="small" placeholder="请选择分类" filterable clearable @change="change(form.cate_id,'cate_id')">
<el-option v-for="(e,i) in cate_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-col>
<el-col :span="8">
<span>品牌:</span>
<el-select v-model="form.brand_id" size="small" placeholder="请选择品牌" filterable clearable @change="change(form.brand_id,'brand_id')">
<el-option v-for="(e,i) in brand_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-col>
<el-col :span="8">
<span>型号:</span>
<el-select v-model="form.model_id" size="small" placeholder="请选择型号" filterable clearable @change="change(form.model_id,'model_id')">
<el-option v-for="(e,i) in model_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-col>
</el-row>
<div v-if="!!form.model_id">
<div>
<h3 style="font-weight: bold;">容量</h3>
<div class="btnclass">
<el-button v-for="(v,index) in rom_options" :key="index" class="buttonDiv" plain :type="form.rom_id==v.value ? 'primary' :''" @click="romclick($event,v)">{{ v.label }}</el-button>
</div>
</div>
<h3 style="font-weight: bold;">颜色</h3>
<div style="display:flex;">
<div v-for="(v,index) in color_options" :key="index" style="display:flex;flex-direction:column;margin:0 5px;align-items: center;">
<el-popover
placement="right"
width="350"
trigger="click"
>
<el-image
v-if="v.img"
style="height: 350px"
:src="v.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<el-image
slot="reference"
style="height: 70px;width:70px"
:src="v.img"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
</el-popover>
<div class="btnclass">
<el-button plain class="buttonDiv" :type="form.color_id==v.value ? 'primary' :''" @click="colorclick($event,v)">{{ v.label }}</el-button>
</div>
</div>
</div>
</div>
</div>
<div v-else>
<span style="color:red">当前入库品牌存在2种及以上暂不支持批量更改机器信息</span>
</div>
<!-- 属性 -->
<div style="margin:10px 0">
<h3 style="font-weight: bold;">属性</h3>
<el-form :inline="true">
<el-form-item label="客户">
<el-select v-model="form.customer_id" size="small" placeholder="请选择客户" filterable clearable>
<el-option v-for="(e,i) in customer_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="报价师">
<el-select v-model="form.quote_user_id" size="small" placeholder="请选择报价师" filterable clearable>
<el-option v-for="(e,i) in quote_user_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="国别">
<el-select v-model="form.countries" size="small" placeholder="请选择国别" filterable clearable>
<el-option v-for="(e,i) in countries_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="网络制式">
<el-select v-model="form.network" size="small" placeholder="请选择网络制式" filterable clearable>
<el-option v-for="(e,i) in network_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
<el-form-item label="质检员">
<el-select v-model="form.op_user_id" size="small" placeholder="请选择质检员" filterable clearable>
<el-option v-for="(e,i) in op_user_options" :key="i" :label="e.label" :value="e.value" />
</el-select>
</el-form-item>
</el-form>
</div>
</div>
</div>
<!-- <span style="display: flex;justify-content: flex-end;align-items: center;margin-top: 50px;" >
<span style="margin-right:5px">机器是否开启查询功能 </span>
<el-switch v-model="warranty_query" active-color="#3498db" @change="warrantychange" :active-value="1" :inactive-value="2" ></el-switch>
</span> -->
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()"> </el-button>
<el-button type="primary" @click="addphone">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import { ai_model_update_v2, cate_brand_list_all, user_warranty_query } from '@/api/Warehousing' //
import { res_advanced_search } from '@/api/machineList' //
import { pre_print } from '@/api/machineList' //
import { op_order_details_code, cate_brand_list, edit_drafts_box, purchase_order_edit_phone, batch_save_drafts_box, batch_edit_drafts_box } from '@/api/Warehousing' //
import { mapGetters } from 'vuex'
import { uuid } from 'vue-uuid'
export default {
name: 'EditBrand',
data() {
return {
imei_type: 1,
number: '',
quote_user_id: null,
customer_id: null,
countries: null,
network: null,
imei: '',
price: '',
reference_price: '',
reference_priceall: '',
priceall: '',
idlock: '',
idlockall: '',
remark: '',
remarkall: '',
grade: '',
gradeall: '',
keywords: '',
warranty_query: 2,
form: { cate_id: null, brand_id: null, model_id: null, rom_id: null, color_id: null, op_user_id: '' },
grade_options: [],
cate_options: [],
brand_options: [],
model_options: [],
rom_options: [],
color_options: [],
customer_options: [],
op_user_options: [],
quote_user_options: [],
network_options: [],
countries_options: [//
{ label: '中国', value: '中国' },
{ label: '国行运营商', value: '国行运营商' },
{ label: '国行全网通', value: '国行全网通' },
{ label: '海外', value: '海外' },
{ label: '美版', value: '美版' },
{ label: '日本', value: '日本' },
{ label: '韩版', value: '韩版' },
{ label: '港澳台', value: '港澳台' },
{ label: '新加坡', value: '新加坡' },
{ label: '欧盟', value: '欧盟' },
{ label: '国际版', value: '国际版' }],
id_options: [
{ label: '有', value: '有' },
{ label: '无', value: '无' },
{ label: '未知', value: '未知' }],
current: [],
brandtotal: null,
modeltotal: null,
romtotal: null,
default_brand_id: null,
default_model_id: null
}
},
computed: {
...mapGetters([
'is_warranty_query', // 12
'user_id'
]),
bandshow() {
let flag = true
if (this.$parent.tableData.length > 0) {
const f = this.$parent.tableData[0].brand_name
flag = this.$parent.tableData.every(e => { return e == f })
}
return flag
}
},
watch: {
'is_warranty_query': {
handler(val) {
this.warranty_query = val
}, deep: true, immediate: true
}
},
created() {
this.getcate()
},
mounted() {
},
props: {
upshow: {
type: Boolean,
default: () => {
return false
}
},
is_purchase: {
type: Number,
default: () => {
return ''
}
},
tableData: {
type: Array,
default: () => {
return []
}
},
brandform: {
type: Object,
default: () => {
return {}
}
},
id: {
type: String,
default: () => {
return ''
}
},
input: {
type: Array,
default: () => {
return []
}
},
formLabelAlign: {
type: Object,
default: () => {
return {}
}
},
jiqidata: {
type: Array,
default: () => {
return []
}
}
},
methods: {
ssaa(val, limit = 0, exceed) { //
if (this._.isNumber(val)) { //
val = '' + val
}
// val = val.replace(/[^\d.]/g, ""); //
val = val.replace(/[^\r\n\d.]/g, '') //
val = val.replace(/^00/, '0.') // 0
val = val.replace(/^\./g, '0.') // 0.
val = val.replace(/\.{2,}/g, '.') //
val = val.replace(/(\d\.[\d]{0,2}).*([\s]*)/g, '$1$2'); //
/^0\d+/.test(val) ? val = val.slice(1) : '' // 0
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
const reg = new RegExp(str)
if (limit === 0) {
//
val = val.replace(reg, '$1')
} else {
//
val = val.replace(reg, '$1.$2')
}
if (!!exceed && Number(val) > 30000) {
Message({ duration: 4000, message: '输入价格已超过30000', type: 'warning', showClose: true })
}
return val
},
inputchange(queryString, callback) {
if (!!queryString && queryString.length >= 2) {
//
cate_brand_list({ keywords: queryString }).then((res) => {
callback(res.datas)
}).catch((error) => {
})
} else {
callback([])
}
},
//
warrantychange(e) {
user_warranty_query({ user_id: this.user_id, is_warranty_query: e }).then(res => {
this.$message({ type: 'success', message: e == 1 ? '查询已开启' : '查询已关闭' })
this.$store.dispatch('user/getInfo')
})
},
//
addphone() {
batch_edit_drafts_box({ imei_type: this.imei_type, imei_text: this.imei, pay_amount: this.priceall, all_pay_amount: this.price, id_lock: this.idlockall, all_id_lock: this.idlock,
remark: this.remarkall, all_remark: this.remark, level_name: this.gradeall, all_level_name: this.grade, reference_price: this.reference_price, reference_priceall: this.reference_priceall,
client_type: 2, is_purchase: this.is_purchase, ...this.form, drafts_box_id_arr: this._.uniq(this.$parent.tableData.map(e => { return e.id })) }).then(res => {
this.handleClose()
this.form = { cate_id: null, brand_id: null, model_id: null, rom_id: null, color_id: null, op_user_id: '' }
this.$parent.getlist()
})
},
editchange(change, name) {
if (change) {
this[name] = ''
}
},
getcate() {
cate_brand_list().then(res => {
this.current = [this.brandform.cate_id]
this.cate_options = res.datas.datas
})
res_advanced_search({ p_user_id: this.$parent.formLabelAlign.subsidiary }).then(e => {
this.quote_user_options = e.datas['quote_user_id']
this.customer_options = e.datas['supplier_info']
this.grade_options = e.datas['rk_grade_list']
this.network_options = e.datas['network']
this.op_user_options = e.datas['op_user_id']
})
},
getbrand(page) {
cate_brand_list({ cate_id: this.brandform.cate_id, list_row: 15, page: page, default_brand_id: this.default_brand_id }).then(res => {
this.brand_options = res.datas.datas
this.brandtotal = res.datas.total
})
},
getmodel(page) {
cate_brand_list({ cate_id: this.brandform.cate_id, list_row: 15, page: page, brand_id: this.brandform.brand_id, default_model_id: this.default_model_id, default_brand_id: this.default_brand_id }).then(res => {
this.model_options = res.datas.datas
this.modeltotal = res.datas.total
})
},
async handleSelect(data) {
this.brandform.cate_id = data.cate_id
this.brandform.brand_id = data.brand_id
this.default_brand_id = data.brand_id
this.default_model_id = data.model_id
this.brandform.model_id = data.model_id
this.brandform.rom_id = null
this.brandform.color_id = null
await this.getbrand()
await this.getmodel()
await this.getromcolor()
},
getromcolor(page) {
cate_brand_list({ cate_id: this.brandform.cate_id, list_row: 15, page: page, brand_id: this.brandform.brand_id, model_id: this.brandform.model_id, default_model_id: this.default_model_id, default_brand_id: this.default_brand_id }).then(res => {
this.rom_options = res.datas.datas['rom_list']
this.color_options = res.datas.datas['color_list']
this.romtotal = res.datas.total
})
},
editinfo() {
if (this.brandform.res_id) { //
purchase_order_edit_phone(this.brandform).then(res => {
this.$parent.getlist()
this.handleClose()
})
} else {
edit_drafts_box({ ...this.brandform, client_type: 2 }).then(res => {
this.$parent.getlist()
this.handleClose()
})
}
},
change(val, name) {
if (name == 'cate_id') {
this.form.brand_id = null
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: val }).then(res => {
this.brand_options = res.datas
})
} else {
this.brand_options = []
this.rom_options = []
this.color_options = []
}
} else if (name == 'brand_id') {
this.form.model_id = null
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: val }).then(res => {
this.model_options = res.datas
})
} else {
this.model_options = []
this.rom_options = []
this.color_options = []
}
} else {
this.form.rom_id = null
this.form.color_id = null
if (val) {
cate_brand_list_all({ cate_id: this.form.cate_id, brand_id: this.form.brand_id, model_id: val }).then(res => {
this.rom_options = res.datas['rom_list']
this.color_options = res.datas['color_list']
})
} else {
this.rom_options = []
this.color_options = []
}
}
},
brandclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.brandform.brand_id = v.value
this.getmodel()
},
modelclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.brandform.model_id = v.value
this.getromcolor()
},
romclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.rom_id = v.value
},
colorclick(e, v) {
let target = e.target
if (target.nodeName === 'SPAN') {
target = e.target.parentNode
}
target.blur()
this.form.color_id = v.value
},
currentchange(data) {
this.getbrand(data)
},
currentchange1(data) {
this.getmodel(data)
},
currentchange2(data) {
this.getromcolor(data)
},
handleClose() {
this.$emit('update:upshow', false)
}
}
}
</script>
<style lang="less" scoped>
.topclass{
display: flex;
flex-direction: column;
justify-content: space-between;
}
.bodyclass{
margin-top:10px;
display: flex;
height: 820px;
}
.bodyclass ::v-deep .el-button{
padding: 8px;
}
// .btnclass ::v-deep .el-button--primary:focus{
// margin-right: 12px;
// border-radius: 2px;
// box-shadow: 0 2px 4px 0 #f4f4f4;
// color: #2794f8;
// background: white;
// }
.btnclass ::v-deep .el-button--primary:hover{
border-radius: 2px;
color: #2794f8;
background: #d2e6fc;
border-color:#b3d8ff ;
}
.body {
display: flex;
flex-direction: column;
}
.body-text {
// display: flex;
// flex-direction: column;
margin-bottom: 15px;
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 25px;
}
.text {
font-size: 20px;
font-weight: bold;
}
.text1 {
font-size: 18px;
// height: 20px;
}
.calculation {
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
span {
padding: 0 10px;
display: inline-block;
}
}
table,td,th {
border: 1px solid #d4d4d4;
}
table {
border-collapse: collapse;
height: 100px;
width: 100%;
}
th {
height: 65px;
}
.top{
display: flex;
background-color:#4ca48c;
height:60px
}
.top-text{
font-family: STHeiti;
color: #fff;
font-size: 26px;
text-align: center;
}
.top-text1{
font-family: STHeiti;
color: #fff;
font-size: 12px;
}
.fotter-top{
display: flex;
background-color:#4ca48c;
height:60px;
justify-content: space-between;
align-items: center;
padding: 0 30px;
}
.footer-Toptext{
font-family: STHeiti;
color: #fff;
font-size: 24px;
}
.fotter-main{
display: flex;
// background-color:#fff;
height:30px;
justify-content: center;
}
.footer-maintext{
font-family: STHeiti;
color:#FFFFFF;
font-size: 20px;
}
.el-col-6{
width: 20%!important;
}
.level{
display: inline-block;
height: 20px;
line-height: 20px;
padding: 0 15px;
background: #ff633c;
border-radius: 12px;
font-size: 12px;;
font-weight: 500;
color: #fff;
cursor: pointer;
margin:0px 10px;
}
.paiclass{
height: 40px;
background: #f2f2f2;
display: flex;
font-size: 16px;
align-items: center;
}
</style>

148
Dialog/xyqualitydialog.vue Normal file
View File

@ -0,0 +1,148 @@
<template>
<div class="xylog">
<el-dialog
:title="
xylogtype == '0'
? '闲鱼质检报告'
: xylogtype == '2'
? '质检报告'
: '商品详情'
"
:visible.sync="xylogdialogVisible"
width="30%"
:before-close="handleClose"
>
<i
class="el-icon-document-copy"
style="cursor: pointer; color: #409eff; margin-right: 5px"
title="点击复制"
@click="copyLink($event, '0')"
>复制链接</i
>
<el-button type="text" @click="qrcode">查看二维码</el-button>
<iframe
style="width: 100%; "
:height="height"
:src="src"
allowfullscreen="allowfullscreen"
frameborder="0"
data-id="1"
></iframe>
<!-- <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="close"> </el-button>
</span> -->
<el-dialog
width="30%"
title="查看二维码"
:visible.sync="innerVisible"
append-to-body
:before-close="qrclose"
>
<div class="box">
<div ref="qrCodeUrl" class="qrcode" />
</div>
</el-dialog>
</el-dialog>
</div>
</template>
<script>
import QRCode from "qrcodejs2";
export default {
data() {
return {
src: ``,
innerVisible: false,
};
},
props: {
xylogdialogVisible: {
type: Boolean,
default: () => {
return false;
},
},
xylogid: {
default: () => {
return "";
},
},
xylogtype: {
default: () => {
return "";
},
},
},
computed: {
height() {
return document.documentElement.clientHeight - 400;
},
},
watch: {
xylogid(newval) {
if (this.xylogtype == "0") {
this.src = `https://www.aiguoerp.com/qc.html?id=${newval}`;
} else if (this.xylogtype == "1") {
this.src = `https://h5.m.goofish.com/item?id=${newval}`;
} else if (this.xylogtype == "2") {
this.src = `https://www.aiguoerp.com/qc1.html?business_id=${newval}`;
}
// this.src = `https://vant-contrib.gitee.io/vant/v2/mobile.html#/zh-CN/`
},
},
methods: {
handleClose() {
this.close();
},
close() {
this.$emit("xylogdialog", false);
},
//
copyLink(e) {
let text = this.src;
const clipboard = new this.clipboard(e.target, { text: () => text });
clipboard.on("success", (e) => {
this.$message({ type: "success", message: "复制成功" });
//
clipboard.off("error");
clipboard.off("success");
clipboard.destroy();
});
clipboard.on("error", (e) => {
//
this.$message({ type: "waning", message: "该浏览器不支持自动复制" });
//
clipboard.off("error");
clipboard.off("success");
clipboard.destroy();
});
clipboard.onClick(e);
},
qrcode() {
this.innerVisible = true;
console.log(this.src, "srcsrcsrcsrcsrc");
this.$nextTick(() => {
new QRCode(this.$refs.qrCodeUrl, {
text: this.src,
width: 120,
height: 110,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L, // L/M/H
});
});
},
qrclose() {
this.innerVisible = false;
this.$refs.qrCodeUrl.innerHTML = "";
},
},
};
</script>
<style lang="scss" scoped>
.box {
display: flex;
justify-content: center;
}
</style>

430
api/InventoryManagement.js Normal file
View File

@ -0,0 +1,430 @@
import request from './../utils/request'
// 审签图报表
export function approval_drawing_report(data) {
return request({
url: '/api/report/approval_drawing_report',
method: 'post',
data
})
}
// 导出excel接口
// export function approval_drawing_report(data) {
// return request({
// url: '/api/report/approval_drawing_report',
// method: 'post',
// data
// })
// }
// 查看借机记录
export function phone_move_list(data) {
return request({
url: '/api/phone_move/phone_move_list',
method: 'post',
data
})
}
export function model_statistical(data) {
return request({
url: '/api/console/model_statistical',
method: 'post',
data
})
}
/* 查看详情*/
export function model_statistical_detail(data) {
return request({
url: '/api/console/model_statistical_detail',
method: 'post',
data
})
}
/* 库存列表*/
export function location_storage_statistical(data) {
return request({
url: '/api/console/location_storage_statistical',
method: 'post',
data
})
}
/* 库存列表详情*/
export function model_storage_statistical(data) {
return request({
url: '/api/console/model_storage_statistical',
method: 'post',
data
})
}
/* 库存统计列表*/
export function inventory_statistic_list(data) {
return request({
url: '/api/statistic/inventory_statistic_list',
method: 'post',
data
})
}
/* 库存统计option*/
export function res_advanced_search(data) {
return request({
url: '/api/res/res_advanced_search',
method: 'post',
data
})
}
/* 品牌接口*/
export function cate_brand_list_in_stock(data) {
return request({
url: '/api/brand/cate_brand_list_in_stock',
method: 'post',
data
})
}
/* 盘库--质检员库存列*/
export function warehouse_list(data) {
return request({
url: '/api/make_inventory/warehouse_list',
method: 'post',
data
})
}
/* 历史盘库*/
export function history_make_inventory(data) {
return request({
url: '/api/make_inventory/history_make_inventory',
method: 'post',
data
})
}
/* 锁定库存*/
export function lock_inventory(data) {
return request({
url: '/api/make_inventory/lock_inventory',
method: 'post',
data
})
}
/* 新增盘库*/
export function add_inventory(data) {
return request({
url: '/api/make_inventory/add_inventory',
method: 'post',
data
})
}
/* 盘库详情*/
export function history_inventory_details(data) {
return request({
url: '/api/make_inventory/history_inventory_details',
method: 'post',
data
})
}
/* 开始录入机器*/
export function enter_phone(data) {
return request({
url: '/api/make_inventory/enter_phone',
method: 'post',
data
})
}
/* 盘库---保存*/
export function make_inventory_save(data) {
return request({
url: '/api/make_inventory/make_inventory_save',
method: 'post',
data
})
}
/* 盘库---缺少数量*/
export function lack_phone(data) {
return request({
url: '/api/make_inventory/lack_phone',
method: 'post',
data
})
}
/* 机器销售退货(待收货)列表*/
export function res_wait_receiving(data) {
return request({
url: '/api/res/res_wait_receiving',
method: 'post',
data
})
}
/* 销售退货(待收货)---批量收货*/
export function batch_receiving(data) {
return request({
url: '/api/res/batch_receiving',
method: 'post',
data
})
}
/* 机器待回机列表*/
export function res_wait_repair_back(data) {
return request({
url: '/api/res/res_wait_repair_back',
method: 'post',
data
})
}
/* 待出库列表/出库单*/
export function wait_out_storage(data) {
return request({
url: '/api/statistic/wait_out_storage',
method: 'post',
data
})
}
/* 待出库列表/出库单 详情*/
export function wait_out_storage_details(data) {
return request({
url: '/api/statistic/wait_out_storage_details',
method: 'post',
data
})
}
/* 出库单-详情*/
export function out_storage_details(data) {
return request({
url: '/api/statistic/out_storage_details',
method: 'post',
data
})
}
//待出库列表-详情
export function wait_storage_details(data) {
return request({
url: '/api/statistic/wait_storage_details',
method: 'post',
data
})
}
/* 出库工作台---获取机器*/
export function get_out_storage_imei(data) {
return request({
url: '/api/statistic/get_out_storage_imei',
method: 'post',
data
})
}
/* 确认出库*/
export function confirm_out_storage(data) {
return request({
url: '/api/statistic/confirm_out_storage',
method: 'post',
data
})
}
/* 手动出库---imei获取机器*/
export function out_batch_get_model(data) {
return request({
url: '/api/statistic/out_batch_get_model',
method: 'post',
data
})
}
/* 手动出库---批量出库*/
export function out_storage_batch(data) {
return request({
url: '/api/statistic/out_storage_batch',
method: 'post',
data
})
}
/* 调拨单*/
export function transfers_order_list(data) {
return request({
url: '/api/inspection/transfers_order_list',
method: 'post',
data
})
}
/* 分配调拨*/
export function distribute_transfers(data) {
return request({
url: '/api/inspection/distribute_transfers',
method: 'post',
data
})
}
/* 调拨记录*/
export function transfers_record_list(data) {
return request({
url: '/api/inspection/transfers_record_list',
method: 'post',
data
})
}
/* 仓管确认、取消调拨*/
export function transfers_order_confirm(data) {
return request({
url: '/api/inspection/transfers_order_confirm',
method: 'post',
data
})
}
/* 快递单号出库*/
export function out_storage_express_single(data) {
return request({
url: '/api/statistic/out_storage_express_single',
method: 'post',
data
})
}
/* 维修单列表*/
export function repair_order_list(data) {
return request({
url: '/api/repair/repair_order_list',
method: 'post',
data
})
}
/* 维修单详情*/
export function repair_order_details(data) {
return request({
url: '/api/repair/repair_order_details',
method: 'post',
data
})
}
/* 维修工作台---搜索imei*/
export function batch_get_model(data) {
return request({
url: '/api/repair/batch_get_model',
method: 'post',
data
})
}
/* 维修工作台---批量寄修*/
export function batch_repair(data) {
return request({
url: '/api/repair/batch_repair',
method: 'post',
data
})
}
/* 维修工作台---批量回机*/
export function batch_back(data) {
return request({
url: '/api/repair/batch_back',
method: 'post',
data
})
}
/* 维修工作台---批量返工*/
export function batch_rework(data) {
return request({
url: '/api/repair/batch_rework',
method: 'post',
data
})
}
/* 回机获取维修故障金额*/
export function repair_back_amount(data) {
return request({
url: '/api/repair/repair_back_amount',
method: 'post',
data
})
}
/* 批量回机获取维修故障金额*/
export function batch_repair_back_amount(data) {
return request({
url: '/api/repair/batch_repair_back_amount',
method: 'post',
data
})
}
/* 采购退货取消退货待收货列表*/
export function res_wait_purchase_refunds(data) {
return request({
url: '/api/res/res_wait_purchase_refunds',
method: 'post',
data
})
}
/* 采购取消退货---确认收货*/
export function purchase_confirm_goods(data) {
return request({
url: '/api/refunds/purchase_confirm_goods',
method: 'post',
data
})
}
/* 采购取消退货---确认收货*/
export function batch_sales_add(data) {
return request({
url: '/api/console/batch_get_model',
method: 'post',
data
})
}
/* 采购取消退货---确认收货*/
export function batch_operation_add(data) {
return request({
url: '/api/console/batch_operation_add',
method: 'post',
data
})
}
/* 采购申请退货批量操作---取消退货、确认退货---获取机器*/
export function get_imei(data) {
return request({
url: '/api/refunds/get_imei',
method: 'post',
data
})
}
/* 采购申请退货---批量取消*/
export function batch_cancel_refunds(data) {
return request({
url: '/api/refunds/batch_cancel_refunds',
method: 'post',
data
})
}
/* 采购申请退货---批量确认*/
export function batch_confirm_refunds(data) {
return request({
url: '/api/refunds/batch_confirm_refunds',
method: 'post',
data
})
}
/* 维修工作台---搜索imei---现场维修*/
export function batch_get_model_field_repair(data) {
return request({
url: '/api/repair/batch_get_model_field_repair',
method: 'post',
data
})
}
/* 批量正在维修*/
export function batch_repair_ing(data) {
return request({
url: '/api/repair/batch_repair_ing',
method: 'post',
data
})
}
/* 批量手动完成*/
export function batch_repair_ack(data) {
return request({
url: '/api/repair/batch_repair_ack',
method: 'post',
data
})
}

View File

@ -0,0 +1,115 @@
<template>
<div class="button-group" v-if="buttonlist || LightList">
<el-dropdown
v-if="LightList"
trigger="click"
@command="changeLight"
>
<el-button
size="small"
plain
v-loading="LightList.loading"
element-loading-spinner="el-icon-loading"
>
{{ command }}<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown" class="dropdown-menu">
<el-scrollbar wrap-class="scrollbar-wrap">
<el-dropdown-item
v-for="item in LightList.light"
:key="item.command"
:command="item.command"
>{{ item.label }}</el-dropdown-item
>
</el-scrollbar>
</el-dropdown-menu>
</el-dropdown>
<el-button
plain
size="small"
v-loading="item.loading"
element-loading-spinner="el-icon-loading"
@click="selectButton(item)"
v-show="item.show"
v-for="item in buttonlist"
:key="item.value"
>{{ item.label }}</el-button
>
</div>
</template>
<script>
export default {
props: ["buttonlist", "LightList"],
components: {},
data() {
return {
command: "批量亮灯",
};
},
methods: {
selectButton(item) {
if (item.loading) return;
switch (item.value) {
case 1:
this.$emit("BatchOffShelf"); //
break;
case 2:
this.$emit("BatchChange"); //
break;
case 3:
this.$emit("BatchPublish"); //
break;
case 4:
this.$emit("BatchRedlight", 4); //
break;
case 5:
this.$emit("BatchDelete"); //
break;
case 6:
this.$emit("SyncOrder"); //
break;
case 7:
this.$emit("BatchRepublish"); //
break;
case 8:
this.$emit("BatchAudited"); //
break;
case 9:
this.$emit("PrintPICK"); //
break;
case 10:
this.$emit("ScanDelivery"); //
break;
default:
break;
}
},
changeLight(e) {
if (this.LightList.loading) return;
this.LightList.light.forEach((item) => {
if (e === item.command) {
this.command = item.label;
}
});
this.$emit("changeLight", e);
},
},
};
</script>
<style scoped lang='scss'>
.button-group {
margin-left: 18px;
}
::v-deep .el-button {
margin-left: 0px !important;
margin-right: 10px;
}
::v-deep .el-loading-spinner {
top: 90%;
}
::v-deep .el-icon-loading {
font-size: 18px;
}
</style>

View File

@ -0,0 +1,140 @@
<template>
<div class="btnbox">
<div class="btnbox-l">
<ButtonGrop
:LightList="LightList"
:buttonlist="buttonlist"
@BatchChange="BatchChange"
@BatchOffShelf="BatchOffShelf"
@BatchRedlight="BatchRedlight"
@BatchPublish="BatchPublish"
@BatchDelete="BatchDelete"
@SyncOrder="SyncOrder"
@changeLight="changeLight"
@BatchRepublish="BatchRepublish"
@BatchAudited="BatchAudited"
@PrintPICK="PrintPICK"
@ScanDelivery="ScanDelivery"
></ButtonGrop>
</div>
<div class="btnbox-r">
<QC :qcList="qcList" @get_op_user_id="get_op_user_id"></QC>
<RefExp :loading="exploading" @exceldown="exceldown"></RefExp>
<SetUp
:tableLabel="tableLabel"
:columnconfigvisible="columnconfigvisible"
:columnOptions="columnOptions"
@columnConfigClose="columnConfigClose"
@columnCfgRest="columnCfgRest"
@columnConfigSubmit="columnConfigSubmit"
@columnCfgCheck="columnCfgCheck"
@columnCfgAllchange="columnCfgAllchange"
@columnconfigClick="columnconfigClick"
></SetUp>
</div>
</div>
</template>
<script>
import ButtonGrop from "./buttongrop";
import QC from "./qc.vue";
import RefExp from "./refexp";
import SetUp from "./setup";
export default {
components: { ButtonGrop, QC, RefExp, SetUp },
props: [
"buttonlist",
"qcList",
"exploading",
"columnconfigvisible",
"columnOptions",
"tableLabel",
"LightList",
],
data() {
return {};
},
methods: {
get_op_user_id(val) {
this.$emit("get_op_user_id", val);
},
exceldown() {
this.$emit("exceldown");
},
columnConfigClose(val) {
this.$emit("columnConfigClose", val);
},
columnCfgRest() {
this.$emit("columnCfgRest");
},
columnConfigSubmit(val) {
this.$emit("columnConfigSubmit", val);
},
columnCfgCheck(val) {
this.$emit("columnCfgCheck", val);
},
columnCfgAllchange(val) {
this.$emit("columnCfgAllchange", val);
},
columnconfigClick() {
this.$emit("columnconfigClick");
},
//
BatchChange() {
this.$emit("BatchChange");
},
//
BatchOffShelf() {
this.$emit("BatchOffShelf");
},
//
BatchPublish() {
this.$emit("BatchPublish");
},
//
BatchRedlight(val) {
this.$emit("BatchRedlight", val);
},
//
BatchDelete() {
this.$emit("BatchDelete");
},
//
SyncOrder() {
this.$emit("SyncOrder");
},
//
changeLight(val) {
this.$emit("changeLight", val);
},
//
BatchRepublish() {
this.$emit("BatchRepublish");
},
//
BatchAudited() {
this.$emit("BatchAudited");
},
//
PrintPICK() {
this.$emit("PrintPICK");
},
//
ScanDelivery() {
this.$emit("ScanDelivery");
},
},
};
</script>
<style scoped lang='scss'>
.btnbox {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px 0;
}
.btnbox-r {
display: flex;
}
</style>

View File

@ -0,0 +1,142 @@
<template>
<!-- 质检员 -->
<el-tooltip class="item" effect="dark" content="质检员设置" placement="top">
<el-popover
placement="bottom"
title="质检员设置"
width="260"
trigger="click"
v-model="visible"
>
<el-button
slot="reference"
icon="iconfont icon-zhijianyuanshezhi_fuzhi"
size="small"
class="btn"
></el-button>
<div class="content">
<el-checkbox
label="全选"
class="checkbox"
v-model="allcheckList"
@change="allchecked"
></el-checkbox>
<el-checkbox-group
v-model="checkList"
class="checkboxgroup"
@change="checked"
>
<el-checkbox
:label="item.value"
class="checkbox"
v-for="(item, index) in qcList"
:key="index"
>{{ item.label }}</el-checkbox
>
</el-checkbox-group>
<div class="btnbox">
<el-button size="mini" @click="reset">重置</el-button>
<el-button type="primary" size="mini" @click="comfirm"
>确定</el-button
>
</div>
</div>
</el-popover>
</el-tooltip>
</template>
<script>
export default {
props: ["qcList"],
data() {
return {
visible: false,
allcheckList: "", //
checkList: [], //v-model
};
},
components: {},
methods: {
//
allchecked(e) {
if (e) {
this.qcList.forEach((item) => {
this.checkList.push(item.value);
});
} else {
this.checkList = [];
}
},
//
checked(e) {
if (this.qcList.length == this.checkList.length) {
this.allcheckList = true;
} else {
this.allcheckList = false;
}
},
//
reset() {
this.checkList = [];
this.allcheckList = false;
},
//
comfirm() {
this.visible = false;
this.$emit("get_op_user_id", this.checkList);
},
},
};
</script>
<style scoped lang='scss'>
.btnbox {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 5px 0px 0;
.btn {
border: none;
font-size: 26px;
padding: 5px;
margin-left: 0;
background: #f1f2f5;
}
.el-popover__reference:focus,
.el-popover__reference:hover {
background: #e1e2e6;
color:#606266 ;
}
span {
margin: 0 5px;
}
}
.checkboxgroup {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
::v-deep .el-checkbox {
width: 100px;
margin-right: 0px;
}
.content {
width: 98%;
margin: 0 auto 0px;
}
::v-deep .el-popover__reference-wrapper::after{
content: "";
display: inline-block;
height: 13px;
border: 1px solid;
margin-left: 5px;
color: rgba(182, 181, 181, 0.753);
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<div>
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
<el-button
icon="iconfont icon-shuaxin"
size="small"
class="btn btn1"
@click="reload"
></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="导出" placement="top">
<el-button
v-loading="loading"
element-loading-spinner="el-icon-loading"
icon="iconfont icon-daochu1"
size="small"
class="btn btn2"
@click="exceldown"
></el-button>
</el-tooltip>
</div>
</template>
<script>
export default {
props: ["loading"],
data() {
return {};
},
components: {},
//
inject: ["reload"],
methods: {
exceldown() {
if (this.loading) return;
this.$emit("exceldown");
},
},
};
</script>
<style scoped lang='scss'>
$btn-color: #606266;
.btnbox {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 5px 0;
.btn {
border: none;
font-size: 26px;
padding: 5px;
margin-left: 0;
background: #f1f2f5;
}
.btn1,
.btn2 {
padding: 5px 10px;
}
.el-button:focus,
.el-button:hover {
background: #e1e2e6;
color: $btn-color;
}
span {
margin: 0 5px;
}
}
::v-deep .el-loading-mask {
height: 36px;
line-height: 41px;
top: 0px;
background-color: #f1f2f5;
.el-loading-spinner i {
font-size: 18px;
}
}
</style>

View File

@ -0,0 +1,351 @@
<template>
<el-tooltip class="item" effect="dark" content="列配置" placement="top">
<el-popover
placement="bottom"
title=""
trigger="manual"
v-model="columnconfigvisible"
>
<el-button
slot="reference"
icon="iconfont icon-liepeizhi"
size="small"
class="btn"
@click="columnconfigClick"
></el-button>
<div class="column">
<!-- <el-dialog :visible.sync="dialogVisible" width="50%" center :before-close="close" class="dialog"> -->
<div class="title">
<span class="titleTop">列配置</span>
<el-checkbox v-model="checkAll" @change="handleCheckAllChange">{{
checkAll ? "取消全选" : "全选"
}}</el-checkbox>
</div>
<div class="columnConfig">
<div class="left">
<el-checkbox-group
v-model="checkedColumnsCld"
@change="handleCheckedList"
>
<div class="itembox">
<div class="item" v-for="item in columnOptions" :key="item.id">
<el-checkbox :label="item.label" :disabled="item.disabled">{{
item.label
}}</el-checkbox>
</div>
</div>
</el-checkbox-group>
</div>
<div class="right">
<vuedraggable
:scroll="true"
animation="300"
v-model="newcolumnOptions"
@end="end"
:move="onMove"
filter=".holdings"
>
<transition-group>
<div
v-for="(field, index) in newcolumnOptions"
:key="index"
style="margin: 10px"
:class="field.disabled ? 'holdings' : 'canDragon'"
handle=".canDragon"
>
<i class="iconfont icontuozhuai" v-if="!field.disabled"></i>
{{ field.label }}
</div>
</transition-group>
</vuedraggable>
</div>
</div>
<div class="dialog-footer">
<div class="left">
<el-button
class="buttonLeft"
type="primary"
size="small"
plain
@click="recoverChecked"
>恢复默认</el-button
>
<el-button @click="cancel" size="small" class="buttonRight"
> </el-button
>
</div>
<div class="right">
<el-button
type="primary"
@click="submit"
size="small"
class="buttonRight"
> </el-button
>
</div>
</div>
<!-- </el-dialog> -->
</div>
</el-popover>
</el-tooltip>
</template>
<script>
import vuedraggable from "vuedraggable";
export default {
components: { vuedraggable },
props: {
dialogVisible: {
default: () => {
return false;
},
},
columnconfigvisible: {
default: () => {
return false;
},
},
//
tableLabel: {
default: () => {
return [];
},
},
//
columnOptions: {
default: () => {
return [];
},
},
},
data() {
return {
activeName: "fieldsChosen",
isIndeterminate: true,
checkAll: false,
// checkedColumnsCld: this.columnOptions,
checkedColumnsCld: [],
newcolumnOptions: this.columnOptions, //
fieldsTemp: [],
};
},
watch: {
columnOptions(newval) {
this.newcolumnOptions = newval;
},
},
computed: {
//()
defaultCheckItem() {
let result = this.columnOptions.map((item) => item.label);
return result;
},
},
created() {
//()
this.checkedColumnsCld = this.defaultCheckItem;
//
this.checkAll = true;
},
mounted() {},
methods: {
//
columnconfigClick() {
this.$emit("columnconfigClick");
},
submit() {
//
//this.fieldList
this.fieldsTemp = []; //fields
let n = 0;
this.newcolumnOptions.map((item) => {
for (let i = 0; i < this.tableLabel.length; i++) {
if (this.tableLabel[i].label == item.label) {
this.fieldsTemp[n++] = this.tableLabel[i];
}
}
});
// this.tableLabel = this.fieldsTemp;
//
this.$emit("columnConfigSubmit", this.fieldsTemp);
},
//
handleCheckAllChange(val) {
//
let result = this.columnOptions.filter((item) => item.disabled);
this.newcolumnOptions = val ? this.columnOptions : result;
this.checkedColumnsCld = val
? this.columnOptions.map((item) => item.label)
: result.map((item) => item.label);
this.$emit("columnCfgAllchange", this.newcolumnOptions);
// this.isIndeterminate = false;
},
//
handleCheckedList(val) {
//id
let result = this.columnOptions.filter((item) =>
val.includes(item.label)
);
console.log(result, "result-----------");
this.$emit("columnCfgCheck", result);
this.newcolumnOptions = result;
let checkedCount = result.length;
this.checkAll = checkedCount === this.columnOptions.length;
// this.isIndeterminate = checkedCount > 0 && checkedCount <script this.columnOptions.length;
},
//
recoverChecked() {
this.$emit("columnCfgRest");
this.newcolumnOptions = this.columnOptions;
this.checkedColumnsCld = this.defaultCheckItem;
},
//
cancel() {
this.$emit("columnConfigClose", false);
},
//
close() {
this.$emit("columnConfigClose", false);
},
//end
end(e) {
console.log(this.newcolumnOptions, "666---------------");
},
//
onMove(e) {
// console.log(e, 'onMove------------------', e.relatedContext.element);
if (e.relatedContext.element.disabled) return false;
return true;
},
},
deactivated() {
this.$emit("columnConfigClose", false);
},
};
</script>
<style scoped lang='scss'>
$btn-color: #606266;
.btnbox {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 5px 0px 0;
.btn {
border: none;
font-size: 26px;
padding: 5px;
margin-left: 0;
background: #f1f2f5;
}
.el-button:focus,
.el-button:hover {
background: #e1e2e6;
color: $btn-color;
}
span {
margin: 0 5px;
}
.checkboxgroup {
display: flex;
flex-wrap: wrap;
}
}
::v-deep .el-checkbox {
width: 70px;
}
.content {
width: 98%;
margin: 0 auto 0px;
}
.column {
.dialog {
}
.title {
padding-bottom: 10px;
::v-deep .el-checkbox__input {
opacity: 0;
}
::v-deep .el-checkbox__label {
color: #409eff;
}
.titleTop {
}
}
::v-deep .el-dialog--center {
text-align: left;
}
::v-deep .el-dialog__body {
min-height: 300px;
}
::v-deep .el-dialog--center .el-dialog__body {
padding-bottom: 0;
}
::v-deep .el-dialog__footer {
padding-top: 0;
}
.columnConfig {
max-width: 900px;
max-height: 40vh;
display: flex;
.left {
width: 65%;
.itembox {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
.item {
width: calc((100% - 10px) / 4);
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
color: #000;
}
}
}
}
.right {
width: 35%;
overflow-y: auto;
min-height: 300px;
border-left: 1px solid #e5e5e5;
max-height: 40vh;
/* 宽度和高度 */
&::-webkit-scrollbar {
width: 5px;
}
.holdings {
padding-left: 20px;
}
.canDragon {
cursor: move;
}
}
}
.dialog-footer {
display: flex;
justify-content: space-between;
border-top: 1px solid #e5e5e5;
padding-top: 10px;
}
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: your name
* @Date:
* @LastEditTime: 2024-2-22 10:18:11
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \aiguo_erp_vue\src\components\pagination\pagination.vue
-->
<template>
<div class="block">
<div style="display: flex;">
<span v-if="costVisible" style="font-weight: bold; padding-left:10px;width: 90px;">本页信息:</span>
<div v-if="costVisible" class="box">
<span style="padding: 0 10px" v-for="(item, index) in cost" :key="index">{{ item.text + item.value }}</span>
</div>
<div v-else></div>
</div>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="page.pageNum"
:page-sizes="page.pagesizes" layout="total, sizes, prev, pager, next, jumper" :total="page.total"
:page-size.sync="page.pageSize"></el-pagination>
</div>
</template>
<script>
export default {
name:"erpEltablePagination",
data() {
return {
Obj: {
list_row: this.page.pageSize,
},
};
},
props: {
currentPage4: {
type: Number,
},
page: {
type: Object,
default: () => {
return {};
},
},
costVisible: {
default: () => false
},
//
cost: {
default: () => []
}
},
methods: {
//
handleSizeChange(data) {
this.Obj.list_row = data;
this.$emit("handleSizeChange", this.Obj);
},
//
handleCurrentChange(data) {
this.Obj.page = data;
this.$emit("handleCurrentChange", this.Obj);
},
},
};
</script>
<style lang="scss" scoped>
.block {
height: 50px;
padding: 10px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
.box {
display: flex;
flex-wrap: wrap;
}
}
</style>

556
commontable/erpTable.vue Normal file
View File

@ -0,0 +1,556 @@
<template>
<div>
<vxe-table
ref="xTable"
:row-config="{ isHover: true }"
:data="newtableData"
:span-method="colspanMethod"
:height="height"
:checkbox-config="{
checkField: 'checked',
checkMethod: checCheckboxkMethod3,
visibleMethod: showCheckboxkMethod2,
}"
:header-cell-style="{
height: '70px',
color: '#606266',
'text-align': 'center',
}"
:scroll-y="{ enabled: false, gt: 10 }"
:loading="loading"
border
>
<vxe-column type="checkbox" width="50" :border="false"></vxe-column>
<vxe-column
v-for="(item, index) in tablelabel"
:key="index"
:visible="item.show"
:title="item.label"
:field="item.param"
:fixed="item.fixed"
:column-key="item.param"
:min-width="item.minwidth"
:filters="item.filters"
:sortable="item.sortable"
align="center"
>
<template slot-scope="{ row }">
<span v-if="row.render == true" class="firstspan">
<span v-if="row.business_id">质检码{{ row.business_id }}</span>
<span v-if="row.biz_order_id || row.order_sn"
>订单编号{{ row.biz_order_id || row.order_sn }}</span
>
<span v-if="row.publish_time"
>发布时间{{ row.publish_time }}</span
>
</span>
<span v-else-if="row.render == false">
<div v-if="item.label === '机器信息'" class="machineinfo">
<p>
{{ row.brand_name }} {{ row.model_name }} {{ row.rom_name }}
{{ row.color_name }}
</p>
<div class="info">
<div class="info-left">
<el-popover
v-if="row['img']"
placement="right"
width="375"
trigger="click"
>
<img
v-if="row['img']"
style="height: 350px"
:src="row['img']"
/>
<img
v-if="row['img']"
slot="reference"
style="float: left; height: 70px"
:src="row['img']"
/>
</el-popover>
<img
v-else
style="float: left; height: 70px"
src="../../assets/img/noimg.jpg"
/>
</div>
<ul class="info-right">
<li>
<span
v-if="item.link"
style="display: flex; align-items: center"
>
机器编号
<el-link
:underline="false"
type="primary"
@dblclick.native="jump(row, '机器编号')"
>{{ row.serial_number }}</el-link
>
</span>
<span v-else> 机器编号{{ row.serial_number }} </span>
</li>
<li>IMEI{{ row.imei1 }}</li>
<li>IMEI2{{ row.imei2 }}</li>
<li>SN:{{ row.sn }}</li>
</ul>
</div>
</div>
<span
v-else-if="
item.label === '机器状态' ||
item.label === '订单状态' ||
item.label === '商品状态'
"
>
<el-tag>{{ row[item.param] || "/" }}</el-tag>
</span>
<span v-else-if="item.label === '订单价格\n(利润)'">
<span style="display: block">{{ row.payment / 100 }}</span>
<span
:class="
row.payment / 100 - row.total_cost > 0 ? 'color' : 'green'
"
>{{
(row.payment / 100 - Number(row.total_cost)).toFixed(2)
}}</span
>
</span>
<span v-else-if="item.label == '质检报告'" class="look">
<el-link
:underline="false"
type="primary"
@click="lookquily(row, '0')"
>质检报告</el-link
>
<el-link
v-if="item.detailshow"
:underline="false"
type="primary"
@click="lookquily(row, '1')"
>商品详情</el-link
>
</span>
<span v-else-if="item.label == '预计结算价'">
<span :style="6 ? 'color:#ff6b81' : 'color:#2ed573'">{{
Number((row.price * 0.98) / 100).toFixed(2) +
"~" +
Number((row.price * 0.99) / 100).toFixed(2)
}}</span>
</span>
<span v-else-if="item.label == '预估利润'">
<span
:style="
Number(row.price / 100) - Number(row.total_cost) > 0
? 'color:#ff6b81'
: 'color:#2ed573'
"
>{{
(Number(row.price / 100) - Number(row.total_cost)).toFixed(2)
}}</span
>
</span>
<span
v-else-if="
item.label == '退款金额' ||
item.label == '申请退款金额' ||
item.label == '定价'
"
>
<span>{{ Number(row[item.param] / 100).toFixed(2) }}</span>
</span>
<span
v-else-if="
item.label == '交易成功时间' ||
item.label == '关闭时间' ||
item.label == '退款时间' ||
item.label == '订单创建时间' ||
item.label == '操作时间' ||
item.label == '付款时间'
"
>{{ row[item.param] | dateformat("YYYY-MM-DD HH:mm:ss") }}</span
>
<!-- 操作 -->
<span v-else-if="item.label === '操作'" class="operate">
<el-popconfirm
title="请确认?"
v-if="item.status.includes('Agree')"
@confirm="operate('Agree', row)"
>
<el-link slot="reference" type="primary" :underline="false"
>同意</el-link
>
</el-popconfirm>
<el-popconfirm
title="请确认驳回?"
v-if="item.status.includes('Reject')"
@confirm="operate('Reject', row)"
>
<el-link slot="reference" type="danger" :underline="false"
>驳回</el-link
>
</el-popconfirm>
<el-link
type="warning"
:underline="false"
v-if="item.status.includes('Logs')"
@click="operate('Logs', row)"
>日志</el-link
>
<el-link
type="danger"
:underline="false"
v-if="item.status.includes('OffShelf')"
@click="operate('OffShelf', row)"
>下架</el-link
>
</span>
<span v-else>
{{ row[item.param] ? row[item.param] : "-" }}
</span>
</span>
</template>
</vxe-column>
</vxe-table>
<xylog
:xylogdialog-visible="xylogdialogVisible"
:xylogid="xylogid"
:xylogtype="xylogtype"
@xylogdialog="xylogdialog"
/>
</div>
</template>
<script>
import Sortable from "sortablejs";
import xylog from "./Dialog/xyqualitydialog";
export default {
name:"erpTable",
components: {
xylog,
},
data() {
return {
xylogid: "",
xylogtype: "",
xylogdialogVisible: false,
};
},
props: {
tableDate: {
default: () => {
return [];
},
},
tablelabel: {
default: () => {
return [];
},
},
excelName: {
default: () => {
return "";
},
},
loading: {
default: () => {
return false;
},
},
tabbar: {
default: () => {
return false;
},
},
},
computed: {
newtableData() {
if (this.tableDate.length == 0) return;
let result = [];
const arr = this._.cloneDeep(this.tableDate);
result = arr.map((item) => [{ ...item }, { ...item }]).flat();
result.map((e, i) => {
if (i % 2 === 0) {
this.$set(e, "render", true);
this.$set(e, "checked", false);
} else {
this.$set(e, "render", false);
}
});
return result;
},
height() {
let height = "";
if (this.tabbar) {
height = document.documentElement.clientHeight - 235;
} else {
height = document.documentElement.clientHeight - 280;
}
return height;
},
tablelabelLen() {
let num = 0;
this.tablelabel.forEach((item) => {
if (item.show) {
num++;
}
});
return num;
},
},
mounted() {},
methods: {
colspanMethod({ _rowIndex, _columnIndex }) {
if (_rowIndex % 2 === 0) {
if (_columnIndex === 0) {
return { rowspan: 1, colspan: 1 };
} else if (_columnIndex === 1) {
return { rowspan: 1, colspan: this.tablelabelLen };
} else {
return { rowspan: 0, colspan: 0 };
}
}
},
checCheckboxkMethod3({ row }) {
return row.render == true;
},
showCheckboxkMethod2({ row }) {
return row.render == true;
},
//
tongyi(row) {
this.$emit("tongyi", row);
},
//
bohui(row) {
this.$emit("bohui", row);
},
//
jump(row, name) {
switch (name) {
case "机器编号":
this.$router.push({
name: "MachineDetails",
query: { row: row.res_id },
});
break;
default:
break;
}
},
//
operate(val, data) {
switch (val) {
case "Agree":
this.$emit("Agree", data);
break;
case "Reject":
this.$emit("Reject", data);
break;
case "OffShelf":
this.$emit("OffShelf", data);
break;
case "Logs":
this.$emit("looksLogs", data);
break;
default:
break;
}
},
//
lookquily(row, type) {
this.xylogdialogVisible = true;
if (type == "0") {
this.xylogtype = "0";
this.xylogid = row.id;
} else {
this.xylogtype = "1";
this.xylogid = row.item_id;
}
},
// dilog
xylogdialog(e) {
this.xylogdialogVisible = e;
},
// sortable
InitializeSortable() {
const sortableId = document.querySelector(
".vxe-table--header-wrapper tr"
);
this.sortable = Sortable.create(sortableId, {
//
onChoose: function (/**Event*/ evt) {
evt.oldIndex; // element index widthin parent
},
//
onStart: function (/**Event*/ evt) {
evt.oldIndex; // element index widthin parent
},
//
onEnd: function (/**Event*/ evt) {
var itemEl = evt.item; // dragged HTMLElement
evt.to; // target list
evt.from; // previous list
evt.oldIndex; // element's old index widthin old parent
evt.newIndex; // element's new index widthin new parent
evt.clone; // the clone element
evt.pullMode; // when item is in another sortable: `"clone"` if cloning, `true` if moving
},
//
onAdd: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onUpdate: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onSort: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onRemove: function (/**Event*/ evt) {
// same properties as onEnd
},
// filtered
onFilter: function (/**Event*/ evt) {
var itemEl = evt.item; // HTMLElement receiving the `mousedown|tapstart` event.
},
//
onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
// Example: https://jsbin.com/nawahef/edit?js,output
evt.dragged; // dragged HTMLElement
evt.draggedRect; // DOMRect {left, top, right, bottom}
evt.related; // HTMLElement on which have guided
evt.relatedRect; // DOMRect
evt.willInsertAfter; // Boolean that is true if Sortable will insert drag element after target by default
originalEvent.clientY; // mouse position
// return false; for cancel
// return -1; insert before target
// return 1; insert after target
},
// clone
onClone: function (/**Event*/ evt) {
var origEl = evt.item;
var cloneEl = evt.clone;
},
//
onChange: function (/**Event*/ evt) {
evt.newIndex; // most likely why this event is used is to get the dragging element's current index
// same properties as onEnd
},
});
},
//
columnDrop() {
const wrapperTr = document.querySelector(".vxe-table--header-wrapper tr");
this.sortable = Sortable.create(wrapperTr, {
animation: 180,
delay: 0,
onEnd: (evt) => {
console.log(evt, "evt-----------");
const oldItem = this.tablelabel[evt.oldIndex];
this.tablelabel.splice(evt.oldIndex, 1);
this.tablelabel.splice(evt.newIndex, 0, oldItem);
this.InitializeSortable();
},
});
},
scrollHeight() {
setTimeout(() => {
this.$refs.xTable.scrollTo(0, 0);
}, 500);
},
},
};
</script>
<style lang="scss" scoped>
.firstspan {
display: flex;
span {
margin-right: 20px;
}
}
.machineinfo {
text-align: left !important;
font-weight: 500;
p {
margin-bottom: 0px;
}
.info {
display: flex;
align-items: center;
margin-top: 5px;
.info-right {
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 0 0 15px;
}
}
}
.look {
display: flex;
flex-direction: column;
}
.operate {
display: flex;
flex-direction: column;
align-items: center;
span {
line-height: 20px;
}
}
::v-deep {
.vxe-table--body .vxe-cell--checkbox:nth-child(odd) :after {
content: "";
position: absolute;
top: 0px;
right: -5px;
display: inline-block;
width: 20px;
height: calc(100% - 1px);
background-color: #ffffff;
}
.vxe-body--row.row--hover {
.vxe-cell--checkbox:nth-child(odd) :after {
background-color: #f5f7fa;
}
}
/*调整表格 单元格背景颜色*/
.vxe-table .vxe-table--body-wrapper,
.vxe-table .vxe-table--footer-wrapper {
border: none;
background-color: rgba(255, 255, 255);
}
.vxe-cell--checkbox:nth-child(odd) {
display: flex;
align-items: center;
justify-content: center;
}
.vxe-body--row:nth-child(even) {
background-color: rgb(248 248 249);
}
}
</style>
<!-- <template #default="{ row }">
<div v-if="row.price && row.maoney">
<span
:class="row.price * 0.98 - row.maoney.total_fee / 1 - dateOne.total_cost / 1 > 0 ? 'red' : 'green'">{{
(
row.price * 0.98 - row.maoney.total_fee / 1 - dateOne.total_cost / 1).toFixed(2) }}</span>
<span class="red">~</span>
<span
:class="row.price * 0.99 - row.maoney.total_fee / 1 * 0.01 - dateOne.total_cost / 1 > 0 ? 'red' : 'green'">{{
(
row.price * 0.99 - row.maoney.total_fee / 1 - dateOne.total_cost / 1).toFixed(2) }}</span>
</div>
<div v-else>/</div>
</template> -->

1162
commontable/options.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,336 @@
<template>
<el-dialog
title="选择退货地址"
:visible.sync="AgreeReturnvisible"
width="800px"
custom-class="AgreeReturn"
:before-close="close"
>
<div>
<div v-if="AgreeReturndata.ag_site_management_id !== 76">
<div class="add" v-if="!addactive" @click="addadrdss">
<div class="name">
<span>新增地址</span>
</div>
<div class="addressinfo">
<span>________省</span>
<span>________市</span>
<span>________区</span>
</div>
</div>
<div class="add" v-else :class="{ active: addactive }">
<el-form :inline="true" :model="form" class="demo-form-inline">
<div class="top">
<el-form-item>
<el-input
class="input_w"
size="small"
v-model="form.consignee_name"
placeholder="请输入收货人姓名"
></el-input>
</el-form-item>
<el-form-item>
<el-input
class="input_w"
size="small"
v-model="form.mobile"
placeholder="请输入收货人电话"
></el-input>
</el-form-item>
</div>
<el-row :gutter="10" class="bottom">
<el-col v-for="item in inputAdd" :key="item.value" :span="4">
<el-form-item :prop="item.value">
<el-select
v-model="form[item.value]"
size="small"
:placeholder="`请选择${item.label}`"
@change="selectaddress(item.label)"
filterable
clearable
>
<el-option
v-for="items in item.options"
:key="items.value"
:label="items.label"
:value="items.value"
/></el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<el-input
size="small"
v-model="form.detail"
placeholder="请输入详细地址"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<div class="box">
<div
class="addredss-box"
:class="{ active: el.checked }"
v-for="(el, id) in addressDate"
:key="id"
@click="select(el)"
>
<div class="name">
<span>{{ el.consignee_name }}</span>
<span>{{ el.mobile }}</span>
</div>
<div class="addressinfo">
<span>{{ el.province }} </span>
<span>{{ el.city }} </span>
<span>{{ el.area }}</span>
<span>{{ el.town }}</span>
<span>{{ el.detail }}</span>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close" size="small"> </el-button>
<el-button type="primary" size="small" @click="confirm"> </el-button>
</span>
</el-dialog>
</template>
<script>
import {
get_after_sale_address,
administrative_division,
refund_after_sale,
} from "@/api/idleFish";
export default {
props: ["AgreeReturnvisible", "AgreeReturndata"],
components: {},
data() {
return {
province: [],
addressDate: [],
inputAdd: [
{
options: [],
label: "省",
value: "province",
placeholder: "请填写省",
},
{ options: [], label: "市", value: "city", placeholder: "请填写市" },
{ options: [], label: "区", value: "area", placeholder: "请填写区" },
],
checked: false, //
addactive: false, //
form: {
consignee_name: "",
mobile: "",
province: "",
city: "",
area: "",
town: "",
detail: "",
},
post_code: "",
};
},
created() {
this.getaddress();
this.getprovince();
},
methods: {
async getaddress() {
const res = await get_after_sale_address();
this.addressDate = res.datas;
},
async getprovince() {
const res = await administrative_division();
this.inputAdd.forEach((item) => {
if (item.value === "province") {
item.options = res.datas.map((item1) => {
return {
label: item1.province,
value: item1.province,
};
});
}
});
},
async selectaddress(row) {
if (row === "省") {
const res = await administrative_division({
province: this.form.province,
});
console.log(res);
this.inputAdd.forEach((item) => {
if (item.value === "city") {
item.options = res.datas.map((item1) => {
return {
label: item1.city,
value: item1.city,
};
});
}
});
} else if (row === "市") {
const res = await administrative_division({
province: this.form.province,
city: this.form.city,
});
console.log(res);
this.inputAdd.forEach((item) => {
if (item.value === "area") {
item.options = res.datas.map((item1) => {
return {
label: item1.area,
value: item1.area,
post_code: item1.city_id,
};
});
}
});
} else {
if (this.inputAdd && this.form.area) {
this.inputAdd.forEach((item) => {
if (item.options && item.options.some((items) => items.post_code)) {
let res = item.options.filter(
(item_) => item_.label === this.form.area
);
if (res.length > 0) {
this.post_code = res[0].post_code;
}
}
});
}
}
if (this.form.province === "") {
this.form.city = "";
this.form.area = "";
this.form.town = "";
this.form.detail = "";
} else if (this.form.city === "") {
this.form.area = "";
this.form.town = "";
this.form.detail = "";
}
},
close() {
this.$emit("closeAgreeReturn");
},
async confirm() {
this.form.post_code = this.post_code;
if (!this.form.town) {
this.form.town = "无";
}
const params = {
xy_sale_after_id: this.AgreeReturndata.id,
operation: "AGREE_RETURN",
address_detail: this.form,
};
const res = await refund_after_sale(params);
this.$emit("closeAgreeReturn");
},
select(data) {
this.addactive = false;
this.addressDate.forEach((el) => {
el.id == data.id
? this.$set(el, "checked", true)
: this.$set(el, "checked", false);
});
this.post_code = data.post_code; //使id
this.form = { ...data };
},
addadrdss() {
this.addactive = true;
this.addressDate.forEach((el) => {
this.$set(el, "checked", false);
});
},
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-dialog__body {
padding: 10px 20px 0 !important;
}
.addredss-box,
.add {
border-radius: 8px;
border: 1px solid #dcdfe6;
padding: 10px;
box-sizing: border-box;
margin-bottom: 10px;
.name {
color: #000;
font-weight: bold;
font-size: 16px;
span {
margin-right: 10px;
}
}
.addressinfo {
color: #606266;
font-weight: 400;
margin-top: 10px;
span {
margin-right: 5px;
}
}
}
.addredss-box:hover {
border: 1px solid #c0c4cc;
}
.active {
border: 1px solid #409eff;
}
.active:hover {
border: 1px solid #409eff;
}
.add {
display: flex;
flex-direction: column;
justify-content: center;
height: 110px;
cursor: pointer;
span {
color: #9e9fa1;
}
.addressinfo {
color: #9e9fa1;
}
}
::v-deep .el-form {
.top {
.el-form-item {
width: 177px;
margin-bottom: 0 !important;
.el-input {
width: 150px;
}
}
}
.bottom {
.el-form-item {
margin: 0 !important;
}
}
.el-input__inner {
border: none;
border-bottom: 1px solid #c0c4cc;
border-radius: 0px;
}
}
.box {
padding: 10px 10px 0px 10px;
height: 400px;
overflow-y: auto;
margin-bottom: 10px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<div class="dilog">
<el-dialog :visible.sync="BatchOffShelfvisible" :before-close="close">
<div class="img">
<img
src=" https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/erp_img/xianyu.png"
alt=""
/>
下架状态
</div>
<div v-if="BatchOffShelfsuccessdata.length">
下架成功{{ BatchOffShelfsuccessdata.length }}
</div>
<div v-else>
<div>下架失败{{ BatchOffShelfErrordata.length }}</div>
<el-table :data="BatchOffShelfErrordata" height="300px">
<el-table-column label="失败原因">
<template slot-scope="{ row }">
<span>
{{ row.msg }}
</span>
</template>
</el-table-column>
<!-- <el-table-column property="status" label="下架状态">
</el-table-column> -->
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="close"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
props: [
"BatchOffShelfvisible",
"BatchOffShelfsuccessdata",
"BatchOffShelfErrordata",
],
data() {
return {};
},
methods: {
close() {
this.$emit("Batchdialogclose");
},
},
mounted() {
console.log(this.BatchOffShelfErrordata, "this.BatchOffShelfData");
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-dialog__header {
padding: 0px !important;
}
::v-deep .el-dialog__body {
padding: 0px 30px 20px !important;
}
.img {
img {
width: 60px !important;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,115 @@
<template>
<div class="dilog">
<el-dialog
width="40%"
title="亮灯提示"
:visible.sync="Redlightvisible"
:before-close="close"
>
<el-table
:data="RedlightData"
height="300px"
@selection-change="handleSelectionChange"
header-cell-class-name="Redlight"
ref="multipleTable"
>
<el-table-column type="selection" width="55" :selectable="selectable">
</el-table-column>
<el-table-column property="imei1" label="IMEI/SN" width="150">
<template slot-scope="{ row }">
<span>
{{ row.imei1 || row.imei2 || row.sn }}
</span>
</template>
</el-table-column>
<el-table-column property="model_info" label="机器信息" width="280">
<template slot-scope="{ row }">
<span style="display: felx; align-items: center">
<el-popover placement="right" width="350" trigger="click">
<img
v-if="!!row['img'] || row['goods_img']"
style="height: 350px"
:src="row['img'] || row['goods_img']"
/>
<img
v-if="!!row['img'] || row['goods_img']"
slot="reference"
style="float: left; height: 50px"
:src="row['img'] || row['goods_img']"
/>
</el-popover>
{{
row["brand_name"] +
row["model_name"] +
+row["rom_name"] +
row["color_name"] || row["machine_name"]
}}
</span>
</template>
</el-table-column>
<el-table-column property="status" label="亮灯状态">
<template slot-scope="{ row }">
<span>
{{ row.tipsStatus == 0 ? "不在货架" : "成功" }}
</span>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="warning" @click="closeLight">关灯</el-button>
<el-button @click="quzou">已取走</el-button>
<el-button type="primary" @click="close"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
props: ["Redlightvisible", "RedlightData"],
data() {
return {
gridDataList: [],
};
},
methods: {
close() {
this.$emit("Batchdialogclose");
},
//
closeLight() {
this.$emit("tipCloseLight", this.gridDataList);
},
//
quzou() {
this.$emit("tipCloseLight", this.gridDataList, 1);
},
//
handleSelectionChange(e) {
this.gridDataList = e;
},
selectable(row, rowIndex) {
if (row.tipsStatus == 0) {
this.Redlight();
} else {
return true;
}
},
//
clearCheckboxRow() {
this.$refs.multipleTable.clearSelection();
},
Redlight() {
return "Redlight";
},
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-table .Redlight .cell .el-checkbox__inner {
//
display: none !important;
}
</style>

View File

@ -0,0 +1,68 @@
<template>
<!-- 机器日志 -->
<el-dialog
title="机器日志"
:visible.sync="logsvisible"
:before-close="close"
:close-on-click-modal="false"
>
<el-table
:data="logsList"
border
height="260px"
style="width: 100%"
v-loading="logsloading"
element-loading-text="加载中"
element-loading-spinner="el-icon-loading"
>
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="content" label="内容" min-width="180">
<template slot-scope="scope">
<span v-if="scope.row.content">
{{ scope.row.content }}
</span>
<span v-else-if="scope.row.log_content">
{{ scope.row.log_content }}
</span>
<span v-else>
{{ scope.row.content }}
</span>
</template>
</el-table-column>
<el-table-column prop="truename" label="操作人">
<template slot-scope="scope">
<span v-if="scope.row.truename">
{{ scope.row.truename }}({{ scope.row.username }})
</span>
<span v-else>
{{ scope.row.username }}
</span>
</template>
</el-table-column>
<el-table-column prop="add_time" label="操作时间" min-width="180" />
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="close"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: ["logsloading", "logsvisible", "logsList"],
data() {
return {};
},
components: {},
methods: {
//
close() {
this.$emit("logsclose");
},
},
};
</script>
<style scoped lang='scss'>
</style>

View File

@ -0,0 +1,90 @@
<template>
<!-- 手动下架 -->
<el-dialog
title="手动下架"
width="35%"
:visible.sync="OffShelfvisible"
:before-close="close"
>
<div>下架原因</div>
<div
v-loading="loading"
element-loading-text="加载中"
element-loading-spinner="el-icon-loading"
>
<el-radio-group v-model="params.OffShelfStatus" style="margin: 10px 0">
<el-radio
:label="item.value"
v-for="(item, index) in reasonList"
:key="index"
>{{ item.label }}</el-radio
>
</el-radio-group>
<el-input
v-model="params.otherReason"
placeholder="请输入内容"
v-if="params.OffShelfStatus == '3'"
></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { off_shelf_reason } from "@/api/providerList";
export default {
props: ["OffShelfvisible"],
data() {
return {
loading: true,
params: {
OffShelfStatus: "1",
otherReason: "", //
},
reasonList: [],
};
},
components: {},
mounted() {
this.getoffshelfreason();
},
methods: {
//
getoffshelfreason() {
this.loading = true;
off_shelf_reason().then((res) => {
this.loading = false;
this.reasonList = res.datas.off_shelf_type;
});
},
//
confirm() {
this.$emit("OffShelfconfirm", this.params);
},
//
close() {
this.$emit("OffShelfclose");
},
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-dialog__body {
padding-bottom: 0px !important;
}
.el-loading-mask {
display: flex;
align-items: center;
justify-content: center;
}
.el-radio-group {
min-height: 100px;
display: flex;
align-items: center;
flex-wrap: wrap;
}
</style>

View File

@ -0,0 +1,405 @@
<template>
<div>
<el-dialog
title="商品改价"
:visible.sync="ChangePricevisible"
:before-close="close"
>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="同sku调整到相同价" name="1">
<el-table
v-if="activeName == '1'"
border
:height="height"
:data="ChangePriceList"
:cell-style="{ 'text-align': 'left' }"
:header-cell-style="{
'text-align': 'center',
background: '#f9f9fa',
color: '#606266',
}"
>
<el-table-column width="380" label="商品信息">
<template #default="{ row }">
<div class="info">
<div class="img">
<img :src="row.product[0].img" alt="" />
</div>
<div>{{ row.sku }}</div>
</div>
</template>
</el-table-column>
<el-table-column width="110" label="修改定价" prop="price">
<template #default="{ row }">
<div class="input">
<el-input
v-model="row.money"
placeholder="输入定价"
size="small"
style="width: 90px"
/>
</div>
</template>
</el-table-column>
<el-table-column width="110" label="商品数量">
<template #default="{ row }">
<div
style="
display: flex;
justify-content: center;
align-items: center;
height: 100%;
"
>
{{ row.product.length }}
</div>
</template>
</el-table-column>
<el-table-column label="具体IMEI">
<template #default="{ row }">
<div
v-for="item in row.product"
:key="item.serial_number"
class="imeibox"
>
<div class="imeilist">
<span>IMEI:{{ item.imei1 }}</span>
<span>质检员:{{ item.check_name }}</span>
<span>当前定价:{{ item.price / 100 }}</span>
<span>机器总成本:{{ item.total_cost }}</span>
<span
v-if="!row.money"
:class="
item.price / 100 - item.total_cost > 0 ? 'red' : 'green'
"
>
预估利润:{{
(item.price / 100 - item.total_cost).toFixed(2)
}}</span
>
<span
v-else
:class="row.money - item.total_cost > 0 ? 'red' : 'green'"
>
预估利润:{{
(row.money - item.total_cost).toFixed(2)
}}</span
>
</div>
</div>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="所有IMEI统一调整固定金额" name="0">
<el-row>
<el-form ref="form" :model="form" :rules="rules">
<el-col :span="8">
<el-form-item prop="radio" label="调价方式">
<el-radio-group v-model="form.radio">
<el-radio :label="1">涨价</el-radio>
<el-radio :label="2">降价</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="调价值" prop="price">
<el-input
v-model="form.price"
size="small"
style="width: 160px"
/>
<el-link
style="margin-left: 8px"
:underline="false"
type="primary"
@click="submitMoney('form')"
>确定</el-link
>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="半个小时内是否调过价">
<el-select v-model="value" size="small" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col> -->
</el-form>
</el-row>
<el-table
v-if="activeName == '0'"
border
:height="height"
:data="ChangePriceList"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{
'text-align': 'center',
background: '#f9f9fa',
color: '#606266',
}"
>
<el-table-column width="380" label="商品信息">
<template #default="{ row }">
<div class="info">
<div class="img"><img :src="row.img" alt="" /></div>
<div>
{{ row.sku ? row.sku : row.title }} {{ row.use_trace }}
{{ row.use_desc }}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="IMEI" prop="imei1" />
<el-table-column label="商品定价">
<template #default="{ row }">
<div>当前定价{{ row.price / 100 }}</div>
<div
v-if="!row.money"
:class="
row.price / 100 - row.total_cost > 0 ? 'red' : 'green'
"
>
预估利润{{ (row.price / 100 - row.total_cost).toFixed(2) }}
</div>
<div
v-else
:class="row.money - row.total_cost > 0 ? 'red' : 'green'"
>
预估利润{{ (row.money - row.total_cost).toFixed(2) }}
</div>
<div class="input">
<el-input
v-model="row.money"
placeholder="输入定价"
size="small"
style="width: 90px"
/>
</div>
</template>
</el-table-column>
<el-table-column label="机器总成本">
<template #default="{ row }">
<div>
{{ row.total_cost }}
</div>
</template>
</el-table-column>
<el-table-column label="上次调价时间" />
</el-table>
</el-tab-pane>
</el-tabs>
<div style="margin-top: 20px; text-align: right">
<el-button size="small" @click="close">取消</el-button>
<el-button size="small" type="primary" @click="submit">确定</el-button>
</div>
</el-dialog>
<!-- 改价结果 -->
<el-dialog :visible.sync="successvisible" :before-close="close" title="改价结果">
<span v-if="errorList.length == 0">无改价失败机器</span>
<span v-else
>共有{{ errorList.length }}台机器改价失败请检查错误原因</span
>
<el-table
border
:data="errorList"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{
'text-align': 'center',
background: '#f9f9fa',
color: '#606266',
}"
>
<el-table-column label="质检码" prop="business_id" />
<el-table-column label="商品码" prop="item_id" />
<el-table-column label="错误信息" prop="msg" />
</el-table>
<div style="margin-top: 20px">
<span style="color: green; margin-right: 9px"
><i class="el-icon-success" /> 共有{{
successList.length
}}台机器改价成功</span
>
<el-link type="primary" :underline="false" @click="successStatus = true"
>查看更多</el-link
>
</div>
<el-table
v-if="successStatus"
style="margin-top: 20px"
border
:height="successheight"
:data="successList"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{
'text-align': 'center',
background: '#f9f9fa',
color: '#606266',
}"
>
<el-table-column prop="business_id" label="质检码" />
<el-table-column prop="item_id" label="商品码" />
<el-table-column prop="msg" label="信息" />
</el-table>
<div style="margin-top: 20px; text-align: right">
<el-button @click="close">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
props: [
"ChangePricevisible",
"successvisible",
"ChangePriceList",
"errorList",
"successList",
],
data() {
return {
activeName: "1",
value: "",
rules: {
radio: [
{ required: true, message: "请选择调价方式", trigger: "change" },
],
price: [
{ required: true, message: "请输入调价值", trigger: "blur" },
{ validator: this.validateAge, trigger: "blur" },
],
},
options: [
{
value: "0",
label: "是",
},
{
value: "1",
label: "否",
},
],
form: {
radio: "",
price: "",
},
successStatus: false,
};
},
components: {},
computed: {
height() {
return document.documentElement.clientHeight - 500;
},
successheight(){
return document.documentElement.clientHeight - 700;
}
},
created() {},
methods: {
async handleClick(tab, event) {
this.$emit("getPricelist", null, this.activeName);
},
close() {
this.successStatus = false;
this.$emit("ChangePriceclose");
},
submit() {
const params = [];
if (this.activeName == "1") {
this.ChangePriceList.forEach((item) => {
if (item.money) {
item.product.forEach((el) => {
params.push({
xy_product_id: el.id,
price: item.money * 100,
});
});
this.$emit("submitprice", params);
} else {
this.$message.warning("请输入价格");
}
});
} else {
this.$refs["form"].validate(async (valid) => {
if (!valid) return;
this.ChangePriceList.forEach((item) => {
params.push({
xy_product_id: item.id,
price: item.money * 100,
});
});
this.$emit("submitprice", params);
});
}
},
submitMoney() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.ChangePriceList.forEach((item) => {
if (this.form.radio === 1) {
this.$set(
item,
"money",
item.price / 100 + Number(this.form.price)
);
} else {
this.$set(
item,
"money",
item.price / 100 - Number(this.form.price)
);
}
});
} else {
return false;
}
});
},
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-dialog {
width: 55% !important;
}
.info {
display: flex;
img {
width: 100px;
}
div {
text-align: left;
}
}
::v-deep .input {
text-align: center;
.el-input__inner {
border: none !important;
}
}
.imeibox {
display: flex;
.imeilist {
padding: 0 10px;
span {
margin-right: 10px;
}
}
}
@media screen and (max-width: 1920px) {
::v-deep .el-dialog {
width: 70% !important;
}
}
</style>

View File

@ -0,0 +1,108 @@
<template>
<el-dialog
title="审核驳回"
:visible.sync="RejectVisible"
width="30%"
:before-close="close"
>
<div>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
label-position="top"
>
<el-form-item label="驳回原因" prop="reject_reason">
<el-select
v-model="ruleForm.reject_reason"
placeholder="请选择驳回原因"
size="small"
>
<el-option
v-for="(item, index) in RejectReason"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="说明">
<el-input
type="textarea"
:rows="5"
v-model="ruleForm.reject_explain"
></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close" size="small"> </el-button>
<el-button type="primary" size="small" @click="confirm"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
RejectVisible: {
type: Boolean,
default: () => {
return false;
},
},
RejectReason: {
type: Array,
default: () => {
return [];
},
},
},
components: {},
data() {
return {
ruleForm: {
reject_reason: "",
reject_explain: "",
},
rules: {
reject_reason: [
{ required: true, message: "请选择原因", trigger: "blur" },
],
},
};
},
methods: {
close() {
this.$emit("RejectDialogClose");
},
confirm() {
this.$refs.ruleForm.validate((valid) => {
if (!valid) return;
this.$emit("RejectDialogcnfirm", this.ruleForm);
});
},
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-form-item {
margin-bottom: 5px !important;
}
::v-deep .el-form-item__label {
font-size: 14px;
font-weight: normal;
padding: 0px !important;
}
::v-deep .el-dialog__title {
font-weight: bold;
}
::v-deep .el-dialog__body {
padding: 0 20px 20px;
}
::v-deep .el-form-item__error {
padding-top: 0px;
}
</style>

View File

@ -0,0 +1,62 @@
<template>
<div class="dilog">
<el-dialog :visible.sync="Resultvisible" :before-close="close">
<div class="img">
<img
src=" https://aiguovip2020.oss-cn-shenzhen.aliyuncs.com/erp_img/xianyu.png"
alt=""
/>
{{ResultTitle}}
</div>
<el-table :data="ResultData" height="300px">
<el-table-column property="business_id" label="质检码" width="150">
<template slot-scope="{ row }">
<span>
{{ row.business_id }}
</span>
</template>
</el-table-column>
<el-table-column property="status" label="状态">
<template slot-scope="{ row }">
<span>
{{ row.msg ? row.msg : "成功" }}
</span>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="close"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
props: ["ResultTitle","Resultvisible", "ResultData"],
data() {
return {};
},
methods: {
close() {
this.$emit("Batchdialogclose");
},
},
};
</script>
<style scoped lang='scss'>
::v-deep .el-dialog__header {
padding: 0px !important;
}
::v-deep .el-dialog__body {
padding: 0px 30px 20px !important;
}
.img {
img {
width: 60px !important;
}
}
</style>

View File

@ -0,0 +1,84 @@
<template>
<div class="calculation">
<div>
<span style="font-weight: bold; padding: 0 10px">本页信息:</span>
<span style="padding: 0 10px">总定价:{{ total_cost }}</span>
</div>
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="page.page"
:page-sizes="page.pagesizes"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
:page-size.sync="page.list_row"
></el-pagination>
</div>
</div>
</template>
<script>
import { add } from "./../utils/Decimal";
export default {
name:"erpTablePagination",
props: {
currentPage4: {
type: Number,
},
page: {
type: Object,
default: () => {
return {};
},
},
tableData: {
default: () => {
return [];
},
},
},
components: {},
data() {
return {};
},
computed: {
//
total_cost: function () {
let priceNumber = 0;
this.tableData.map((res, index) => {
priceNumber = add(priceNumber, res.total_cost);
});
return priceNumber.toFixed(2);
},
},
methods: {
//
handleSizeChange() {
this.$emit("handleSizeChange");
},
//
handleCurrentChange() {
this.$emit("gettbdata");
},
},
};
</script>
<style scoped lang='scss'>
.calculation {
height: 50px;
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
::v-deep .el-pagination .el-input__suffix {
right: -18px;
}
}
</style>

73
commontable/tabletabs.vue Normal file
View File

@ -0,0 +1,73 @@
<template>
<div class="toptabs">
<el-tabs v-model="active" @tab-click="tabclick(active)">
<el-tab-pane
v-for="(item, index) in tabs"
:key="index"
:name="item.value"
>
<span slot="label"
>{{ item.label }}
<i v-if="item.total && active == item.value" class="icon">{{
item.total
}}</i></span
>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
export default {
name:"erpTableTabs",
props: {
tabs: {
type: Array,
default: () => {
return [];
},
},
activeName: {
type: String,
default: () => {
return "0";
},
},
},
data() {
return {
active: this.activeName,
};
},
components: {},
methods: {
tabclick(val) {
this.$emit("tabclick", val);
},
reset() {
this.$set(this, "activeName", "0");
},
changeActiveName(val){
this.activeName = val;
},
},
};
</script>
<style scoped lang='scss'>
.toptabs {
padding: 0 20px;
background: #fff;
::v-deep .el-tabs__header {
margin: 0;
}
}
::v-deep .el-tabs__nav {
height: 45px;
line-height: 45px;
}
.icon {
font-style: normal;
}
</style>

686
commontable/xyTable.vue Normal file
View File

@ -0,0 +1,686 @@
<template>
<div>
<vxe-table ref="xTable" :row-config="{ isHover: true }" :data="newtableData" :span-method="colspanMethod"
:height="height" :checkbox-config="{
checkField: 'checked',
checkMethod: checCheckboxkMethod3,
visibleMethod: showCheckboxkMethod2,
}" :header-cell-style="{
height: '70px',
color: '#606266',
'text-align': 'center',
}" :scroll-y="{ enabled: false, gt: 10 }" :loading="loading" border @checkbox-change="selectEvent"
@checkbox-all="selectAllEvent">
<vxe-column type="checkbox" width="50" :border="false"></vxe-column>
<vxe-column v-for="(item, index) in tablelabel" :key="index" :visible="item.show" :title="item.label"
:field="item.param" :fixed="item.fixed" :column-key="item.param" :min-width="item.minwidth"
:filters="item.filters" :sortable="item.sortable" :show-overflow="item.remarkshow" align="center">
<!-- <template
v-if="
item.label == '预计结算价'
"
v-slot:header="{ column, rowIndex }"
>
<span>{{ item.label }}</span>
<el-tooltip
class="item"
effect="dark"
content="点击批量修改"
placement="top-start"
>
<i
class="el-icon-document-copy"
style=" margin-left: 5px; cursor: pointer"
/>
</el-tooltip>
</template> -->
<template slot-scope="{ row }">
<span v-if="row.render" class="firstspan">
<span v-if="row.business_id">
<span v-if="item.link" style="display: flex; align-items: center">
质检码
<el-link :underline="false" type="primary" @dblclick.native="jump(row, '质检码')">{{ row.business_id
}}</el-link>
</span>
<!-- <span v-else-if="item.isdetail" style="display: flex; align-items: center">
质检码
<el-link :underline="false" type="primary" @dblclick.native="jump(row, '审核页')">{{ row.business_id
}}</el-link>
</span> -->
<span v-else> 质检码{{ row.business_id }} </span>
</span>
<span v-if="row.biz_order_id">订单编号{{ row.biz_order_id }}</span>
<span v-if="row.refund_id">售后订单编号{{ row.refund_id }}</span>
<span v-if="
row.publish_time && /^\d{10}$|^\d{13}$/.test(row.publish_time)
">发布时间{{
row.publish_time | dateformat("YYYY-MM-DD HH:mm:ss")
}}</span>
<span v-if="row.last_truename">最近翻库人{{ row.last_truename }}</span>
<span v-if="row.last_publish_time">最近翻库日期{{
row.last_publish_time | dateformat("YYYY-MM-DD HH:mm:ss")
}}</span>
<span v-if="row.buyer_nick">买家昵称{{ row.buyer_nick }}</span>
</span>
<span v-else-if="!row.render">
<div v-if="item.label === '机器信息'" class="machineinfo">
<p>
{{ row.brand_name }} {{ row.model_name }} {{ row.rom_name }}
{{ row.color_name }}
</p>
<div class="info">
<div class="info-left">
<el-popover v-if="row['img']" placement="right" width="375" trigger="click">
<img v-if="row['img']" style="height: 350px" :src="row['img']" />
<img v-if="row['img']" slot="reference" style="float: left; height: 70px" :src="row['img']" />
</el-popover>
<img v-else style="float: left; height: 70px" src="../../assets/img/noimg.jpg" />
</div>
<ul class="info-right">
<li>
<span v-if="item.link" style="display: flex; align-items: center">
机器编号
<el-link :underline="false" type="primary" @dblclick.native="jump(row, '机器编号')">{{
row.serial_number }}</el-link>
</span>
<span v-else> 机器编号{{ row.serial_number }} </span>
</li>
<li>IMEI{{ row.imei1 }}</li>
<li>IMEI2{{ row.imei2 }}</li>
<li>SN:{{ row.sn }}</li>
</ul>
</div>
</div>
<span v-else-if="item.label === '机器成色'">
{{
Number(row.stuff_status) > 0
? row.stuff_status + "新"
: row.stuff_status
}}
</span>
<span v-else-if="
item.label === '机器状态' ||
item.label === '订单状态' ||
item.label === '商品状态' ||
item.label === '售后状态'
">
<el-tag>{{ row[item.param] || "/" }}</el-tag>
</span>
<span v-else-if="item.label === '订单价格\n(利润)'">
<span style="display: block">{{ row.payment / 100 }}</span>
<span :class="row.payment / 100 - row.total_cost > 0 ? 'red' : 'green'
">{{
(row.payment / 100 - Number(row.total_cost)).toFixed(2)
}}</span>
</span>
<span v-else-if="item.label == '质检报告'" class="look">
<el-link :underline="false" type="primary" @click="lookquily(row, '0')">质检报告</el-link>
<el-link v-if="item.detailshow" :underline="false" type="primary"
@click="lookquily(row, '1')">商品详情</el-link>
</span>
<span v-else-if="item.label == '预计结算价'">
<span :style="6 ? 'color:#ff6b81' : 'color:#2ed573'">{{
Number((row.price * 0.99) / 100).toFixed(2)
}}</span>
</span>
<span v-else-if="item.label == '预估利润'">
<span :style="6 ? 'color:#2ed573' : 'color:#ff6b81'">{{
Number(
(row.price * 0.99) / 100 - row.total_cost - row.ag_server_fee
).toFixed(2)
}}</span>
</span>
<span v-else-if="
item.label == '退款金额' ||
item.label == '申请退款金额' ||
item.label == '定价' ||
item.label == '保底价'
">
<span>{{ Number(row[item.param] / 100).toFixed(2) }}</span>
</span>
<span
v-else-if="
row[item.param] &&
((/^\d{10}$|^\d{13}$/.test(row[item.param]) &&
item.label == '交易成功时间') ||
item.label == '关闭时间' ||
item.label == '退款时间' ||
item.label == '订单创建时间' ||
item.label == '付款时间' ||
item.label == '发货时间' ||
item.label == '首次发布时间' ||
item.label == '申请退款时间')
"
>{{ row[item.param] | dateformat("YYYY-MM-DD HH:mm:ss") }}</span
>
<div v-else-if="item.label === '快递单号'">
<div>{{ row.refund_post_company }}</div>
<div>{{ row[item.param] }}</div>
</div>
<!-- 操作 -->
<span v-else-if="item.label === '操作'" class="operate">
<el-link v-if="
item.status.includes('AgreeReturn') &&
row.refund_status === 1 &&
row.need_return_goods === 'true'
" :underline="false" type="primary" @click="operate('AgreeReturn', row)">同意退货</el-link>
<el-link v-if="
item.status.includes('AgreeRefund') &&
row.refund_status === 1 &&
row.need_return_goods === 'false'
" :underline="false" type="success" @click="operate('AgreeRefund', row)">同意退款</el-link>
<el-link v-if="
(item.status.includes('ConfirmReceipt') &&
row.refund_status === 3) ||
(row.refund_status === 2 && row.need_return_goods === 'true')
" :underline="false" type="primary" @click="operate('ConfirmReceipt', row)">确认收货</el-link>
<el-link v-if="
(item.status.includes('RefusalReceipt') &&
row.refund_status === 3) ||
(row.refund_status === 2 && row.need_return_goods === 'true')
" :underline="false" type="danger" @click="operate('RefusalReceipt', row)">拒绝收货</el-link>
<el-popconfirm title="是否拒绝退款?" v-if="
(item.status.includes('RefundRefused') &&
row.refund_status === 1) ||
row.refund_status === 3
" @confirm="operate('RefundRefused', row)">
<el-link slot="reference" type="danger" :underline="false">拒绝退款</el-link>
</el-popconfirm>
<el-popconfirm title="请确认?" v-if="item.status.includes('Agree')" @confirm="operate('Agree', row)">
<el-link slot="reference" type="primary" :underline="false">同意</el-link>
</el-popconfirm>
<el-link
type="danger"
v-if="item.status.includes('Reject')"
@click="operate('Reject', row)"
:underline="false"
>驳回</el-link
>
<el-popconfirm
title="是否重新发布?"
v-if="item.status.includes('Republish')"
@confirm="operate('Republish', row)"
>
<el-link slot="reference" type="primary" :underline="false"
>重新发布</el-link
>
</el-popconfirm>
<el-popconfirm title="是否删除?" v-if="item.status.includes('Deletegoods')"
@confirm="operate('Deletegoods', row)">
<el-link slot="reference" type="danger" :underline="false">删除</el-link>
</el-popconfirm>
<el-link type="danger" :underline="false" v-if="item.status.includes('OffShelf')"
@click="operate('OffShelf', row)">下架</el-link>
<el-link v-if="item.status.includes('ChangePrice')" :underline="false" type="primary"
@click="operate('ChangePrice', row)">改价</el-link>
<el-link v-if="item.status.includes('AddOrder')" :underline="false" type="primary"
@click="operate('AddOrder', row)">补订单</el-link>
<el-link v-if="item.status.includes('CloseTrade')" :underline="false" type="success"
@click="operate('CloseTrade', row)">关闭交易</el-link>
<el-link v-if="
item.status.includes('Delivery') &&
(!row.refund_status ||
![1, 2, 3, 5, 8].includes(row.refund_status))
" :underline="false" type="primary" @click="operate('Delivery', row)">立即发货</el-link>
<el-link v-if="item.status.includes('LogisticsInfo')" :underline="false" type="primary"
@click="operate('LogisticsInfo', row)">物流信息</el-link>
<el-link v-if="item.status.includes('Intercept')" :underline="false" type="primary"
@click="operate('Intercept', row)">快递拦截</el-link>
<el-link v-if="item.status.includes('Print')" :underline="false" type="primary"
@click="operate('Print', row)">打印面单</el-link>
<el-link type="warning" :underline="false" v-if="item.status.includes('Logs')"
@click="operate('Logs', row)">日志</el-link>
<el-link type="success" :underline="false" v-if="item.status.includes('GoAudit')"
@click="operate('GoAudit', row)">审核</el-link>
</span>
<span v-else-if="item.label == '备注' && item.fixed == 'right'">
<vxe-button type="text" icon="vxe-icon-edit" @click="editEvent(row)" />
<span>{{ row.remark }}</span>
</span>
<span v-else>
{{ row[item.param] ? row[item.param] : "-" }}
</span>
</span>
</template>
</vxe-column>
</vxe-table>
<xylog :xylogdialog-visible="xylogdialogVisible" :xylogid="xylogid" :xylogtype="xylogtype"
@xylogdialog="xylogdialog" />
</div>
</template>
<script>
import Sortable from "sortablejs";
import xylog from "./../Dialog/xyqualitydialog";
export default {
name:"erpXyTable",
components: {
xylog,
},
data() {
return {
xylogid: "",
xylogtype: "",
xylogdialogVisible: false,
};
},
props: {
tableDate: {
default: () => {
return [];
},
},
tablelabel: {
default: () => {
return [];
},
},
excelName: {
default: () => {
return "";
},
},
loading: {
default: () => {
return false;
},
},
tabbar: {
default: () => {
return false;
},
},
},
computed: {
newtableData() {
if (this.tableDate.length == 0) return;
let result = [];
const arr = this._.cloneDeep(this.tableDate);
result = arr.map((item) => [{ ...item }, { ...item }]).flat();
result.map((e, i) => {
if (i % 2 === 0) {
this.$set(e, "render", true);
this.$set(e, "checked", false);
} else {
this.$set(e, "render", false);
}
});
return result;
},
height() {
let height = "";
if (this.tabbar) {
height = document.documentElement.clientHeight - 235;
} else {
height = document.documentElement.clientHeight - 280;
}
return height;
},
tablelabelLen() {
let num = 0;
this.tablelabel.forEach((item) => {
if (item.show) {
num++;
}
});
return num;
},
},
mounted() { },
methods: {
colspanMethod({ _rowIndex, _columnIndex }) {
if (_rowIndex % 2 === 0) {
if (_columnIndex === 0) {
return { rowspan: 1, colspan: 1 };
} else if (_columnIndex === 1) {
return { rowspan: 1, colspan: this.tablelabelLen };
} else {
return { rowspan: 0, colspan: 0 };
}
}
},
checCheckboxkMethod3({ row }) {
return row.render == true;
},
showCheckboxkMethod2({ row }) {
return row.render == true;
},
//
tongyi(row) {
this.$emit("tongyi", row);
},
//
bohui(row) {
this.$emit("bohui", row);
},
//
jump(row, name) {
switch (name) {
case "机器编号":
this.$router.push({
name: "MachineDetails",
query: { row: row.res_id },
});
break;
case "质检码":
this.$router.push({
path: "idleFishIssue",
query: { xy_product_id: row.xy_product_id },
});
break;
default:
break;
}
},
//
operate(val, data) {
switch (val) {
case "Agree":
this.$emit("Agree", data);
break;
case "Reject":
this.$emit("Reject", data);
break;
case "OffShelf":
this.$emit("OffShelf", data);
break;
case "Logs":
this.$emit("looksLogs", data);
break;
case "ChangePrice":
this.$emit("ChangePrice", data);
break;
case "Republish":
this.$emit("Republish", data);
break;
case "Deletegoods":
this.$emit("Deletegoods", data);
break;
case "AddOrder":
this.$emit("AddOrder", data);
break;
case "CloseTrade":
this.$emit("CloseTrade", data);
break;
case "Delivery":
this.$emit("Delivery", data);
break;
case "LogisticsInfo":
this.$emit("LogisticsInfo", data);
break;
case "Intercept":
this.$emit("Intercept", data);
break;
case "AgreeReturn":
this.$emit("AgreeReturn", data);
break;
case "RefundRefused":
this.$emit("RefundRefused", data);
break;
case "AgreeRefund":
this.$emit("AgreeRefund", data);
break;
case "ConfirmReceipt":
this.$emit("ConfirmReceipt", data);
break;
case "RefusalReceipt":
this.$emit("RefusalReceipt", data);
break;
case "Print":
let params = {
tracking_number: data.express_no,
express_company_id: data.express_company_id,
};
this.$emit("Print", params);
break;
case "GoAudit":
this.$emit("GoAudit", data);
break;
default:
break;
}
},
//
lookquily(row, type) {
this.xylogdialogVisible = true;
if (type == "0") {
this.xylogtype = "0";
this.xylogid = row.id;
} else {
this.xylogtype = "1";
this.xylogid = row.item_id;
}
},
//
editEvent(row) {
const dataToEdit = row.remark;
let inputValue = dataToEdit; // 使
this.$confirm("", "修改备注", {
cancelButtonText: "重置",
confirmButtonText: "提交",
customClass: "custom-prompt",
inputPlaceholder: "请输入备注",
inputType: "textarea",
inputRows: 5,
inputValue: inputValue,
showInput: true,
distinguishCancelAndClose: true,
beforeClose: (action, instance, done) => {
//
if (action === "confirm" || action === "close") {
done();
} else if ((instance.inputValue = "cancel")) {
instance.inputValue = "";
}
},
})
.then(({ value }) => {
this.$emit("submitRemark", row, value);
})
.catch(() => {
//
});
},
// dilog
xylogdialog(e) {
this.xylogdialogVisible = e;
},
// sortable
InitializeSortable() {
const sortableId = document.querySelector(
".vxe-table--header-wrapper tr"
);
this.sortable = Sortable.create(sortableId, {
//
onChoose: function (/**Event*/ evt) {
evt.oldIndex; // element index widthin parent
},
//
onStart: function (/**Event*/ evt) {
evt.oldIndex; // element index widthin parent
},
//
onEnd: function (/**Event*/ evt) {
var itemEl = evt.item; // dragged HTMLElement
evt.to; // target list
evt.from; // previous list
evt.oldIndex; // element's old index widthin old parent
evt.newIndex; // element's new index widthin new parent
evt.clone; // the clone element
evt.pullMode; // when item is in another sortable: `"clone"` if cloning, `true` if moving
},
//
onAdd: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onUpdate: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onSort: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onRemove: function (/**Event*/ evt) {
// same properties as onEnd
},
// filtered
onFilter: function (/**Event*/ evt) {
var itemEl = evt.item; // HTMLElement receiving the `mousedown|tapstart` event.
},
//
onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
// Example: https://jsbin.com/nawahef/edit?js,output
evt.dragged; // dragged HTMLElement
evt.draggedRect; // DOMRect {left, top, right, bottom}
evt.related; // HTMLElement on which have guided
evt.relatedRect; // DOMRect
evt.willInsertAfter; // Boolean that is true if Sortable will insert drag element after target by default
originalEvent.clientY; // mouse position
// return false; for cancel
// return -1; insert before target
// return 1; insert after target
},
// clone
onClone: function (/**Event*/ evt) {
var origEl = evt.item;
var cloneEl = evt.clone;
},
//
onChange: function (/**Event*/ evt) {
evt.newIndex; // most likely why this event is used is to get the dragging element's current index
// same properties as onEnd
},
});
},
//
columnDrop() {
const wrapperTr = document.querySelector(".vxe-table--header-wrapper tr");
this.sortable = Sortable.create(wrapperTr, {
animation: 180,
delay: 0,
onEnd: (evt) => {
console.log(evt, "evt-----------");
const oldItem = this.tablelabel[evt.oldIndex];
this.tablelabel.splice(evt.oldIndex, 1);
this.tablelabel.splice(evt.newIndex, 0, oldItem);
this.InitializeSortable();
},
});
},
scrollHeight() {
setTimeout(() => {
this.$refs.xTable.scrollTo(0, 0);
}, 500);
},
//
selectAllEvent(val) {
this.$emit("selectAllEvent", val.records);
},
//
selectEvent(val) {
this.$emit("selectEvent", val.records);
},
},
};
</script>
<style lang="scss" scoped>
// .remark {
// display: flex;
// align-items: center;
// justify-content: center;
// }
// .item {
// width: 50%;
// display: inline-block;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// }
.firstspan {
display: flex;
span {
margin-right: 20px;
}
}
.machineinfo {
text-align: left !important;
font-weight: 500;
p {
margin-bottom: 0px;
}
.info {
display: flex;
align-items: center;
margin-top: 5px;
.info-right {
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 0 0 15px;
}
}
}
.look {
display: flex;
flex-direction: column;
}
.operate {
display: flex;
flex-direction: column;
align-items: center;
span {
line-height: 20px;
}
}
::v-deep {
.vxe-table--body .vxe-cell--checkbox:nth-child(odd) :after {
content: "";
position: absolute;
top: 0px;
right: -5px;
display: inline-block;
width: 20px;
height: calc(100% - 1px);
background-color: #ffffff;
}
.vxe-body--row.row--hover {
.vxe-cell--checkbox:nth-child(odd) :after {
background-color: #f5f7fa;
}
}
/*调整表格 单元格背景颜色*/
.vxe-table .vxe-table--body-wrapper,
.vxe-table .vxe-table--footer-wrapper {
border: none;
background-color: rgba(255, 255, 255);
}
.vxe-cell--checkbox:nth-child(odd) {
display: flex;
align-items: center;
justify-content: center;
}
.vxe-body--row:nth-child(even) {
background-color: rgb(248 248 249);
}
}
</style>

833
commontable/ysTable.vue Normal file
View File

@ -0,0 +1,833 @@
<template>
<div>
<vxe-table
ref="xTable"
:row-config="{ isHover: true }"
:data="newtableData"
:span-method="colspanMethod"
:height="height"
:checkbox-config="{
checkField: 'checked',
checkMethod: checCheckboxkMethod3,
visibleMethod: showCheckboxkMethod2,
}"
:header-cell-style="{
height: '70px',
color: '#606266',
'text-align': 'center',
}"
:scroll-y="{ enabled: false, gt: 10 }"
:loading="loading"
border
@checkbox-change="selectEvent"
@checkbox-all="selectAllEvent"
>
<vxe-column type="checkbox" width="50" :border="false"></vxe-column>
<vxe-column
v-for="(item, index) in tablelabel"
:key="index"
:visible="item.show"
:title="item.label"
:field="item.param"
:fixed="item.fixed"
:column-key="item.param"
:min-width="item.minwidth"
:filters="item.filters"
:sortable="item.sortable"
:show-overflow="item.remarkshow"
align="center"
>
<!-- <template
v-if="
item.label == '预计结算价'
"
v-slot:header="{ column, rowIndex }"
>
<span>{{ item.label }}</span>
<el-tooltip
class="item"
effect="dark"
content="点击批量修改"
placement="top-start"
>
<i
class="el-icon-document-copy"
style=" margin-left: 5px; cursor: pointer"
/>
</el-tooltip>
</template> -->
<template slot-scope="{ row }">
<span v-if="row.render" class="firstspan">
<span v-if="row.business_id">
<span v-if="item.link" style="display: flex; align-items: center">
质检码
<el-link
:underline="false"
type="primary"
@dblclick.native="jump(row, '质检码')"
>{{ row.business_id }}</el-link
>
</span>
<span v-else> 质检码{{ row.business_id }} </span>
</span>
<span v-if="row.biz_order_id"
>订单编号{{ row.biz_order_id }}</span
>
<span
v-if="
row.publish_time && /^\d{10}$|^\d{13}$/.test(row.publish_time)
"
>发布时间{{
row.publish_time | dateformat("YYYY-MM-DD HH:mm:ss")
}}</span
>
<span v-if="row.last_truename"
>最近翻库人{{ row.last_truename }}</span
>
<span v-if="row.last_publish_time"
>最近翻库日期{{
row.last_publish_time | dateformat("YYYY-MM-DD HH:mm:ss")
}}</span
>
<span v-if="row.buyer_nick">买家昵称{{ row.buyer_nick }}</span>
</span>
<span v-else-if="!row.render">
<div v-if="item.label === '机器信息'" class="machineinfo">
<p>
{{ row.brand_name }} {{ row.model_name }} {{ row.rom_name }}
{{ row.color_name }}
</p>
<div class="info">
<div class="info-left">
<el-popover
v-if="row['img']"
placement="right"
width="375"
trigger="click"
>
<img
v-if="row['img']"
style="height: 350px"
:src="row['img']"
/>
<img
v-if="row['img']"
slot="reference"
style="float: left; height: 70px"
:src="row['img']"
/>
</el-popover>
<img
v-else
style="float: left; height: 70px"
src="../../assets/img/noimg.jpg"
/>
</div>
<ul class="info-right">
<li>
<span
v-if="item.link"
style="display: flex; align-items: center"
>
机器编号
<el-link
:underline="false"
type="primary"
@dblclick.native="jump(row, '机器编号')"
>{{ row.serial_number }}</el-link
>
</span>
<span v-else> 机器编号{{ row.serial_number }} </span>
</li>
<li>IMEI{{ row.imei1 }}</li>
<li>IMEI2{{ row.imei2 }}</li>
<li>SN:{{ row.sn }}</li>
</ul>
</div>
</div>
<span v-else-if="item.label === '机器成色'">
{{
Number(row.stuff_status) > 0
? row.stuff_status + "新"
: row.stuff_status
}}
</span>
<span
v-else-if="
item.label === '机器状态' ||
item.label === '订单状态' ||
item.label === '商品状态' ||
item.label === '售后状态'
"
>
<el-tag>{{ row[item.param] || "/" }}</el-tag>
</span>
<span v-else-if="item.label === '订单价格\n(利润)'">
<span style="display: block">{{ row.payment / 100 }}</span>
<span
:class="
row.payment / 100 - row.total_cost > 0 ? 'red' : 'green'
"
>{{
(row.payment / 100 - Number(row.total_cost)).toFixed(2)
}}</span
>
</span>
<span v-else-if="item.label == '质检报告'" class="look">
<el-link
:underline="false"
type="primary"
@click="lookquily(row, '0')"
>质检报告</el-link
>
<el-link
v-if="item.detailshow"
:underline="false"
type="primary"
@click="lookquily(row, '1')"
>商品详情</el-link
>
</span>
<span v-else-if="item.label == '预计结算价'">
<span :style="6 ? 'color:#ff6b81' : 'color:#2ed573'">{{
Number((row.price * 0.99) / 100).toFixed(2)
}}</span>
</span>
<span v-else-if="item.label == '预估利润'">
<span :style="6 ? 'color:#2ed573' : 'color:#ff6b81'">{{
Number(
(row.price * 0.99) / 100 - row.total_cost - row.ag_server_fee
).toFixed(2)
}}</span>
</span>
<span
v-else-if="
item.label == '退款金额' ||
item.label == '申请退款金额' ||
item.label == '定价' ||
item.label == '保底价'
"
>
<span>{{ Number(row[item.param] / 100).toFixed(2) }}</span>
</span>
<span
v-else-if="
row[item.param] &&
((/^\d{10}$|^\d{13}$/.test(row[item.param]) &&
item.label == '交易成功时间') ||
item.label == '关闭时间' ||
item.label == '退款时间' ||
item.label == '订单创建时间' ||
item.label == '付款时间' ||
item.label == '发货时间' ||
item.label == '首次发布时间' ||
item.label == '申请退款时间')
"
>{{ row[item.param] | dateformat("YYYY-MM-DD HH:mm:ss") }}</span
>
<!-- 操作 -->
<span v-else-if="item.label === '操作'" class="operate">
<el-link
v-if="
item.status.includes('AgreeReturn') &&
row.refund_status === 1 &&
row.need_return_goods === 'true'
"
:underline="false"
type="primary"
@click="operate('AgreeReturn', row)"
>同意退货</el-link
>
<el-link
v-if="
item.status.includes('AgreeRefund') &&
row.refund_status === 1 &&
row.need_return_goods === 'false'
"
:underline="false"
type="success"
@click="operate('AgreeRefund', row)"
>同意退款</el-link
>
<el-link
v-if="
(item.status.includes('ConfirmReceipt') &&
row.refund_status === 3) ||
(row.refund_status === 2 && row.need_return_goods === 'true')
"
:underline="false"
type="primary"
@click="operate('ConfirmReceipt', row)"
>确认收货</el-link
>
<el-link
v-if="
(item.status.includes('RefusalReceipt') &&
row.refund_status === 3) ||
(row.refund_status === 2 && row.need_return_goods === 'true')
"
:underline="false"
type="danger"
@click="operate('RefusalReceipt', row)"
>拒绝收货</el-link
>
<el-popconfirm
title="是否拒绝退款?"
v-if="
(item.status.includes('RefundRefused') &&
row.refund_status === 1) ||
row.refund_status === 3
"
@confirm="operate('RefundRefused', row)"
>
<el-link slot="reference" type="danger" :underline="false"
>拒绝退款</el-link
>
</el-popconfirm>
<el-popconfirm
title="请确认?"
v-if="item.status.includes('Agree')"
@confirm="operate('Agree', row)"
>
<el-link slot="reference" type="primary" :underline="false"
>同意</el-link
>
</el-popconfirm>
<el-popconfirm
title="请确认驳回?"
v-if="item.status.includes('Reject')"
@confirm="operate('Reject', row)"
>
<el-link slot="reference" type="danger" :underline="false"
>驳回</el-link
>
</el-popconfirm>
<el-popconfirm
title="是否重新发布?"
v-if="item.status.includes('Republish')"
@confirm="operate('Republish', row)"
>
<el-link slot="reference" type="primary" :underline="false"
>重新发布</el-link
>
</el-popconfirm>
<el-popconfirm
title="是否删除?"
v-if="item.status.includes('Deletegoods')"
@confirm="operate('Deletegoods', row)"
>
<el-link slot="reference" type="danger" :underline="false"
>删除</el-link
>
</el-popconfirm>
<el-link
type="danger"
:underline="false"
v-if="item.status.includes('OffShelf')"
@click="operate('OffShelf', row)"
>下架</el-link
>
<el-link
v-if="item.status.includes('ChangePrice')"
:underline="false"
type="primary"
@click="operate('ChangePrice', row)"
>改价</el-link
>
<el-link
v-if="item.status.includes('AddOrder')"
:underline="false"
type="primary"
@click="operate('AddOrder', row)"
>补订单</el-link
>
<el-link
v-if="item.status.includes('CloseTrade')"
:underline="false"
type="success"
@click="operate('CloseTrade', row)"
>关闭交易</el-link
>
<el-link
v-if="
item.status.includes('Delivery') &&
(!row.refund_status ||
![1, 2, 3, 5, 8].includes(row.refund_status))
"
:underline="false"
type="primary"
@click="operate('Delivery', row)"
>立即发货</el-link
>
<el-link
v-if="item.status.includes('LogisticsInfo')"
:underline="false"
type="primary"
@click="operate('LogisticsInfo', row)"
>物流信息</el-link
>
<el-link
v-if="item.status.includes('Intercept')"
:underline="false"
type="primary"
@click="operate('Intercept', row)"
>快递拦截</el-link
>
<el-link
v-if="item.status.includes('Print')"
:underline="false"
type="primary"
@click="operate('Print', row)"
>打印面单</el-link
>
<el-link
type="warning"
:underline="false"
v-if="item.status.includes('Logs')"
@click="operate('Logs', row)"
>日志</el-link
>
</span>
<span v-else-if="item.label == '备注' && item.fixed == 'right'">
<vxe-button
type="text"
icon="vxe-icon-edit"
@click="editEvent(row)"
/>
<span>{{ row.remark }}</span>
</span>
<span v-else>
{{ row[item.param] ? row[item.param] : "-" }}
</span>
</span>
</template>
</vxe-column>
</vxe-table>
<xylog
:xylogdialog-visible="xylogdialogVisible"
:xylogid="xylogid"
:xylogtype="xylogtype"
@xylogdialog="xylogdialog"
/>
</div>
</template>
<script>
import Sortable from "sortablejs";
import xylog from "./../Dialog/xyqualitydialog";
export default {
name:"erpYsTable",
components: {
xylog,
},
data() {
return {
xylogid: "",
xylogtype: "",
xylogdialogVisible: false,
};
},
props: {
tableDate: {
default: () => {
return [];
},
},
tablelabel: {
default: () => {
return [];
},
},
excelName: {
default: () => {
return "";
},
},
loading: {
default: () => {
return false;
},
},
tabbar: {
default: () => {
return false;
},
},
},
computed: {
newtableData() {
if (this.tableDate.length == 0) return;
let result = [];
const arr = this._.cloneDeep(this.tableDate);
result = arr.map((item) => [{ ...item }, { ...item }]).flat();
result.map((e, i) => {
if (i % 2 === 0) {
this.$set(e, "render", true);
this.$set(e, "checked", false);
} else {
this.$set(e, "render", false);
}
});
return result;
},
height() {
let height = "";
if (this.tabbar) {
height = document.documentElement.clientHeight - 235;
} else {
height = document.documentElement.clientHeight - 280;
}
return height;
},
tablelabelLen() {
let num = 0;
this.tablelabel.forEach((item) => {
if (item.show) {
num++;
}
});
return num;
},
},
mounted() {},
methods: {
colspanMethod({ _rowIndex, _columnIndex }) {
if (_rowIndex % 2 === 0) {
if (_columnIndex === 0) {
return { rowspan: 1, colspan: 1 };
} else if (_columnIndex === 1) {
return { rowspan: 1, colspan: this.tablelabelLen };
} else {
return { rowspan: 0, colspan: 0 };
}
}
},
checCheckboxkMethod3({ row }) {
return row.render == true;
},
showCheckboxkMethod2({ row }) {
return row.render == true;
},
//
tongyi(row) {
this.$emit("tongyi", row);
},
//
bohui(row) {
this.$emit("bohui", row);
},
//
jump(row, name) {
switch (name) {
case "机器编号":
this.$router.push({
name: "MachineDetails",
query: { row: row.res_id },
});
break;
case "质检码":
this.$router.push({
path: "PublishingCenter",
query: { fish_market_id: row.fish_market_id,imei:row.imei || row.imei1 || row.imei2 || row.serial_number || row.sn },
});
break;
default:
break;
}
},
//
operate(val, data) {
switch (val) {
case "Agree":
this.$emit("Agree", data);
break;
case "Reject":
this.$emit("Reject", data);
break;
case "OffShelf":
this.$emit("OffShelf", data);
break;
case "Logs":
this.$emit("looksLogs", data);
break;
case "ChangePrice":
this.$emit("ChangePrice", data);
break;
case "Republish":
this.$emit("Republish", data);
break;
case "Deletegoods":
this.$emit("Deletegoods", data);
break;
case "AddOrder":
this.$emit("AddOrder", data);
break;
case "CloseTrade":
this.$emit("CloseTrade", data);
break;
case "Delivery":
this.$emit("Delivery", data);
break;
case "LogisticsInfo":
this.$emit("LogisticsInfo", data);
break;
case "Intercept":
this.$emit("Intercept", data);
break;
case "AgreeReturn":
this.$emit("AgreeReturn", data);
break;
case "RefundRefused":
this.$emit("RefundRefused", data);
break;
case "AgreeRefund":
this.$emit("AgreeRefund", data);
break;
case "ConfirmReceipt":
this.$emit("ConfirmReceipt", data);
break;
case "RefusalReceipt":
this.$emit("RefusalReceipt", data);
break;
case "Print":
let params = {
tracking_number: data.express_no,
express_company_id: data.express_company_id,
};
this.$emit("Print", params);
break;
default:
break;
}
},
//
lookquily(row, type) {
this.xylogdialogVisible = true;
if (type == "0") {
this.xylogtype = "0";
this.xylogid = row.id;
} else {
this.xylogtype = "1";
this.xylogid = row.item_id;
}
},
//
editEvent(row) {
const dataToEdit = row.remark;
let inputValue = dataToEdit; // 使
this.$confirm("", "修改备注", {
cancelButtonText: "重置",
confirmButtonText: "提交",
customClass: "custom-prompt",
inputPlaceholder: "请输入备注",
inputType: "textarea",
inputRows: 5,
inputValue: inputValue,
showInput: true,
distinguishCancelAndClose: true,
beforeClose: (action, instance, done) => {
//
if (action === "confirm" || action === "close") {
done();
} else if ((instance.inputValue = "cancel")) {
instance.inputValue = "";
}
},
})
.then(({ value }) => {
this.$emit("submitRemark", row, value);
})
.catch(() => {
//
});
},
// dilog
xylogdialog(e) {
this.xylogdialogVisible = e;
},
// sortable
InitializeSortable() {
const sortableId = document.querySelector(
".vxe-table--header-wrapper tr"
);
this.sortable = Sortable.create(sortableId, {
//
onChoose: function (/**Event*/ evt) {
evt.oldIndex; // element index widthin parent
},
//
onStart: function (/**Event*/ evt) {
evt.oldIndex; // element index widthin parent
},
//
onEnd: function (/**Event*/ evt) {
var itemEl = evt.item; // dragged HTMLElement
evt.to; // target list
evt.from; // previous list
evt.oldIndex; // element's old index widthin old parent
evt.newIndex; // element's new index widthin new parent
evt.clone; // the clone element
evt.pullMode; // when item is in another sortable: `"clone"` if cloning, `true` if moving
},
//
onAdd: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onUpdate: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onSort: function (/**Event*/ evt) {
// same properties as onEnd
},
//
onRemove: function (/**Event*/ evt) {
// same properties as onEnd
},
// filtered
onFilter: function (/**Event*/ evt) {
var itemEl = evt.item; // HTMLElement receiving the `mousedown|tapstart` event.
},
//
onMove: function (/**Event*/ evt, /**Event*/ originalEvent) {
// Example: https://jsbin.com/nawahef/edit?js,output
evt.dragged; // dragged HTMLElement
evt.draggedRect; // DOMRect {left, top, right, bottom}
evt.related; // HTMLElement on which have guided
evt.relatedRect; // DOMRect
evt.willInsertAfter; // Boolean that is true if Sortable will insert drag element after target by default
originalEvent.clientY; // mouse position
// return false; for cancel
// return -1; insert before target
// return 1; insert after target
},
// clone
onClone: function (/**Event*/ evt) {
var origEl = evt.item;
var cloneEl = evt.clone;
},
//
onChange: function (/**Event*/ evt) {
evt.newIndex; // most likely why this event is used is to get the dragging element's current index
// same properties as onEnd
},
});
},
//
columnDrop() {
const wrapperTr = document.querySelector(".vxe-table--header-wrapper tr");
this.sortable = Sortable.create(wrapperTr, {
animation: 180,
delay: 0,
onEnd: (evt) => {
console.log(evt, "evt-----------");
const oldItem = this.tablelabel[evt.oldIndex];
this.tablelabel.splice(evt.oldIndex, 1);
this.tablelabel.splice(evt.newIndex, 0, oldItem);
this.InitializeSortable();
},
});
},
scrollHeight() {
setTimeout(() => {
this.$refs.xTable.scrollTo(0, 0);
}, 500);
},
//
selectAllEvent(val) {
this.$emit("selectAllEvent", val.records);
},
//
selectEvent(val) {
this.$emit("selectEvent", val.records);
},
},
};
</script>
<style lang="scss" scoped>
// .remark {
// display: flex;
// align-items: center;
// justify-content: center;
// }
// .item {
// width: 50%;
// display: inline-block;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// }
.firstspan {
display: flex;
span {
margin-right: 20px;
}
}
.machineinfo {
text-align: left !important;
font-weight: 500;
p {
margin-bottom: 0px;
}
.info {
display: flex;
align-items: center;
margin-top: 5px;
.info-right {
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 0 0 15px;
}
}
}
.look {
display: flex;
flex-direction: column;
}
.operate {
display: flex;
flex-direction: column;
align-items: center;
span {
line-height: 20px;
}
}
::v-deep {
.vxe-table--body .vxe-cell--checkbox:nth-child(odd) :after {
content: "";
position: absolute;
top: 0px;
right: -5px;
display: inline-block;
width: 20px;
height: calc(100% - 1px);
background-color: #ffffff;
}
.vxe-body--row.row--hover {
.vxe-cell--checkbox:nth-child(odd) :after {
background-color: #f5f7fa;
}
}
/*调整表格 单元格背景颜色*/
.vxe-table .vxe-table--body-wrapper,
.vxe-table .vxe-table--footer-wrapper {
border: none;
background-color: rgba(255, 255, 255);
}
.vxe-cell--checkbox:nth-child(odd) {
display: flex;
align-items: center;
justify-content: center;
}
.vxe-body--row:nth-child(even) {
background-color: rgb(248 248 249);
}
}
</style>

View File

@ -6,6 +6,12 @@ import MoreClass from "./CommonInput/MoreClass.vue";
import MoreScreen from "./CommonInput/MoreScreen.vue"; import MoreScreen from "./CommonInput/MoreScreen.vue";
import selectbtn from "./CommonInput/selectbtn.vue"; import selectbtn from "./CommonInput/selectbtn.vue";
import TimingModule from "./CommonInput/TimingModule.vue"; import TimingModule from "./CommonInput/TimingModule.vue";
import Options from "./commontable/options";
import Table from "./commontable/erpTable.vue";
import XyTable from "./commontable/xyTable.vue";
import YsTable from "./commontable/ysTable.vue";
import Tablepagination from "./commontable/tablepagination.vue";
import Tabletabs from "./commontable/tabletabs.vue";
const componentarr = [ const componentarr = [
appTitle, appTitle,
@ -16,6 +22,12 @@ const componentarr = [
MoreScreen, MoreScreen,
selectbtn, selectbtn,
TimingModule, TimingModule,
Options,
Table,
XyTable,
YsTable,
Tablepagination,
Tabletabs
]; ];
const install = function (Vue) { const install = function (Vue) {

View File

@ -1,6 +1,6 @@
{ {
"name": "erp-element-ui", "name": "erp-element-ui",
"version": "1.0.8", "version": "1.0.11",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -10,7 +10,10 @@
"license": "ISC", "license": "ISC",
"peerDependencies": { "peerDependencies": {
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"echarts":"^4.9.0" "echarts":"^4.9.0",
"sortablejs":"^1.12.0",
"qrcodejs2":"^0.0.2",
"axios":"^0.18.1"
}, },
"homepage": "https://git.aiguoai.com/liunan/erp-el-element.git", "homepage": "https://git.aiguoai.com/liunan/erp-el-element.git",
"repository": { "repository": {

BIN
utils/.DS_Store vendored Normal file

Binary file not shown.

4
utils/Decimal.js Normal file
View File

@ -0,0 +1,4 @@
export function add(){
}

185
utils/request.js Normal file
View File

@ -0,0 +1,185 @@
/*
* @Author: your name
* @Date: 2020-09-08 18:06:28
* @LastEditTime: 2023-03-06 14:54:24
* @LastEditors: ckycjwds 1240973496@qq.com
* @Description: In User Settings Edit
* @FilePath: \aiguo_erp_vue\src\utils\request.js
*/
import axios from 'axios'
import { MessageBox, Message } from 'element-ui';
const service = axios.create({
baseURL: process?.env?.VUE_APP_BASE_API??"http://dev-erp-api.xtkj99.com:7890",
timeout: 1000 * 60 * 2 // 接口超时
})
const pendingAjax = []
const fastClickMsg = '数据请求中,请稍后'
const CancelToken = axios.CancelToken;
let lastcancel=null;
const removePendingAjax = (config, type, c) => {
if (type.type == 1) {
if (config.data) {
config.data = JSON.stringify(config.data)
}
}
let url = config.url
if (!!config.data && config.data != '{}') {
url = config.url + '_' + config.data
}
// 数据请求中白名单
const whitelist = ['get_class_account_list', 'cate_brand_list_all', 'ai_model_v2', 'res_advanced_search', 'qrcode', 'account_class_list', 'search_accessories', 'zz_new_status', 'get_unread_msg', 'third_party_no', 'get_ws_auth_code', 'get_drafts_box', 'manual_pull_datas', 'get_unopened_module', 'sales_performance_detail', 'goal_warehouse', 'chx_product_details', 'get_oss_sign_aliyun']
const index = pendingAjax.findIndex(i => i === url)
const white = whitelist.some(res => {
if (url.indexOf(res) != -1) {
return true
}
})
if (white) { // 白名单内的接口可以重复请求
pendingAjax.splice(index, 1)
} else {
if (index > -1) {
c ? c(fastClickMsg + url) : pendingAjax.splice(index, 1)
} else {
c && pendingAjax.push(url)
}
}
}
// 请求拦截
service.interceptors.request.use(
config => {
// if (navigator.onLine) { //检测网络是否正常
let token=localStorage.getItem("token");
if (token) {
config.headers['token'] = localStorage.getItem('token')
}
if(!lastcancel){
lastcancel= new CancelToken(c => {
const copyconfig = JSON.parse(JSON.stringify(config))
removePendingAjax(copyconfig, { type: 1 }, c)
});
}
config.cancelToken=lastcancel;
// config.cancelToken = new CancelToken(c => {
// const copyconfig = JSON.parse(JSON.stringify(config))
// removePendingAjax(copyconfig, { type: 1 }, c)
// })
return config
// }else{
// Message({
// duration:4000,
// message: '请检查网络状态',
// type: 'warning',
// showClose:true,
// })
// return
// }
},
error => {
return Promise.reject(error)
}
)
// 响应拦截
service.interceptors.response.use(
async response => {
const res = response.data
const copyconfig = JSON.parse(JSON.stringify(response.config))
copyconfig.url = response.config.url.replace(copyconfig.baseURL, '')
if (typeof (copyconfig.data) === undefined || copyconfig.data == {} || copyconfig.data == '' || typeof (copyconfig.data) === 'object') {
copyconfig.data = ''
}
removePendingAjax(copyconfig, { type: 2 })
lastcancel=null;
if (res.errcode == 1012) {
return res
} else if (res.errcode == 0 && res.msg != '' && res.msg != '成功' && res.msg != '获取成功') {
Message({
duration: 4000,
message: res.msg,
type: 'success',
showClose: true
})
return res
} else if (res.errcode == 105) { // 数据请求过快
Message({
duration: 1000,
message: res.msg,
type: 'warning',
showClose: true
})
} else if (res.errcode == 1002) {
localStorage.clear();
location.reload();
/* 这里是判断识别sn的接口地址 如果为真 就把content返回*/
} else if (res.errcode == 50086) {
return res
} else if (res.errcode != 0) {
Message({
duration: 4000,
message: res.msg,
type: 'warning',
showClose: true
})
return res
/* 这里是判断识别sn的接口地址 如果为真 就把content返回*/
} else if (response.config.url.indexOf('https://apiv1.aiguovip.com/api/query/identify_sn_imei') > -1) {
return res.content
} else {
return res
}
},
error => {
console.log(error)
if (error.message.indexOf('数据请求中') != -1) {
Message({
duration: 1000,
showClose: true,
message: '数据请求中,请稍后...',
type: 'warning'
})
} else if (error.message.indexOf('timeout') != -1) {
const copyconfig = JSON.parse(JSON.stringify(error.config))
copyconfig.url = error.config.url.replace(copyconfig.baseURL, '')
if (typeof (copyconfig.data) === undefined || copyconfig.data == {} || copyconfig.data == '' || typeof (copyconfig.data) === 'object') {
copyconfig.data = ''
}
removePendingAjax(copyconfig, { type: 2 })
Message({
duration: 4000,
showClose: true,
message: '接口请求超时',
type: 'error'
})
} else {
// console.log(Object.getOwnPropertyNames(error));
// console.log(error);
// console.log(error.stack);
// console.log(error.message);
if(error?.response.config){
const copyconfig = JSON.parse(JSON.stringify(error?.response.config))
copyconfig.url = error?.response.config?.url?.replace(copyconfig.baseURL, '')
if (typeof (copyconfig.data) === undefined || copyconfig.data == {} || copyconfig.data == '' || typeof (copyconfig.data) === 'object') {
copyconfig.data = ''
}
removePendingAjax(copyconfig, { type: 2 })
}
Message({
duration: 4000,
showClose: true,
message: '接口请求超时',
type: 'error'
})
}
// return Promise.reject(error.response.data)
// return Promise.reject(error)
return error
}
)
export default service