作者 雷海东

生产计划查看、派工

不能预览此文件类型
... ... @@ -18,7 +18,7 @@
<a-form-item label="产品类型">
<!-- <j-input placeholder="请选择产品类型" v-model="queryParam.productType"></j-input> -->
<a-select size="small" v-model="queryParam.productType" placeholder="请选择产品类型" allowClear>
<a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeName">{{ item.productTypeName }}</a-select-option>
<a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
... ...
... ... @@ -49,7 +49,7 @@
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -75,7 +75,7 @@
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -101,7 +101,7 @@
<td>
<a-form-model-item prop="undertakerhg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -136,7 +136,7 @@
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -162,7 +162,7 @@
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -188,7 +188,7 @@
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -214,7 +214,7 @@
<td>
<a-form-model-item prop="undertakerhg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -248,7 +248,7 @@
</td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -273,7 +273,7 @@
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -299,7 +299,7 @@
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -324,7 +324,7 @@
</td>
<a-form-model-item prop="undertakerhg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -358,7 +358,7 @@
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -384,7 +384,7 @@
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -410,7 +410,7 @@
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -436,7 +436,7 @@
<td>
<a-form-model-item prop="undertakermh1" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh1" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -462,7 +462,7 @@
<td>
<a-form-model-item prop="undertakermh2" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh2" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -488,7 +488,7 @@
<td>
<a-form-model-item prop="undertakerhm" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhm" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -514,7 +514,7 @@
<td>
<a-form-model-item prop="undertakerzp" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerzp" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -549,7 +549,7 @@
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -575,7 +575,7 @@
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -601,7 +601,7 @@
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -627,7 +627,7 @@
<td>
<a-form-model-item prop="undertakermh1" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh1" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -653,7 +653,7 @@
<td>
<a-form-model-item prop="undertakermh2" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh2" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -679,7 +679,7 @@
<td>
<a-form-model-item prop="undertakerhm" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhm" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -705,7 +705,7 @@
<td>
<a-form-model-item prop="undertakerzp" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerzp" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -740,7 +740,7 @@
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -766,7 +766,7 @@
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -793,7 +793,7 @@
<td>
<a-form-model-item prop="undertakermh1" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh1" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -819,7 +819,7 @@
<td>
<a-form-model-item prop="undertakermh2" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh2" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -845,7 +845,7 @@
<td>
<a-form-model-item prop="undertakerhm" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhm" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
... ... @@ -887,8 +887,8 @@ export default {
return {
orderNumber: '',
productType: '',
zong:0,
yp:0,
zong: 0,
yp: 0,
options: [],
model: {
//接地
... ... @@ -1016,11 +1016,13 @@ export default {
add(record) {
this.orderNumber = record.orderNumber
this.productType = record.productType
this.zong=record.totalWork
this.yp=record.pai
console.log('派工订单号:', this.orderNumber, '产品类型:', this.productType,"总工时:",this.zong,"已派工时:",this.yp)
this.zong = record.totalWork
this.yp = record.pai
console.log('派发人:', this.userInfo().realname)
if (this.productType === 'JD') {
//如果已派工时为0总工时*工时比例,否则(总工时-已派工时)*工时比例
if (record.pai <= 0) {
if (this.productType === 'JD') {
this.model.workHoursjig = parseFloat((record.totalWork * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat((record.totalWork * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = record.totalWork * 0
... ... @@ -1058,19 +1060,59 @@ export default {
this.model.workHoursmh2 = parseFloat((record.totalWork * 0.3).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshm = parseFloat((record.totalWork * 0.21).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
}
}else{
if (this.productType === 'JD') {
this.model.workHoursjig = parseFloat((record.pai * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat((record.pai * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = record.pai * 0
this.model.workHourshg = record.pai * 0
} else if (this.productType === 'XC') {
this.model.workHoursjig = parseFloat(((record.totalWork-record.pai) * 0.2).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat(((record.totalWork-record.pai) * 0.06).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat(((record.totalWork-record.pai) * 0.32).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshg = parseFloat(((record.totalWork-record.pai) * 0.42).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
} else if (this.productType === 'QZ') {
this.model.workHoursjig = (record.totalWork-record.pai) * 0
this.model.workHoursjuc = parseFloat(((record.totalWork-record.pai) * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat(((record.totalWork-record.pai) * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshg = (record.totalWork-record.pai) * 0
} else if (this.productType === 'GX') {
this.model.workHoursjig = parseFloat(((record.totalWork-record.pai) * 0.13).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat(((record.totalWork-record.pai) * 0.05).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat(((record.totalWork-record.pai) * 0.17).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh1 = parseFloat(((record.totalWork-record.pai) * 0.17).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh2 = parseFloat(((record.totalWork-record.pai) * 0.14).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshm = parseFloat(((record.totalWork-record.pai) * 0.15).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourszp = parseFloat(((record.totalWork-record.pai) * 0.19).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
} else if (this.productType === 'SJ') {
this.model.workHoursjig = parseFloat(((record.totalWork-record.pai) * 0.13).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat(((record.totalWork-record.pai) * 0.05).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat(((record.totalWork-record.pai) * 0.16).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh1 = parseFloat(((record.totalWork-record.pai) * 0.22).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh2 = parseFloat(((record.totalWork-record.pai) * 0.17).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshm = parseFloat(((record.totalWork-record.pai) * 0.16).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourszp = parseFloat(((record.totalWork-record.pai) * 0.11).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
} else if (this.productType === 'FS') {
this.model.workHoursjig = parseFloat(((record.totalWork-record.pai) * 0.1).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat(((record.totalWork-record.pai) * 0.04).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh1 = parseFloat(((record.totalWork-record.pai) * 0.35).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh2 = parseFloat(((record.totalWork-record.pai) * 0.3).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshm = parseFloat(((record.totalWork-record.pai) * 0.21).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
}
}
},
...mapGetters(['nickname', 'avatar', 'userInfo']),
submitForm() {
const that = this
const that = this
// 构造数据对象数组
let data = [];
let data = []
// 触发表单验证
this.$refs.form.validate((valid) => {
if (valid) {
that.confirmLoading = true
if (this.productType === 'JD') {
// 构造需要发送的数据数组对象
data = [
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
... ... @@ -1110,7 +1152,7 @@ export default {
]
} else if (this.productType === 'XC') {
// 构造需要发送的数据数组对象
data = [
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
... ... @@ -1150,7 +1192,7 @@ export default {
]
} else if (this.productType === 'QZ') {
// 构造需要发送的数据数组对象
data = [
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
... ... @@ -1188,9 +1230,9 @@ export default {
workHours: this.model.workHourshg,
},
]
}else if (this.productType === 'GX') {
} else if (this.productType === 'GX') {
// 构造需要发送的数据数组对象
data = [
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
... ... @@ -1254,12 +1296,10 @@ export default {
undertaker: this.model.undertakerzp,
workHours: this.model.workHourszp,
},
]
}else if (this.productType === 'SJ') {
} else if (this.productType === 'SJ') {
// 构造需要发送的数据数组对象
data = [
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
... ... @@ -1324,9 +1364,9 @@ export default {
workHours: this.model.workHourszp,
},
]
}else if (this.productType === 'FS') {
} else if (this.productType === 'FS') {
// 构造需要发送的数据数组对象
data = [
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
... ... @@ -1345,7 +1385,7 @@ export default {
undertaker: this.model.undertakerjuc,
workHours: this.model.workHoursjuc,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
... ... @@ -1373,106 +1413,145 @@ export default {
undertaker: this.model.undertakerhm,
workHours: this.model.workHourshm,
},
]
}
//接地工时和
var jiedihe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHourshg+this.model.workHoursqg+this.yp
var jiedihe =
parseFloat(this.model.workHoursjig) +
parseFloat(this.model.workHoursjuc) +
parseFloat(this.model.workHourshg) +
parseFloat(this.model.workHoursqg) +
parseFloat(this.yp)
//线槽
var xche=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHourshg+this.model.workHoursqg
var xche =
parseFloat(this.model.workHoursjig) +
parseFloat(this.model.workHoursjuc) +
parseFloat(this.model.workHourshg) +
parseFloat(this.model.workHoursqg) +
parseFloat(this.yp)
console.log(xche)
//卡子
var qzhe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHourshg+this.model.workHoursqg+this.yp
var qzhe =
parseFloat(this.model.workHoursjig) +
parseFloat(this.model.workHoursjuc) +
parseFloat(this.model.workHourshg) +
parseFloat(this.model.workHoursqg) +
parseFloat(this.yp)
//柜箱盒
var gxhe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHoursqg+this.yp+this.model.workHoursmh1+this.model.workHoursmh2+this.model.workHourshm+this.model.workHourszp
var gxhe =
parseFloat(this.model.workHoursjig) +
parseFloat(this.model.workHoursjuc) +
parseFloat(this.model.workHoursqg) +
parseFloat(this.yp) +
parseFloat(this.model.workHoursmh1) +
parseFloat(this.model.workHoursmh2) +
parseFloat(this.model.workHourshm) +
parseFloat(this.model.workHourszp)
//司机室
var sjshe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHoursqg+this.yp+this.model.workHoursmh1+this.model.workHoursmh2+this.model.workHourshm+this.model.workHourszp
var sjshe =
parseFloat(this.model.workHoursjig) +
parseFloat(this.model.workHoursjuc) +
parseFloat(this.model.workHoursqg) +
parseFloat(this.yp) +
parseFloat(this.model.workHoursmh1) +
parseFloat(this.model.workHoursmh2) +
parseFloat(this.model.workHourshm) +
parseFloat(this.model.workHourszp)
//附属钢
var fsghe=this.model.workHoursjig+this.model.workHoursjuc+this.yp+this.model.workHoursmh1+this.model.workHoursmh2+this.model.workHourshm
if(this.productType === 'JD' && data.workHours<=this.zong && jiedihe<=this.zong){
var fsghe =
parseFloat(this.model.workHoursjig) +
parseFloat(this.model.workHoursjuc) +
parseFloat(this.yp) +
parseFloat(this.model.workHoursmh1) +
parseFloat(this.model.workHoursmh2) +
parseFloat(this.model.workHourshm)
console.log(this.productType)
console.log(this.zong)
if(this.zong-this.yp===0){
that.$message.error('工时已派完')
that.confirmLoading = false
}else if (this.productType === 'JD' && jiedihe <= this.zong) {
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'XC' && data.workHours<=this.zong && xche<=this.zong){
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
} else if (this.productType === 'XC' && xche <= this.zong) {
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'QZ' && data.workHours<=this.zong && qzhe<=this.zong){
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
} else if (this.productType === 'QZ' && qzhe <= this.zong) {
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'GX' && data.workHours<=this.zong && gxhe<=this.zong){
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
} else if (this.productType === 'GX' && gxhe <= this.zong) {
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'SJ' && data.workHours<=this.zong && sjshe<=this.zong){
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
} else if (this.productType === 'SJ' && sjshe <= this.zong) {
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'FS' && data.workHours<=this.zong && fsghe<=this.zong){
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
} else if (this.productType === 'FS' && fsghe <= this.zong) {
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else{
that.$message.error("派发工时超过总工时")
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else {
that.$message.error('派发工时超过总工时')
that.confirmLoading = false
}
}
})
},
... ...
... ... @@ -21,7 +21,7 @@
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>产品类型:</span
><a-input v-model="model.productType" style="width: 200px; border: 0px; font-weight: bold"></a-input>
><a-input v-model="this.productType" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>任务下达时间:</span
... ... @@ -44,7 +44,7 @@
><a-input v-model="model.totalWork" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-left: 50px">
<span>已派发工时:</span><a-input v-model="model.pai" style="width: 200px; border: 0px"></a-input>
<span>已派发工时:</span><a-input v-model="model.pai" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<!-- 图片容器 -->
... ... @@ -111,6 +111,7 @@ export default {
},
data() {
return {
productType:'',
picList: '',
show: '',
num: 0,
... ... @@ -219,6 +220,19 @@ export default {
this.num = e
},
querygx(orderNumber, productType) {
if(this.model.productType === '接地'){
this.model.productType='JD'
}else if(this.model.productType === '线槽'){
this.model.productType= 'XC'
}else if(this.model.productType === '卡子'){
this.model.productType= 'QZ'
}else if(this.model.productType === '司机室'){
this.model.productType= 'SJ'
}else if(this.model.productType === '柜、箱、盒'){
this.model.productType= 'GX'
}else if(this.model.productType === '附属钢'){
this.model.productType= 'FS'
}
querygx(this.url.querygx, this.model).then((res) => {
console.log('工序订单号:', orderNumber)
console.log('工序产品类型:', productType)
... ... @@ -229,28 +243,38 @@ export default {
queryBynumber(orderNumber) {
console.log('1订单号:', orderNumber)
if(this.model.productType === '接地'){
this.model.productType='JD'
this.productType='接地'
}else if(this.model.productType === '线槽'){
this.model.productType= 'XC'
this.productType= '线槽'
}else if(this.model.productType === '卡子'){
this.model.productType= 'QZ'
this.productType= '卡子'
}else if(this.model.productType === '司机室'){
this.model.productType= 'SJ'
this.productType= '司机室'
}else if(this.model.productType === '柜、箱、盒'){
this.model.productType= 'GX'
this.productType= '柜、箱、盒'
}else if(this.model.productType === '附属钢'){
this.model.productType= 'FS'
this.productType= '附属钢'
}
queryBynumber(this.url.queryBynumber, this.model).then((res) => {
console.log(res.result)
this.imageSrc = res.result.pics
this.files = res.result.files
var picList = res.result.pics.split(',')
this.picList = picList
this.show = this.picList[0]
console.log('files:', this.files)
console.log(this.imageSrc)
})
queryBynumber(this.url.queryBynumber, { orderNumber: orderNumber }).then((res) => {
if (res.result) {
const result = res.result;
if (result.designPic) {
this.imageSrc = result.designPic;
this.picList = result.designPic.split(',');
this.show = this.picList[0];
}
if (result.designFile) {
this.designFile = result.designFile;
console.log('files:', this.designFile);
}
} else {
console.log('Response result or required properties are missing.');
}
})
.catch((error) => {
console.error('Error while fetching data:', error);
});
},
add() {
this.edit(this.modelDefault)
... ...